summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/shortcut_menu.html
blob: 5a811ddf015284aa92e09d4cf1549c129de017ad (plain)
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
40
41
42
43
44
45
46
47
{% load i18n %}
{% if current_menu %}
<div class="nav-item dropdown navbar-expand-lg navbar-collapse justify-content-end">
    <ul class="navbar-nav">
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" data-toggle="dropdown"
           href="#" role="button" aria-haspopup="true">
            {% trans "Default selection" %}
            <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>
        </a>
        <div id="shortcut-menu" class="dropdown-menu dropdown-menu-right">
                <form method="post" action="{% url 'update-current-item' %}">

                    <div class="short-menu-buttons btn-group" role="group">
                        <button type="button" class="btn btn-selected" id='short-menu-simple' title="{% trans 'Simple menu limited to your own items. Be careful only the last 100 items are displayed.' %}">{% trans "simple" %}</button>
                        <button type="button" class="btn" id='short-menu-advanced' title="{% trans 'Advanced menu' %}">{% trans "advanced" %}</button>
                    </div>
                    <div>
                        <table id='current_items'>
                            {% for lbl, model_name, main_cls, items in current_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' %}&#xf291; {% endifequal %}{% ifequal cls 'green' %}&#xf058; {% endifequal %}{% ifequal cls 'orange' %}&#xf06a; {% endifequal %}{% ifequal cls 'red' %}&#xf071; {% endifequal %}{{label}}</option>
                                        {% endfor %}</select>
                                </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' %}">
                                    <i class="fa fa-times"></i>
                                    </span></td>
                                {% endwith %}
                            </tr>
                            {% endfor %}
                        </table>
                    </div>
                </form>
        </div>
      </li>
    </ul>
</div>
<script type='text/javascript'>var advanced_menu = false;
{% if SHORTCUT_SHOW == 'off' %}var shortcut_menu_hide = true;
{% else %}var shortcut_menu_hide = false;{% endif %}
</script>
{% endif %}