diff options
Diffstat (limited to 'ishtar_common/templates/ishtar/blocks/window_nav.html')
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_nav.html | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index c1d96acde..41572c5f2 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -1,11 +1,23 @@ -{% load i18n ishtar_helpers %} +{% load l10n i18n ishtar_helpers %} +<script type="text/javascript">{% localize off %} + var current_url_{{window_id_underscore}}; + var reload_window_{{window_id_underscore}} = function() { + load_window(current_url_{{window_id_underscore}}, + '', function(){hide_window("{{window_id}}");}, + true); + }; +{% endlocalize %}</script> {% if not item.is_external %} <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="{% trans 'Refresh' %}" + onclick="reload_window_{{window_id_underscore}}();return false;"> + <i class="fa fa-refresh"></i> + </button> + {% if current_user.is_superuser and previous %} <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="{{previous|date}} {{previous|time:'H:i'}}" @@ -13,10 +25,10 @@ <i class="fa fa-step-backward"></i> </button> {% endif %} - {% if next %} + {% if current_user.is_superuser and 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 %}");});}' + 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> @@ -30,12 +42,6 @@ </div> </div> <div class='offset-md-1 col-md-9 text-right'> - {% else %} - <div class='offset-md-3 col-md-9 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' %}"> |