mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
handle menus that end up with zero items
This commit is contained in:
parent
ecc1143be5
commit
25d501fa27
2 changed files with 21 additions and 9 deletions
|
|
@ -45,17 +45,21 @@ Page properties:
|
|||
(when (getf (settings website) :color-class)
|
||||
(add-class menu (getf (settings website) :color-class)))
|
||||
(dolist (drop-down (getf properties :menu))
|
||||
(let ((drop (create-web-menu-drop-down menu
|
||||
:content (first drop-down)
|
||||
:class "w3-border")))
|
||||
(let ((drop (create-web-menu-drop-down menu
|
||||
:content (first drop-down)
|
||||
:class "w3-border"))
|
||||
(count 0))
|
||||
(dolist (item (second drop-down))
|
||||
(when (or (and (fourth item)
|
||||
(clog-auth:is-authorized-p (roles website)
|
||||
(fourth item)))
|
||||
(eq (fourth item) nil))
|
||||
(incf count)
|
||||
(create-web-menu-item drop
|
||||
:content (first item)
|
||||
:link (second item)))))))
|
||||
:link (second item))))
|
||||
(when (eql count 0)
|
||||
(destroy (parent-element drop))))))
|
||||
(create-br body)
|
||||
(let ((c (getf properties :content)))
|
||||
(when c
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue