From f437e1cf2fca65f0642ea82a29cc96de0d57c06d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 10 Mar 2011 00:29:26 +0100 Subject: Manage multiple windows --- ishtar/furnitures/views.py | 2 ++ ishtar/templates/sheet.html | 9 +++++++-- ishtar/templates/sheet_file.html | 4 ++-- ishtar/templates/sheet_operation.html | 4 ++-- static/js/ishtar.js | 6 ++++-- static/media/style.css | 6 +----- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index b212dee77..b22257839 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -246,6 +246,8 @@ def show_item(model, name): return HttpResponse(None) doc_type = 'type' in dct and dct.pop('type') dct['item'], dct['item_name'] = item, name + dct['window_id'] = "%s-%d-%s" % (name, item.pk, + datetime.datetime.now().strftime('%M%s')) context_instance = RequestContext(request) context_instance.update(dct) n = datetime.datetime.now() diff --git a/ishtar/templates/sheet.html b/ishtar/templates/sheet.html index c157b61a0..8da56345c 100644 --- a/ishtar/templates/sheet.html +++ b/ishtar/templates/sheet.html @@ -12,8 +12,13 @@ {% endblock %} -
- +
+ +
{% block content %}{% endblock %}
diff --git a/ishtar/templates/sheet_file.html b/ishtar/templates/sheet_file.html index 314fcaf06..8a004b0a5 100644 --- a/ishtar/templates/sheet_file.html +++ b/ishtar/templates/sheet_file.html @@ -25,7 +25,7 @@

{{ item.file_type }}

-{% if item.related_file %}

{{ item.related_file }}

{% endif %} +{% if item.related_file %}

{{ item.related_file }}

{% endif %} {% if item.comment %}

{{ item.comment }}

{%endif%}

{% trans "Localisation"%}

@@ -91,7 +91,7 @@ {{operation.in_charge|default:""}} {{operation.start_date|default:""}} {{operation.end_date|default:""}} - {% trans "Details" %} + {% trans "Details" %} {% empty %} {% trans "No operation associated to this archaelogical file" %} diff --git a/ishtar/templates/sheet_operation.html b/ishtar/templates/sheet_operation.html index 8902126c6..d0e31ae5a 100644 --- a/ishtar/templates/sheet_operation.html +++ b/ishtar/templates/sheet_operation.html @@ -30,7 +30,7 @@

{{ item.periods.all|join:", " }}

{% if item.associated_file %} -

{{ item.associated_file }}

+

{{ item.associated_file }}

{% if item.associated_file.is_preventive %} {#{% if item.operator_reference_code %}

{{ item.operator_reference_code }}

{% endif %}#} {% if item.associated_file.town_planning_service %}

{{ item.associated_file.town_planning_service }}

{% endif %} @@ -115,7 +115,7 @@ {{ context_record.datings.all|join:", " }}{# periods ?#} {{ context_record.description }} {{ parcel.section }} - {{parcel.parcel_number}} - {% trans "Details" %} + {% trans "Details" %} {% empty %} {% trans "No context record associated to parcel " %}{{ parcel.section }} - {{parcel.parcel_number}} diff --git a/static/js/ishtar.js b/static/js/ishtar.js index 7dc1be345..784480f81 100644 --- a/static/js/ishtar.js +++ b/static/js/ishtar.js @@ -45,13 +45,15 @@ $("#main_menu ul li").live('click', function(){ $(this).find('ul').show('slow'); }); +var last_window; + function load_window(url){ $.ajax({ url: url, cache: false, success:function(html){ - $("#window").html(html); - $("#window").show('slow'); + $("#window").append(html); + $("#"+last_window).show('slow'); }, error:function(XMLHttpRequest, textStatus, errorThrows){ } diff --git a/static/media/style.css b/static/media/style.css index 8aa4ead48..7868a4671 100644 --- a/static/media/style.css +++ b/static/media/style.css @@ -249,7 +249,7 @@ table.confirm tr.spacer td:last-child{ color:#D14; } -#window{ +.sheet{ width:760px; position:fixed; height:90%; @@ -299,10 +299,6 @@ table.confirm tr.spacer td:last-child{ font-style:italic; } -#window .sheet{ -} - - #window .head{ text-align:center; background-color:#EEE; -- cgit v1.2.3