|
89 | 89 | {{~#each (to_array menu_item)~}}
|
90 | 90 | {{~#if (or (eq (typeof this) 'object') (and (eq (typeof this) 'string') (starts_with this '{')))}}
|
91 | 91 | {{~#with (parse_json this)}}
|
92 |
| - <li class="nav-item{{#if this.submenu}} dropdown{{/if}}"> |
93 |
| - {{#if (gt (len this.title) 0)}} |
| 92 | + {{#if (or (gt (len this.title) 0) (gt (len this.icon) 0) (gt (len this.image) 0))}} |
| 93 | + <li class="nav-item{{#if this.submenu}} dropdown{{/if}}"> |
94 | 94 | <a class="nav-link {{#if this.submenu}}dropdown-toggle{{/if}}" href="{{#if this.link}}{{this.link}}{{else}}#{{/if}}"
|
95 | 95 | {{~#if this.submenu}} data-bs-toggle="dropdown" data-bs-auto-close="outside" {{/if~}}
|
96 |
| - role="button"> |
| 96 | + role="button" |
| 97 | + > |
| 98 | + {{~#if this.image~}} |
| 99 | + <span {{~#if this.title}} class="me-1"{{/if}}> |
| 100 | + {{~#if (eq this.size 'sm')}} |
| 101 | + <img width=16 height=16 src="{{this.image}}"> |
| 102 | + {{~else~}} |
| 103 | + <img width=24 height=24 src="{{this.image}}"> |
| 104 | + {{~/if~}} |
| 105 | + </span> |
| 106 | + {{~/if~}} |
| 107 | + {{#if this.icon}} |
| 108 | + {{#if this.title}}<span class="me-1">{{/if}} |
| 109 | + {{~icon_img this.icon~}} |
| 110 | + {{#if this.title}}</span>{{/if}} |
| 111 | + {{/if}} |
97 | 112 | {{~this.title~}}
|
98 | 113 | </a>
|
99 |
| - {{~/if~}} |
100 |
| - {{~#if this.submenu~}} |
101 |
| - <div class="dropdown-menu dropdown-menu-end" data-bs-popper="static"> |
102 |
| - {{~#each this.submenu~}} |
103 |
| - {{~#if (gt (len this.title) 0)~}} |
104 |
| - <a class="dropdown-item" href="{{this.link}}"> |
105 |
| - {{~this.title~}} |
106 |
| - </a> |
107 |
| - {{~/if~}} |
108 |
| - {{~/each~}} |
109 |
| - </div> |
110 |
| - {{/if}} |
111 |
| - </li> |
| 114 | + {{~#if this.submenu~}} |
| 115 | + <div class="dropdown-menu dropdown-menu-end" data-bs-popper="static"> |
| 116 | + {{~#each this.submenu~}} |
| 117 | + {{#if (or (gt (len this.title) 0) (gt (len this.icon) 0) (gt (len this.image) 0))}} |
| 118 | + <a class="dropdown-item" href="{{this.link}}"> |
| 119 | + {{~#if this.image~}} |
| 120 | + <span {{~#if this.title}} class="me-1"{{/if}}> |
| 121 | + {{~#if (eq ../this.size 'sm')}} |
| 122 | + <img width=16 height=16 src="{{this.image}}"> |
| 123 | + {{~else~}} |
| 124 | + <img width=24 height=24 src="{{this.image}}"> |
| 125 | + {{~/if~}} |
| 126 | + </span> |
| 127 | + {{~/if~}} |
| 128 | + {{#if this.icon}} |
| 129 | + {{#if this.title}}<span class="me-1">{{/if}} |
| 130 | + {{~icon_img this.icon~}} |
| 131 | + {{#if this.title}}</span>{{/if}} |
| 132 | + {{/if}} |
| 133 | + {{~this.title~}} |
| 134 | + </a> |
| 135 | + {{~/if~}} |
| 136 | + {{~/each~}} |
| 137 | + </div> |
| 138 | + {{/if}} |
| 139 | + </li> |
| 140 | + {{/if}} |
112 | 141 | {{/with}}
|
113 | 142 | {{~else}}
|
114 | 143 | {{~#if (gt (len this) 0)~}}
|
|
0 commit comments