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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
{% load l10n i18n ishtar_helpers %}
<script type="text/javascript">{% localize off %}
var current_url_{{window_id_underscore}};
var reload_window_{{window_id_underscore}} = function() {
/* reload put the sheet at the end of list - force other to be close in order to not loose the current sheet */
$(".sheet > .collapse").removeClass("show");
load_window(current_url_{{window_id_underscore}},
'', function(){hide_window("{{window_id}}");},
true);
};
{% endlocalize %}</script>
{% if not item.is_external %}
<div class="row toolbar">
<div class='col-md-2'>
<div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Refresh'%}">
<button type="button" class="btn btn-secondary"
data-toggle="tooltip" data-placement="bottom"
title="{% trans 'Refresh' %}"
onclick="reload_window_{{window_id_underscore}}();return false;">
<i class="fa fa-refresh"></i>
</button>
{% if current_user.is_superuser and previous %}
</div>
<div class="btn-group btn-group-sm ml-3" role="group" aria-label="{% trans 'History'%}">
<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 current_user.is_superuser and next %}
<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>
</div>
<div class="btn-group btn-group-sm mr-2" role="group" aria-label="{% trans 'Restore'%}">
<button type="button" class="btn btn-warning"
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>
{% endif %}
</div>
</div>
<div class='offset-md-1 col-md-9 text-right'>
{% 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>
{% if item.OLD_SHEET_EXPORT or extra_templates or item.HAS_QR_CODE or item.get_absolute_url %}
<div class="btn-group btn-group-sm" role="group"
aria-label="{% trans 'Export' %}">
<div class="btn btn-sm dropdown btn-secondary">
<a class="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" %}
</a>
<div class="dropdown-menu"
aria-labelledby="dropdown-sheet-export-{{window_id}}">
{% if item.OLD_SHEET_EXPORT %}
<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>{% endif %}{% for template_name, template_url, icon in extra_templates %}
<a class="dropdown-item" href='{{template_url}}'>
<i class="{{icon}}" 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>
{% endif %}
</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();
});
</script>
{% else %}
<h3 class="external-source"><i class="fa fa-globe" aria-hidden="true"></i> {{item.current_source}}</h3>
{% endif %}
|