summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-07-04 17:31:14 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-07-04 17:34:50 +0200
commiteaf0393eabd7089247b152897465b186b92be86f (patch)
tree8be87532d26e0a9c7f589810fe2ece50eaa1c242 /ishtar_common/templates
parent7a7da8e6cbd7121d2c1d121b3ba595d276241a60 (diff)
downloadIshtar-eaf0393eabd7089247b152897465b186b92be86f.tar.bz2
Ishtar-eaf0393eabd7089247b152897465b186b92be86f.zip
✨ sheet: add a refresh button to update informations
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/ishtar/blocks/window_nav.html30
-rw-r--r--ishtar_common/templates/ishtar/sheet.html4
2 files changed, 20 insertions, 14 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' %}">
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html
index f3df2e510..49c06b0a6 100644
--- a/ishtar_common/templates/ishtar/sheet.html
+++ b/ishtar_common/templates/ishtar/sheet.html
@@ -77,8 +77,8 @@
{% if output != "ODT" and output != "PDF" %}
{% block head_sheet %}
<script type="text/javascript">{% localize off %}
- var last_window='{{window_id}}';
-
+ var last_window = '{{window_id}}';
+ var current_url_{{window_id_underscore}} = "{{current_window_url}}{{item.pk}}/";
jQuery(document).ready(function(){
if (! get_next_table_id("{{item.pk}}")){
jQuery('.next_page').hide();