Parent: [caf8f4] (diff)

Child: [a4546e] (diff)

Download this file

sidebar_menu.html    39 lines (38 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% macro sidebar_item(s) -%}
{% if s.url %}
<li{% if request.url.find(s.url,-s.url.__len__()) != -1 %} class="active"{% endif %}>
<a href="{{s.url}}"{% if s.className %} class="{{s.className or ''}}"{% endif %}>{% if s.ui_icon %}<b data-icon="{{s.ui_icon}}" class="ico"></b> {% endif %}<span{% if s.small != None %} class="has_small"{% endif %}>{{s.label}}</span>{% if s.small != None %}<small>{{s.small}}</small>{% endif %}</a>
</li>
{% else %}
</ul>
{% if s.label %}
<h3 class="{{s.className or ''}}">{% if s.ui_icon %}<b data-icon="{{s.ui_icon}}" class="ico" title="Edit"></b>{% endif %}{{s.label}}</h3>
{% endif %}
<ul class="sidebarmenu">
{% endif %}
{%- endmacro %}
<div id="sidebar">
{% if c.app and c.app.searchable %}
<form id="search" method="GET" action="{{c.app.url + 'search/'}}">
<input name="q" class="border defaultText" type="text" title="Search {{c.app.config.options.mount_point.title()}}"/>
</form>
{% else %}
<div>&nbsp;</div>
{% endif %}
<ul>
{% if c.custom_sidebar_menu %}
{% for s in c.custom_sidebar_menu %}
{{sidebar_item(s)}}
{% endfor %}
{% endif %}
{% if c.app %}
{% for s in c.app.sidebar_menu() %}
{{sidebar_item(s)}}
{% endfor %}
{% elif c.project %}
{% for s in c.project.sidebar_menu() %}
{{sidebar_item(s)}}
{% endfor %}
{% endif %}
</ul>
</div>