From efd07035a8a206965b125349fb525472d45446ef Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 29 Nov 2017 13:22:35 +0100 Subject: UI: better management of sheet --- ishtar_common/static/js/ishtar.js | 9 +++++++- ishtar_common/static/media/styles.css | 8 +++++++ ishtar_common/templates/base.html | 5 ++++- ishtar_common/templates/blocks/DataTables.html | 21 ++++++++++++------ ishtar_common/templates/ishtar/sheet.html | 2 +- ishtar_common/views.py | 30 +++----------------------- 6 files changed, 39 insertions(+), 36 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index dfe59105c..e89be9ff3 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -272,7 +272,14 @@ function load_window(url, speed, on_success){ $("#progress").hide(); $(".previous_page").remove(); $(".next_page").remove(); - $("#window").append(html); + var register_id = $(html).find(".card-header").attr("data-sheet-id"); + var current_sheet = $('[data-sheet-id="' + register_id + '"]'); + if (current_sheet.length){ + $(".collapse").removeClass('show'); + current_sheet.parent().find('.collapse').addClass('show'); + } else { + $("#window").append(html); + } $("#"+last_window).show(); if (on_success) on_success(); }, diff --git a/ishtar_common/static/media/styles.css b/ishtar_common/static/media/styles.css index ed6900fd0..773554b95 100644 --- a/ishtar_common/static/media/styles.css +++ b/ishtar_common/static/media/styles.css @@ -95,6 +95,14 @@ div#foot{ margin-bottom: 1em; } +.table-modal-lg .current-sheets{ + margin-bottom: 1em; +} + +.dataTables_wrapper .dataTables_processing{ + height: auto; +} + .display_details{ font-size: 1.4em; } diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index aefba8f73..215c51b8d 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -61,7 +61,10 @@
-
+
+
+
+ {% if warnings %}{% for warning in warnings %}
@@ -83,13 +85,16 @@