From 3eff8cc19f8f8ef237788c752cb7c937195bb7e6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 24 Aug 2016 13:39:32 +0200 Subject: UI: adpat all sheet to the new layout. Administrativ act: can modify from sheet. Organization: can modify from sheet. --- .../templates/ishtar/sheet_contextrecord.html | 23 +----- .../ishtar/sheet_contextrecordsource.html | 9 +-- .../templates/ishtar/blocks/window_file_nav.html | 12 ++++ .../templates/ishtar/sheet_file.html | 27 ++------ archaeological_files/urls.py | 5 +- archaeological_files/views.py | 15 ++++ .../templates/ishtar/sheet_find.html | 5 +- .../templates/ishtar/sheet_findbasket.html | 13 +--- .../templates/ishtar/sheet_findsource.html | 9 +-- .../templates/ishtar/sheet_administrativeact.html | 14 ++-- .../templates/ishtar/sheet_operation.html | 8 +-- .../templates/ishtar/sheet_operationsource.html | 9 +-- archaeological_operations/urls.py | 5 +- archaeological_operations/views.py | 15 ++++ ishtar_common/static/media/style.css | 12 +++- ishtar_common/templates/blocks/JQueryJqGrid.html | 10 +-- .../templates/ishtar/blocks/window_nav.html | 81 +++++++++++----------- .../blocks/window_tables/dynamic_documents.html | 9 ++- .../templates/ishtar/sheet_organization.html | 10 +-- ishtar_common/templates/ishtar/sheet_person.html | 7 +- ishtar_common/templates/ishtar/sheet_source.html | 3 +- ishtar_common/templates/ishtar/sheet_toolbar.html | 2 - ishtar_common/templatetags/window_header.py | 24 ++++++- ishtar_common/urls.py | 2 + ishtar_common/views.py | 10 +++ version.py | 2 +- 26 files changed, 192 insertions(+), 149 deletions(-) create mode 100644 archaeological_files/templates/ishtar/blocks/window_file_nav.html delete mode 100644 ishtar_common/templates/ishtar/sheet_toolbar.html diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 2d2f6cbd1..04532838a 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -1,27 +1,10 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_field window_tables %} +{% load i18n window_field window_header window_tables %} -{% block head_sheet %} -{{block.super}} -

{% trans "Context Record"%}

-{% endblock %} +{% block head_title %}{% trans "Context Record" %}{% endblock %} {% block content %} -{% if previous or next %} -
-{%if previous%} -{%trans "Previous version"%} ({{previous}}) -{% endif %} -{% if previous and next %} - {% endif %} -{%if next%} -Rollback - -{%trans "Next version"%} ({{next}}) -{% endif %} -
-{% endif %} -
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
-
{% trans "Modify" %}
- +{% window_nav item window_id 'show-contextrecord' 'record_modify' 'show-historized-contextrecord' 'revert-contextrecord' previous next %} {% if item.operation.code_patriarche %}

{% else %} diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html index 17d09d843..253d5f047 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html @@ -1,9 +1,10 @@ {% extends "ishtar/sheet_source.html" %} -{% load i18n window_field link_to_window %} +{% load i18n window_field window_header link_to_window %} -{% block head_sheet %} -{{block.super}} -

{% trans "Context record source"%}

+{% block head_title %}{% trans "Context record source" %}{% endblock %} + +{% block window_nav %} +{% window_nav item window_id 'show-contextrecordsource' 'record_source_modify' %} {% endblock %} {% block related %} diff --git a/archaeological_files/templates/ishtar/blocks/window_file_nav.html b/archaeological_files/templates/ishtar/blocks/window_file_nav.html new file mode 100644 index 000000000..149603af8 --- /dev/null +++ b/archaeological_files/templates/ishtar/blocks/window_file_nav.html @@ -0,0 +1,12 @@ +{% extends "ishtar/blocks/window_nav.html" %} +{% load i18n %} +{% load url from future %} +{% block extra_actions %} + + + + + +
{%trans "Add an operation for this file" %} +
+{% endblock %} diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html index a5879b3ec..9ff6e8356 100644 --- a/archaeological_files/templates/ishtar/sheet_file.html +++ b/archaeological_files/templates/ishtar/sheet_file.html @@ -1,31 +1,14 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_ope_tables window_field %} +{% load i18n window_ope_tables window_field window_header %} -{% block head_sheet %} -{{block.super}} -

{% trans "Archaeological file"%}

-{% endblock %} +{% block head_title %}{% trans "Archaeological file" %}{% endblock %} {% block content %} -{% if previous or next %} -
-{%if previous%} -{%trans "Previous version"%} ({{previous}}) -{% endif %} -{% if previous and next %} - {% endif %} -{%if next%} -Rollback - -{%trans "Next version"%} ({{next}}) -{% endif %} -
-{% endif %} -
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
-
-
{% trans "Modify" %}
{% if can_add_operation %} -
{%trans "Add an associated archaeological operation"%}
- +{% window_file_nav item window_id previous next %} +{% else %} +{% window_nav item window_id 'show-file' 'file_modify' 'show-historized-file' 'revert-file' previous next %} {%endif%}

{% trans "General"%}

diff --git a/archaeological_files/urls.py b/archaeological_files/urls.py index 1fcf71531..c6b932fec 100644 --- a/archaeological_files/urls.py +++ b/archaeological_files/urls.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2015 Étienne Loks +# Copyright (C) 2010-2016 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -35,6 +35,9 @@ urlpatterns = patterns( check_rights(['change_administrativeact'])( views.file_administrativeactfile_wizard), name='file_administrativeactfile'), + url(r'file_administrativeactfile_modify/(?P.+)/$', + views.file_administrativeactfile_modify, + name='file_administrativeactfile_modify'), url(r'file_administrativeactfil_deletion/(?P.+)?$', check_rights(['change_administrativeact'])( views.file_administrativeactfile_deletion_wizard), diff --git a/archaeological_files/views.py b/archaeological_files/views.py index 3341c2813..a1b453169 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -241,6 +241,21 @@ file_administrativeactfile_modification_wizard = \ label=_(u"File: administrative act modification"), url_name='file_administrativeactfile_modification',) + +def file_administrativeactfile_modify(request, pk): + file_administrativeactfile_modification_wizard(request) + FileEditAdministrativeActWizard.session_set_value( + request, 'selec-file_administrativeactfile_modification', + 'pk', pk, reset=True) + return redirect( + reverse( + 'file_administrativeactfile_modification', + kwargs={ + 'step': + 'administrativeact-file_administrativeactfile_modification' + })) + + file_administrativeactfile_deletion_wizard = \ AdministrativeActDeletionWizard.as_view([ ('selec-file_administrativeactfile_deletion', diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index c4ce00aa0..f7c3838b8 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -2,10 +2,9 @@ {% load i18n window_field from_dict link_to_window window_tables window_header humanize %} {% load url from future %} -{% block head_title %}{% trans "Find"%}{% endblock %} +{% block head_title %}{% trans "Find" %}{% endblock %} {% block content %} - -{% window_nav 'show-find' 'find_modify' 'show-historized-find' 'revert-find' item window_id previous next %} +{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next %} {% if item.image %} diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket.html b/archaeological_finds/templates/ishtar/sheet_findbasket.html index 00b52ab7b..7738a872d 100644 --- a/archaeological_finds/templates/ishtar/sheet_findbasket.html +++ b/archaeological_finds/templates/ishtar/sheet_findbasket.html @@ -1,16 +1,9 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_tables from_dict %} +{% load i18n window_tables window_header from_dict %} -{% block head_sheet %} -{{block.super}} -

{% trans "Find"%}

-{% endblock %} +{% block head_title %}{% trans "Find basket" %}{% endblock %} {% block content %} - - - - +{% window_nav item window_id 'show-findbasket' 'select_itemsinbasket' %} {% dynamic_table_document_large finds 'finds_for_ope' 'basket' item.pk 'TABLE_COLS_FOR_OPE' output %} - {% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_findsource.html b/archaeological_finds/templates/ishtar/sheet_findsource.html index 04db0336c..69d14d161 100644 --- a/archaeological_finds/templates/ishtar/sheet_findsource.html +++ b/archaeological_finds/templates/ishtar/sheet_findsource.html @@ -1,9 +1,10 @@ {% extends "ishtar/sheet_source.html" %} -{% load i18n window_field link_to_window %} +{% load i18n window_field window_header link_to_window %} -{% block head_sheet %} -{{block.super}} -

{% trans "Find source"%}

+{% block head_title %}{% trans "Find source" %}{% endblock %} + +{% block window_nav %} +{% window_nav item window_id 'show-findsource' 'find_source_modify' %} {% endblock %} {% block related %} diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html index 23dc0a4c1..57acf9cbe 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html @@ -1,13 +1,15 @@ {% extends "ishtar/sheet.html" %} -{% load i18n %} +{% load i18n window_header %} -{% block head_sheet %} -{{block.super}} -

{% trans "Administrative act"%}

-{% endblock %} +{% block head_title %}{% trans "Administrative act" %}{% endblock %} {% block content %} - +{% if item.operation %} +{% window_nav item window_id 'show-administrativeact' 'operation_administrativeactop_modify' %} +{% else %} +{% window_nav item window_id 'show-administrativeact' 'file_administrativeactfile_modify' %} +{% endif %} +

{% trans "General"%}

{{ item.year }}

{% if item.index %}

{{ item.index }}

{% endif %} diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 9791ffe38..f0846f11f 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -1,12 +1,10 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_tables window_ope_tables window_field from_dict %} +{% load i18n window_tables window_header window_ope_tables window_field from_dict %} -{% block head_sheet %} -{{block.super}} -

{% trans "Operation"%}

-{% endblock %} +{% block head_title %}{% trans "Operation" %}{% endblock %} {% block content %} +{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next %} {% if previous or next %}
diff --git a/archaeological_operations/templates/ishtar/sheet_operationsource.html b/archaeological_operations/templates/ishtar/sheet_operationsource.html index 5bb8518a5..9b8cbf509 100644 --- a/archaeological_operations/templates/ishtar/sheet_operationsource.html +++ b/archaeological_operations/templates/ishtar/sheet_operationsource.html @@ -1,9 +1,10 @@ {% extends "ishtar/sheet_source.html" %} -{% load i18n window_field link_to_window %} +{% load i18n window_field window_header link_to_window %} -{% block head_sheet %} -{{block.super}} -

{% trans "Operation source"%}

+{% block head_title %}{% trans "Operation source" %}{% endblock %} + +{% block window_nav %} +{% window_nav item window_id 'show-operationsource' 'operation_source_modify' %} {% endblock %} {% block related %} diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index b25390bca..7d494f973 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2015 Étienne Loks +# Copyright (C) 2010-2016 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -40,6 +40,9 @@ urlpatterns = patterns( check_rights(['change_administrativeact'])( views.operation_administrativeactop_modification_wizard), name='operation_administrativeactop_modification'), + url(r'operation_administrativeactop_modify/(?P.+)/$', + views.operation_administrativeactop_modify, + name='operation_administrativeactop_modify'), url(r'operation_administrativeactop_deletion/(?P.+)?$', check_rights(['change_administrativeact'])( views.operation_administrativeactop_deletion_wizard), diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 55e2b2692..0481edae3 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -426,6 +426,21 @@ operation_administrativeactop_modification_wizard = \ label=_(u"Operation: administrative act modification"), url_name='operation_administrativeactop_modification',) + +def operation_administrativeactop_modify(request, pk): + operation_administrativeactop_modification_wizard(request) + OperationEditAdministrativeActWizard.session_set_value( + request, 'selec-operation_administrativeactop_modification', + 'pk', pk, reset=True) + return redirect( + reverse( + 'operation_administrativeactop_modification', + kwargs={ + 'step': + 'administrativeact-operation_administrativeactop_modification' + })) + + operation_administrativeactop_deletion_wizard = \ AdministrativeActDeletionWizard.as_view([ ('selec-operation_administrativeactop_deletion', diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 75277eb1d..69f86784b 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -743,6 +743,11 @@ table.confirm tr.spacer td:last-child{ background:url('images/indicator.gif') no-repeat right center; } +.gridfooter{ + text-align: center; + font-style: italic; +} + .jqgrid{ cursor:pointer; } @@ -986,12 +991,12 @@ table td.item-list span{ } #window .tool-right{ - float: left; + float: right; padding: 0 2em; } #window .tool-left{ - float: right; + float: left; padding: 0 2em; } @@ -1021,6 +1026,9 @@ table td.item-list span{ font-size:16px; margin-top:0; padding: 0.2em; +} + +#window .head, #window h1{ -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; -moz-border-radius-topleft: 8px; diff --git a/ishtar_common/templates/blocks/JQueryJqGrid.html b/ishtar_common/templates/blocks/JQueryJqGrid.html index c6a15243a..44f4b0ba8 100644 --- a/ishtar_common/templates/blocks/JQueryJqGrid.html +++ b/ishtar_common/templates/blocks/JQueryJqGrid.html @@ -12,13 +12,13 @@
+ {% if source_full %} -{% trans "Export as CSV" %} ({{encoding}}) -{% trans "simple" %} - -{% trans "full" %} +{% trans "CSV" %} +{% trans "CSV full" %} {% else %} -{% trans "Export as CSV" %} ({{encoding}}) -{% endif %} +{% trans "CSV" %} +{% endif %} {{encoding}}
{% if multiple %} diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index 9a17419a8..c225a5822 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -1,46 +1,47 @@ {% load url from future %} {% load i18n %} {% if previous or next %} -
-{% if previous %} - - - - - -
{{previous}} -
-{% else %} - -{% endif %} -{% if next %} - - - - - -
{% trans "Restore" %} -
- - - - - -
{{next}} -
-{% else %} - - +
+ {% if previous %} + + + + + +
{{previous}} +
+ {% else %} + + {% endif %} + {% if next %} + + + + + +
{% trans "Restore" %} +
+ + + + + +
{{next}} +
+ {% else %} + + + {% endif %} +
{% endif %} -
-{% endif %} -
- - - - - - -ODT PDF +
+ {% block extra_actions %}{% endblock %} + {% if modify_url %} + + + + + {% endif %} + ODT PDF

diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html index 8850bd34a..4a81a64fb 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html @@ -6,12 +6,11 @@
{% if source_full %} -{% trans "Export as CSV" %} ({{encoding}}) -{% trans "simple" %} - -{% trans "full" %} +{% trans "CSV" %} +{% trans "CSV full" %} {% else %} -{% trans "Export as CSV" %} ({{encoding}}) -{% endif %} +CSV +{% endif %} {{encoding}}