diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-30 14:06:38 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-30 14:06:38 +0100 |
commit | 56fa09eb703c29568d9d04ab806c5e42a570fc4c (patch) | |
tree | 6f5488e715b77e96575c18a911491bb1ac2275fa /ishtar_common/templates | |
parent | 2f0115da348110b0dbbadfbdb0a03790f60a7738 (diff) | |
download | Ishtar-56fa09eb703c29568d9d04ab806c5e42a570fc4c.tar.bz2 Ishtar-56fa09eb703c29568d9d04ab806c5e42a570fc4c.zip |
UI: put actions on a top menu
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r-- | ishtar_common/templates/actions.html | 53 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 25 | ||||
-rw-r--r-- | ishtar_common/templates/blocks/action_list.html | 12 | ||||
-rw-r--r-- | ishtar_common/templates/navbar.html | 6 |
4 files changed, 66 insertions, 30 deletions
diff --git a/ishtar_common/templates/actions.html b/ishtar_common/templates/actions.html new file mode 100644 index 000000000..a42581049 --- /dev/null +++ b/ishtar_common/templates/actions.html @@ -0,0 +1,53 @@ +<ul class="navbar-nav action-menu"> + {% with MENU.current_section as section_label %} + {% with MENU.current_sections as sections %} + {% include "blocks/action_list.html" %} + {% endwith %}{% endwith %} + + {% if MENU.current_subsections %} + <li class="nav-item"> + <span class="nav-link">></span> + </li> + {% with MENU.current_subsection as section_label %} + {% with MENU.current_subsections as sections %} + {% include "blocks/action_list.html" %} + {% endwith %}{% endwith %} + {% endif %} + + {% if MENU.current_subsubsections %} + <li class="nav-item"> + <span class="nav-link">></span> + </li> + {% with MENU.current_subsubsection as section_label %} + {% with MENU.current_subsubsections as sections %} + {% include "blocks/action_list.html" %} + {% endwith %}{% endwith %} + {% endif %} +</ul> +{% comment %} +<div id="main_menu"> + <ul> + {% for section in MENU.childs %} + {% if section.available %} + <li id='section-{{section.idx}}'{% if section.css %} class="{{section.css}}"{% endif %}> + {{section.label}} + <ul> + {% for menu_item in section.childs %}{%if menu_item.available%} + {% if menu_item.childs %}<li id='subsection-{{menu_item.idx}}'{% if menu_item.css %} class="{{menu_item.css}}"{% endif %}>{{menu_item.label}} + <ul> + {% for menu_subitem in menu_item.childs %}{% if menu_subitem.available %} + {% url 'action' menu_subitem.idx as item_url %} + <li id='{{menu_subitem.idx}}'{% if item_url in CURRENT_PATH %} class='selected'{% endif %}><a + href='{{item_url}}'>{{menu_subitem.label}}</a></li> + {%endif%}{% endfor %}</ul></li> + {% else %} + {% url 'action' menu_item.idx as item_url %} + <li id='{{menu_item.idx}}' + class="{% if item_url in CURRENT_PATH %}selected{% endif %} {% if menu_item.css %}{{menu_item.css}}{% endif %}"><a href="{{item_url}}">{{menu_item.label}}</a></li> + {%endif%}{% endif %}{% endfor %} + </ul> + </li>{%endif%} + {% endfor %} + </ul> +</div> +{% endcomment %} diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index ce383ba6c..5a61d72e9 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -64,31 +64,6 @@ <p><strong class='lbl'>{{lbl}}{% trans ":"%}</strong> <span class='value'>{{value}}</span></p> {% endfor %} </fieldset>{%endif%} - <div id="main_menu"> - <ul> - {% for section in MENU.childs %} - {% if section.available %} - <li id='section-{{section.idx}}'{% if section.css %} class="{{section.css}}"{% endif %}> - {{section.label}} - <ul> - {% for menu_item in section.childs %}{%if menu_item.available%} - {% if menu_item.childs %}<li id='subsection-{{menu_item.idx}}'{% if menu_item.css %} class="{{menu_item.css}}"{% endif %}>{{menu_item.label}} - <ul> - {% for menu_subitem in menu_item.childs %}{% if menu_subitem.available %} - {% url 'action' menu_subitem.idx as item_url %} - <li id='{{menu_subitem.idx}}'{% if item_url in CURRENT_PATH %} class='selected'{% endif %}><a - href='{{item_url}}'>{{menu_subitem.label}}</a></li> - {%endif%}{% endfor %}</ul></li> - {% else %} - {% url 'action' menu_item.idx as item_url %} - <li id='{{menu_item.idx}}' - class="{% if item_url in CURRENT_PATH %}selected{% endif %} {% if menu_item.css %}{{menu_item.css}}{% endif %}"><a href="{{item_url}}">{{menu_item.label}}</a></li> - {%endif%}{% endif %}{% endfor %} - </ul> - </li>{%endif%} - {% endfor %} - </ul> - </div> <div class="container"> {% if warnings %}{% for warning in warnings %} <div class="alert alert-warning alert-dismissible fade show" role="alert"> diff --git a/ishtar_common/templates/blocks/action_list.html b/ishtar_common/templates/blocks/action_list.html new file mode 100644 index 000000000..50a6554c4 --- /dev/null +++ b/ishtar_common/templates/blocks/action_list.html @@ -0,0 +1,12 @@ +<li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" + data-toggle="dropdown" href="#" role="button" aria-haspopup="true" + aria-expanded="false">{{section_label}}</a> + + <div class="dropdown-menu"> + {% for label, url, has_children in sections %} + <a class="dropdown-item{% if has_children%} font-weight-bold{%endif%}" href="{{url}}"> + {{ label }} + </a>{% endfor %} + </div> +</li> diff --git a/ishtar_common/templates/navbar.html b/ishtar_common/templates/navbar.html index a8c764185..228f18530 100644 --- a/ishtar_common/templates/navbar.html +++ b/ishtar_common/templates/navbar.html @@ -8,11 +8,7 @@ </a> </nav> <div class="collapse navbar-collapse"> - <ul class="navbar-nav"> - <li class="nav-item active"> - <a class="nav-link" href="#">Operation...</a> - </li> - </ul> + {% include "actions.html" %} </div> <ul class="navbar-nav"> {% if APP_NAME %} |