diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:13:16 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:48:04 +0200 |
commit | f60470064e73bf874c96db8f4217c4c8ba603c39 (patch) | |
tree | 354a5f8d9b9c2b226c7fae104a4f799d6a8fceef /ishtar_common/templates | |
parent | df6ea17f4b8bb1d45fe480044af80bd19742bf80 (diff) | |
download | Ishtar-f60470064e73bf874c96db8f4217c4c8ba603c39.tar.bz2 Ishtar-f60470064e73bf874c96db8f4217c4c8ba603c39.zip |
WIP: ajaxify shortcut menu - 3
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r-- | ishtar_common/templates/base.html | 6 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/shortcut_menu.html | 20 |
2 files changed, 12 insertions, 14 deletions
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index cd7b00457..7101ed7de 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -33,13 +33,11 @@ <script type='text/javascript'> var shortcut_url = '{% url "shortcut-menu" %}'; var get_file_url = '{% url "get-file-shortcut" %}'; - var get_own_file_url = '{% url "get-own-file-shortcut" %}'; var get_operation_url = '{% url "get-operation-shortcut" %}'; - var get_own_operation_url = '{% url "get-own-operation-shortcut" %}'; var get_contextrecord_url = '{% url "get-contextrecord-shortcut" %}'; - var get_own_contextrecord_url = '{% url "get-own-contextrecord-shortcut" %}'; var get_find_url = '{% url "get-find-shortcut" %}'; - var get_own_find_url = '{% url "get-own-find-shortcut" %}'; + var activate_all_search_url = '{% url "activate-all-search" %}'; + var activate_own_search_url = '{% url "activate-own-search" %}'; var activate_all_search_msg = "{% trans 'Searches in the shortcut menu deals with all items.' %}"; var activate_own_search_msg = "{% trans 'Searches in the shortcut menu deals with only your items.' %}"; </script> diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html index 8a0f694ae..fc1131c90 100644 --- a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html @@ -1,27 +1,27 @@ {% load i18n %} {% load url from future%} -{% if current_menu %} +{% if menu %} <form method="post" action="{% url 'update-current-item' %}"> <fieldset> <div id='action_current_items'> <p><i class="icon fa fa-thumb-tack fa-2x" aria-hidden="true" title="{% trans 'Pin an item in order to constrain default searches with this item. By default only your items are displayed. New created and modified items are auto-pin.' %}"></i></p> <p> -<a href='' onclick='return activate_own_search();' class='activate_own_search'><i class="icon fa fa-user" aria-hidden="true" title="{% trans 'Search within my items' %}"></i></a> -<a href='' class='activate_all_search disabled' onclick='return activate_all_search();'><i class="icon fa fa-users" aria-hidden="true" title="{% trans 'Search within all items' %}"></i></a> +<a href='' onclick='return activate_own_search();' class='activate_own_search{% if SHORTCUT_SEARCH == 'all' %} disabled{% endif %}'><i class="icon fa fa-user" aria-hidden="true" title="{% trans 'Search within my items' %}"></i></a> +<a href='' class='activate_all_search{% if SHORTCUT_SEARCH == 'own' %} disabled{% endif %}' onclick='return activate_all_search();'><i class="icon fa fa-users" aria-hidden="true" title="{% trans 'Search within all items' %}"></i></a> +</p> +<p> +<a href='' onclick='return load_shortcut_menu();' class='disabled'><i class="icon fa fa-2x fa-refresh" aria-hidden="true" title="{% trans 'Refresh menu' %}"></i></a> </p> </div> <table id='current_items'> -{% for lbl, model_name, main_cls, items in current_menu %} +{% for lbl, model_name, current, widget in menu %} <tr> <td><label for="current_{{model_name}}">{{lbl}}</label></td> <td> - <select class='{{main_cls}} chosen-select' id='current_{{model_name}}'> - <option class='normal' value=''>----------</option> - {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %} {% endifequal %}{% ifequal cls 'green' %} {% endifequal %}{% ifequal cls 'orange' %} {% endifequal %}{% ifequal cls 'red' %} {% endifequal %}{{label}}</option> - {% endfor %}</select> + {{widget|safe}} </td>{% with 'show-'|add:model_name as model_url%} - <td><a href='#' onclick='load_current_window("{% url model_url 0 %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> - <td><span class='pin-action' onclick='$.get("{% url 'unpin' model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> + <td><a href='#' onclick='load_current_window("{% url model_url current %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> + <td><span class='disabled pin-action' onclick='$.get("{% url 'unpin' model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}"> <i class="fa fa-times"></i> </span></td> {% endwith %} |