summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/window_nav.html
blob: 1d8121faf11e2551e0a72b87ef9c5178a4e106f4 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% load i18n ishtar_helpers %}
<div class="row toolbar">
  {% if current_user.is_superuser %}
  {% if previous or next %}
  <div class='col-md-2'>
    <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'History'%}">
        {% if previous %}
          <button type="button" class="btn btn-secondary"
                  data-toggle="tooltip" data-placement="bottom"
                  title="{{previous|date}} {{previous|time:'H:i'}}"
                  onclick='load_window("{% url histo_url item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'>
              <i class="fa fa-step-backward"></i>
          </button>
        {% endif %}
        {% if next %}
        <button type="button" class="btn btn-secondary"
                data-toggle="tooltip" data-placement="bottom"
                onclick='if(confirm("{%trans 'Are you sure to restore to this version? All changes made since this version will be lost.' %}")){load_url("{% url revert_url item.pk item.history_date|date:"c"%}", function(){closeAllWindows();load_window("{% url show_url item.pk None %}");});}'
                title="{% trans 'Restore this version' %}">
            <i class="fa fa-history"></i>
        </button>
        <button type="button" class="btn btn-secondary"
                data-toggle="tooltip" data-placement="bottom"
                onclick='load_window("{% url histo_url item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;'
                title="{{next|date}} {{next|time:'H:i'}}">
            <i class="fa fa-step-forward"></i>
        </button>
        {% endif %}
    </div>
  </div>
  <div class='offset-md-4 col-md-6 text-right'>
  {% else %}
  <div class='offset-md-6 col-md-6 text-right'>
  {% endif %}
  {% else %}
  <div class='offset-md-6 col-md-6 text-right'>
  {% endif %}
      {% if pin_action and item.SLUG %}
      <div class="btn-group btn-group-sm" role="group"
           aria-label="{% trans 'Pin' %}">
          <a class="btn btn-secondary pin-action" href="#"
             onclick='$.get("{% url "pin" item.SLUG item.pk %}", function(){load_shortcut_menu(); display_info("{% trans 'Item pined in your shortcut menu.' %}")});' title="{% trans 'Pin' %}">
              <i class="fa fa-thumb-tack"></i>
          </a>
          {% block post_pin %}
          {% endblock %}
      </div>
      {% endif %}
      <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Actions' %}">
        {% block extra_actions %}{% endblock %}
        {% if modify_url and not item|is_locked:current_user %}
        <a class="btn btn-success wait-button" href='{% url modify_url item.pk %}'
           title="{% trans 'Modify' %}">
            <i class="fa fa-pencil"></i>
        </a>
        {% endif %}
        {% for url, base_text, icon, extra_text, css_class, is_qa in extra_actions %}
        <a class="{% if is_qa %}btn-qa{% else %}wait-button{% endif %} btn btn-success{% if css_class %} {{css_class}}{% endif %}"
           {% if is_qa %}href="#" data-target="{{url}}"{% else %}href='{{url}}'{% endif %} title="{{base_text}}">
            <i class="{{icon}}"></i> {{extra_text}}
        </a>
        {% endfor %}
          {% if delete_url and not item|is_locked:current_user %}
          <a class="btn btn-danger wait-button" href='{% url delete_url item.pk %}'
             title="{% trans 'Delete' %}">
              <i class="fa fa-trash" aria-hidden="true"></i>
          </a>
          {% endif %}
      </div>

      <div class="btn-group btn-group-sm" role="group"
           aria-label="{% trans 'Export' %}">
          <div class="dropdown btn-secondary">
              <button class="btn btn-sm btn-secondary dropdown-toggle" type="button"
                      id="dropdown-sheet-export-{{window_id}}"
                      data-toggle="dropdown"aria-haspopup="true"
                      aria-expanded="false">
                  <i class="fa fa-file-word-o"></i> {% trans "Export" %}
              </button>
              <div class="dropdown-menu"
                   aria-labelledby="dropdown-sheet-export-{{window_id}}">
                  <a class="dropdown-item" href='{% url show_url item.pk "odt" %}'
                     title='{% trans "Export as OpenOffice.org file"%}'>
                      <i class="fa fa-file-word-o" aria-hidden="true"></i> ODT
                  </a>
                  <a class="dropdown-item" href='{% url show_url item.pk "pdf" %}'
                     title='{% trans "Export as PDF file"%}'>
                      <i class="fa fa-file-pdf-o" aria-hidden="true"></i> PDF
                  </a>{% for template_name, template_url in extra_templates %}
                  <a class="dropdown-item" href='{{template_url}}'>
                      <i class="fa fa-file-word-o" aria-hidden="true"></i> {{template_name}}
                  </a>{% endfor %}
                  {% if item.HAS_QR_CODE %}<a class="dropdown-item" href='{% url "qrcode-item" item.APP item.MODEL item.pk %}' target="_blank">
                     <i class="fa fa-qrcode" aria-hidden="true"></i> {% trans "QR Code" %} 
                  </a>{% endif %}
                  {% if item.get_absolute_url %}<a class="dropdown-item" href='{{item.get_absolute_url}}'>
                     <i class="fa fa-link" aria-hidden="true"></i> {% trans "Permanent link" %}
                  </a>{% endif %}
              </div>
          </div>


      </div>
  </div>
</div>
{% if next %}
<div class="alert alert-warning" role="alert">
  {% trans "Relation between items are not historized." %}
</div>
{% endif %}
<script type="text/javascript">
$(document).ready(function(){
    register_qa_on_sheet();
});
</script>