1
1
{% macro render_item(item, submenu=False, parent=False) %}
2
2
{% if item.child_items %}
3
3
4
- {% if parent %}
4
+ {% if parent %}
5
5
6
- {%- set dropdown_id = 'id-' + frappe.utils.generate_hash('Dropdown', 12) -%}
7
- < li class ="nav-item dropdown {% if submenu %} dropdown-submenu {% endif %} ">
8
- < a class ="navbar-link dropdown-toggle " href ="# " id ="{{ dropdown_id }} " role ="button "
9
- data-toggle =" dropdown " aria-haspopup ="true " aria-expanded ="false ">
10
- {{ _(item.label) }}
11
- </ a >
12
- < ul class ="dropdown-menu " aria-labelledby ="{{ dropdown_id }} ">
13
- {% for child in item.child_items %}
14
- {{ render_item(child, True) }}
15
- {% endfor %}
16
- </ ul >
17
- </ li >
18
- {% else %}
19
- {%- set dropdown_id = 'id-' + frappe.utils.generate_hash('Dropdown', 12) -%}
20
- < li class ="dropdown {% if submenu %} dropdown-submenu {% endif %} ">
21
- < a class ="dropdown-item dropdown-toggle " href ="# " id ="{{ dropdown_id }} " role ="button "
22
- data-toggle =" dropdown " aria-haspopup ="true " aria-expanded ="false ">
23
- {{ _(item.label) }}
24
- </ a >
25
- < ul class ="dropdown-menu " aria-labelledby ="{{ dropdown_id }} ">
26
- {% for child in item.child_items %}
27
- {{ render_item(child, True) }}
28
- {% endfor %}
29
- </ ul >
30
- </ li >
31
- {% endif %}
6
+ {%- set dropdown_id = 'id-' + frappe.utils.generate_hash('Dropdown', 12) -%}
7
+ < li class ="nav-item dropdown {% if submenu %} dropdown-submenu {% endif %} ">
8
+ < a class ="navbar-link dropdown-toggle " href ="# " id ="{{ dropdown_id }} " role ="button " data-toggle =" dropdown "
9
+ aria-haspopup ="true " aria-expanded ="false ">
10
+ {{ _(item.label) }}
11
+ </ a >
12
+ < ul class ="dropdown-menu " aria-labelledby ="{{ dropdown_id }} ">
13
+ {% for child in item.child_items %}
14
+ {{ render_item(child, True) }}
15
+ {% endfor %}
16
+ </ ul >
17
+ </ li >
18
+ {% else %}
19
+ {%- set dropdown_id = 'id-' + frappe.utils.generate_hash('Dropdown', 12) -%}
20
+ < li class ="dropdown {% if submenu %} dropdown-submenu {% endif %} ">
21
+ < a class ="dropdown-item dropdown-toggle " href ="# " id ="{{ dropdown_id }} " role ="button " data-toggle =" dropdown "
22
+ aria-haspopup ="true " aria-expanded ="false ">
23
+ {{ _(item.label) }}
24
+ </ a >
25
+ < ul class ="dropdown-menu " aria-labelledby ="{{ dropdown_id }} ">
26
+ {% for child in item.child_items %}
27
+ {{ render_item(child, True) }}
28
+ {% endfor %}
29
+ </ ul >
30
+ </ li >
31
+ {% endif %}
32
32
33
33
{% else %}
34
34
35
- {% if parent %}
36
- < li class ="nav-item ">
37
- < a class ="navbar-link " href ="{{ (item.url or '')|abs_url }} "
38
- {% if item.open_in_new_tab %} target ="_blank " {% endif %} >
39
- {{ _(item.label) }}
40
- </ a >
41
- </ li >
42
- {% else %}
43
- < a class ="dropdown-item " href ="{{ (item.url or '') | abs_url }} "
44
- {% if item.open_in_new_tab %} target ="_blank " {% endif %} >
35
+ {% if parent %}
36
+ < li class ="nav-item ">
37
+ < a class ="navbar-link " href ="{{ (item.url or '')|abs_url }} " {% if item.open_in_new_tab %} target ="_blank " {% endif
38
+ %} >
45
39
{{ _(item.label) }}
46
40
</ a >
47
- {% endif %}
41
+ </ li >
42
+ {% else %}
43
+ < a class ="dropdown-item " href ="{{ (item.url or '') | abs_url }} " {% if item.open_in_new_tab %} target ="_blank " {% endif
44
+ %} >
45
+ {{ _(item.label) }}
46
+ </ a >
47
+ {% endif %}
48
48
49
49
{% endif %}
50
50
{% endmacro %}
51
51
52
52
< ul class ="navbar-nav ">
53
53
{% include "wiki/doctype/wiki_page/templates/navbar_search.html" %}
54
54
{%- for item in navbar_items -%}
55
- {% if not item.parent_label and item.right -%}
56
- {{ render_item(item, parent=True) }}
57
- {%- endif -%}
55
+ {% if not item.parent_label and item.right -%}
56
+ {{ render_item(item, parent=True) }}
57
+ {%- endif -%}
58
58
{%- endfor %}
59
59
{% if not only_static %}
60
- {% block navbar_right_extension %}{% endblock %}
60
+ {% block navbar_right_extension %}{% endblock %}
61
61
{% endif %}
62
62
< div class ="d-block d-sm-none sm-sidebar ">
63
63
<!--sidebar-->
64
64
</ div >
65
+ < div class ="sun-moon-container ">
66
+ < svg class ="feather feather-moon hide " xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 "
67
+ fill ="none " stroke ="currentColor " stroke-width ="2 " stroke-linecap ="round " stroke-linejoin ="round ">
68
+ < path d ="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z "> </ path >
69
+ </ svg >
70
+ < svg class ="feather feather-sun hide " xmlns ="http://www.w3.org/2000/svg " width ="20 " height ="20 " viewBox ="0 0 24 24 "
71
+ fill ="none " stroke ="currentColor " stroke-width ="2 " stroke-linecap ="round " stroke-linejoin ="round ">
72
+ < circle cx ="12 " cy ="12 " r ="5 "> </ circle >
73
+ < line x1 ="12 " y1 ="1 " x2 ="12 " y2 ="3 "> </ line >
74
+ < line x1 ="12 " y1 ="21 " x2 ="12 " y2 ="23 "> </ line >
75
+ < line x1 ="4.22 " y1 ="4.22 " x2 ="5.64 " y2 ="5.64 "> </ line >
76
+ < line x1 ="18.36 " y1 ="18.36 " x2 ="19.78 " y2 ="19.78 "> </ line >
77
+ < line x1 ="1 " y1 ="12 " x2 ="3 " y2 ="12 "> </ line >
78
+ < line x1 ="21 " y1 ="12 " x2 ="23 " y2 ="12 "> </ line >
79
+ < line x1 ="4.22 " y1 ="19.78 " x2 ="5.64 " y2 ="18.36 "> </ line >
80
+ < line x1 ="18.36 " y1 ="5.64 " x2 ="19.78 " y2 ="4.22 "> </ line >
81
+ </ svg >
82
+ </ div >
65
83
{% include "templates/includes/navbar/navbar_login.html" %}
66
84
67
85
70
88
< a class ="btn btn-primary navbar-cta " href ="{{ call_to_action_url | abs_url }} ">
71
89
{{ call_to_action }}
72
90
</ a >
73
- {%- endif -%}
91
+ {%- endif -%}
0 commit comments