diff options
26 files changed, 192 insertions, 149 deletions
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}} -<h1>{% trans "Context Record"%}</h1> -{% endblock %} +{% block head_title %}{% trans "Context Record" %}{% endblock %} {% block content %} -{% if previous or next %} -<div class='tool'> -{%if previous%} -<a href="#" onclick='load_window("{% url show-historized-contextrecord item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'>{%trans "Previous version"%} ({{previous}})</a> -{% endif %} -{% if previous and next %} - {% endif %} -{%if next%} -<a href="#" onclick='if(confirm("{%trans "Are you sure to rollback to this version?"%}")){load_url("{% url revert-contextrecord item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show-contextrecord item.pk None %}");}'>Rollback</a> - -<a href="#" onclick='load_window("{% url show-historized-contextrecord item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;'>{%trans "Next version"%} ({{next}})</a> -{% endif %} -</div> -{% endif %} -<div class='tool'>{%trans "Export as:"%} <a href='{% url show-contextrecord item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-contextrecord item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> -<div class='tool modify'><a href='{% url record_modify item.pk %}'>{% trans "Modify" %}</a></div> - +{% window_nav item window_id 'show-contextrecord' 'record_modify' 'show-historized-contextrecord' 'revert-contextrecord' previous next %} {% if item.operation.code_patriarche %} <p><label>{%trans "Complete ID:"%}</label> {% 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}} -<h1>{% trans "Context record source"%}</h1> +{% 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 %} +<a class='history-nav' href='{% url "operation_add" item.pk %}'> + <span class="fa-stack fa-lg"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-plus fa-stack-1x fa-inverse"></i> + </span> + <br/>{%trans "Add an operation for this file" %} +</a> +{% 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}} -<h1>{% trans "Archaeological file"%}</h1> -{% endblock %} +{% block head_title %}{% trans "Archaeological file" %}{% endblock %} {% block content %} -{% if previous or next %} -<div class='tool'> -{%if previous%} -<a href="#" onclick='load_window("{% url show-historized-file item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'>{%trans "Previous version"%} ({{previous}})</a> -{% endif %} -{% if previous and next %} - {% endif %} -{%if next%} -<a href="#" onclick='if(confirm("{%trans "Are you sure to rollback to this version?"%}")){load_url("{% url revert-file item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show-file item.pk None %}");}'>Rollback</a> - -<a href="#" onclick='load_window("{% url show-historized-file item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;'>{%trans "Next version"%} ({{next}})</a> -{% endif %} -</div> -{% endif %} -<div class='tool'>{%trans "Export as:"%} <a href='{% url show-file item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-file item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> -<hr/> -<div class='tool modify'><a href='{% url file_modify item.pk %}'>{% trans "Modify" %}</a></div> {% if can_add_operation %} -<div class='tool modify'><a href='{% url operation_add item.pk %}'>{%trans "Add an associated archaeological operation"%}</a></div> - +{% 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%} <h3>{% trans "General"%}</h3> 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 <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # 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<pk>.+)/$', + views.file_administrativeactfile_modify, + name='file_administrativeactfile_modify'), url(r'file_administrativeactfil_deletion/(?P<step>.+)?$', 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 %} <a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> 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}} -<h1>{% trans "Find"%}</h1> -{% endblock %} +{% block head_title %}{% trans "Find basket" %}{% endblock %} {% block content %} - -<div class='tool'>{%trans "Export as:"%} <a href='{% url show-findbasket item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-findbasket item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> -<div class='tool modify'><a href='{% url select_itemsinbasket item.pk %}'>{% trans "Modify" %}</a></div> - +{% 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}} -<h1>{% trans "Find source"%}</h1> +{% 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}} -<h1>{% trans "Administrative act"%}</h1> -{% endblock %} +{% block head_title %}{% trans "Administrative act" %}{% endblock %} {% block content %} -<div class='tool'>{%trans "Export as:"%} <a href='{% url show-administrativeact item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-administrativeact item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> +{% 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 %} + <h3>{% trans "General"%}</h3> <p><label>{%trans "Year:"%}</label> <span class='value strong'>{{ item.year }}</span></p> {% if item.index %}<p><label>{%trans "Numerical reference:"%}</label> <span class='value strong'>{{ item.index }}</span></p>{% 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}} -<h1>{% trans "Operation"%}</h1> -{% 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 %} <div class='tool'> 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}} -<h1>{% trans "Operation source"%}</h1> +{% 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 <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # 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<pk>.+)/$', + views.operation_administrativeactop_modify, + name='operation_administrativeactop_modify'), url(r'operation_administrativeactop_deletion/(?P<step>.+)?$', 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 @@ <div id='pager_{{name}}'></div> <div id='foot_{{name}}' class='gridfooter'> + {% if source_full %} -{% trans "Export as CSV" %} ({{encoding}}) -<a class='{{sname}}-csv' href='{{source}}csv' target='_blank'>{% trans "simple" %}</a> - -<a class='{{sname}}-csv-full' href='{{source_full}}csv' target='_blank'>{% trans "full" %}</a> +<a class='badge {{sname}}-csv' href='{{source}}csv' target='_blank' title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a> +<a class='badge {{sname}}-csv-full' href='{{source_full}}csv' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a> {% else %} -<a class='{{sname}}-csv' href="{{source}}csv" target="_blank">{% trans "Export as CSV" %} ({{encoding}})</a> -{% endif %} +<a class='{{sname}}-csv' href="{{source}}csv" target="_blank" title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a> +{% endif %} {{encoding}} </div> {% 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 %} -<div class='tool-left'> -{% if previous %} -<a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;' title="{%trans 'Previous version'%}"> -<span class="fa-stack"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-step-backward fa-stack-1x fa-inverse"></i> -</span> -<br/>{{previous}} -</a> -{% else %} -<span class='history-nav'> </span> -{% endif %} -{% if next %} -<a class='history-nav' title="{% trans 'Restore this version' %}" href="#" onclick='if(confirm("{%trans 'Are you sure to restore to this version? All changement made since this version will be lost.' %}")){load_url("{% url revert_url item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show_url item.pk None %}");}'> -<span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-exchange fa-stack-1x fa-inverse"></i> -</span> -<br/>{% trans "Restore" %} -</a> -<a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;' title="{%trans 'Next version'%}"> -<span class="fa-stack"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-step-forward fa-stack-1x fa-inverse"></i> -</span> -<br/>{{next}} -</a> -{% else %} -<span class='history-nav'> </span> -<span class='history-nav'> </span> + <div class='tool-right'> + {% if previous %} + <a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;' title="{%trans 'Previous version'%}"> + <span class="fa-stack"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-step-backward fa-stack-1x fa-inverse"></i> + </span> + <br/>{{previous}} + </a> + {% else %} + <span class='history-nav'> </span> + {% endif %} + {% if next %} + <a class='history-nav' title="{% trans 'Restore this version' %}" href="#" onclick='if(confirm("{%trans 'Are you sure to restore to this version? All changement made since this version will be lost.' %}")){load_url("{% url revert_url item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show_url item.pk None %}");}'> + <span class="fa-stack fa-lg"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-history fa-stack-1x fa-inverse"></i> + </span> + <br/>{% trans "Restore" %} + </a> + <a class='history-nav' href="#" onclick='load_window("{% url histo_url item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;' title="{%trans 'Next version'%}"> + <span class="fa-stack"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-step-forward fa-stack-1x fa-inverse"></i> + </span> + <br/>{{next}} + </a> + {% else %} + <span class='history-nav'> </span> + <span class='history-nav'> </span> + {% endif %} + </div> {% endif %} -</div> -{% endif %} -<div class='tool-right'> -<a href='{% url modify_url item.pk %}' title="{% trans 'Modify' %}"> -<span class="fa-stack fa-lg"> - <i class="fa fa-circle fa-stack-2x"></i> - <i class="fa fa-pencil fa-stack-1x fa-inverse"></i> -</span> -</a> -<a class='badge' href='{% url show_url item.pk "odt" %}' title='{% trans "Export as OpenOffice.org file"%}'>ODT</a> <a class='badge' href='{% url show_url item.pk "pdf" %}' title='{% trans "Export as PDF file"%}'>PDF</a> +<div class='tool-left'> + {% block extra_actions %}{% endblock %} + {% if modify_url %}<a href='{% url modify_url item.pk %}' title="{% trans 'Modify' %}"> + <span class="fa-stack fa-lg"> + <i class="fa fa-circle fa-stack-2x"></i> + <i class="fa fa-pencil fa-stack-1x fa-inverse"></i> + </span> + </a>{% endif %} + <a class='badge' href='{% url show_url item.pk "odt" %}' title='{% trans "Export as OpenOffice.org file"%}'>ODT</a> <a class='badge' href='{% url show_url item.pk "pdf" %}' title='{% trans "Export as PDF file"%}'>PDF</a> </div> <hr class='clear'> 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 @@ <div id='foot_{{name}}' class='gridfooter'> {% if source_full %} -{% trans "Export as CSV" %} ({{encoding}}) -<a href='{{simple_source}}csv{{ source_attrs|safe }}' target='_blank'>{% trans "simple" %}</a> - -<a href='{{source_full}}csv{{ source_attrs|safe }}' target='_blank'>{% trans "full" %}</a> +<a class="badge" href='{{simple_source}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a> +<a class="badge" href='{{source_full}}csv{{ source_attrs|safe }}' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a> {% else %} -<a href="{{simple_source}}csv{{ source_attrs|safe }}" target="_blank">{% trans "Export as CSV" %} ({{encoding}})</a> -{% endif %} +<a class="badge" href="{{simple_source}}csv{{ source_attrs|safe }}" target="_blank" title="{% trans 'Export as CSV' %}">CSV</a> +{% endif %} {{encoding}} </div> <script type="text/javascript" language='javascript'> diff --git a/ishtar_common/templates/ishtar/sheet_organization.html b/ishtar_common/templates/ishtar/sheet_organization.html index 8deeebf98..2ece97a8b 100644 --- a/ishtar_common/templates/ishtar/sheet_organization.html +++ b/ishtar_common/templates/ishtar/sheet_organization.html @@ -1,14 +1,10 @@ {% extends "ishtar/sheet.html" %} -{% load i18n %} +{% load i18n window_header %} -{% block head_sheet %} -{{block.super}} -<h1>{% trans "Organization"%}</h1> -{% endblock %} +{% block head_title %}{% trans "Organization" %}{% endblock %} {% block content %} -<div class='tool'>{%trans "Export as:"%} <a href='{% url show-organization item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-organization item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> - +{% window_nav item window_id 'show-organization' 'organization_modify' %} <p><label>{% trans "Name" %}</label> <span class='value'>{{item.name}}</span></p> <p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p> {% if item.address %}<p><label>{% trans "Address" %}</label> <span class='value'>{{item.address}}</span></p> {% endif %} diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html index 3c554acdf..f5c42c11a 100644 --- a/ishtar_common/templates/ishtar/sheet_person.html +++ b/ishtar_common/templates/ishtar/sheet_person.html @@ -1,10 +1,9 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_field window_tables %} - -{% block header_title %}<h1>{% trans "Person"%}</h1>{% endblock %} -{% block toolbar %}{% with current_action='person_modification' %}{% include "ishtar/sheet_toolbar.html" %}{% endwith %}{% endblock %} +{% load i18n window_field window_tables window_header %} +{% block head_title %}{% trans "Person"%}{% endblock %} {% block content %} +{% window_nav item window_id 'show-person' 'person_modify' %} <h3>{% trans "Identity" %}</h3> {% field "Name" item.name %} diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html index bda22ed35..653087753 100644 --- a/ishtar_common/templates/ishtar/sheet_source.html +++ b/ishtar_common/templates/ishtar/sheet_source.html @@ -1,7 +1,8 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_field link_to_window %} -{% block toolbar %}{% with current_action='operation_source_modification' %}{% include "ishtar/sheet_toolbar.html" %}{% endwith %}{% endblock %} + {% block content %} +{% block window_nav %}{% endblock %} {% block general %} {% field "Title" item.title %} {% field "Index" item.index %} diff --git a/ishtar_common/templates/ishtar/sheet_toolbar.html b/ishtar_common/templates/ishtar/sheet_toolbar.html deleted file mode 100644 index d9d4cc1a5..000000000 --- a/ishtar_common/templates/ishtar/sheet_toolbar.html +++ /dev/null @@ -1,2 +0,0 @@ -{% load i18n link_to_window %}<div class='tool'>{% trans "Export as:" %} <a href='{{item|link_to_odt}}'>{%trans "OpenOffice.org file"%}</a>, <a href='{{item|link_to_pdf}}'>{%trans "PDF file"%}</a></div> -{% modify_toolbar item current_action %} diff --git a/ishtar_common/templatetags/window_header.py b/ishtar_common/templatetags/window_header.py index 48248ee3d..b137f24a5 100644 --- a/ishtar_common/templatetags/window_header.py +++ b/ishtar_common/templatetags/window_header.py @@ -1,11 +1,12 @@ from django import template +from django.utils.safestring import mark_safe register = template.Library() @register.inclusion_tag('ishtar/blocks/window_nav.html') -def window_nav(show_url, modify_url, histo_url, revert_url, item, window_id, - previous, nxt): +def window_nav(item, window_id, show_url, modify_url='', histo_url='', + revert_url='', previous=None, nxt=None): return { 'show_url': show_url, 'modify_url': modify_url, @@ -15,3 +16,22 @@ def window_nav(show_url, modify_url, histo_url, revert_url, item, window_id, 'window_id': window_id, 'previous': previous, 'next': nxt} + + +@register.inclusion_tag('ishtar/blocks/window_file_nav.html') +def window_file_nav(item, window_id, previous=None, nxt=None): + show_url = 'show-file' + modify_url = 'file_modify' + histo_url = 'show-historized-file' + revert_url = 'revert-file' + add_operation = "" + return { + 'show_url': show_url, + 'modify_url': modify_url, + 'histo_url': histo_url, + 'revert_url': revert_url, + 'item': item, + 'extra_action': mark_safe(add_operation), + 'window_id': window_id, + 'previous': previous, + 'next': nxt} diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py index daaac77e3..a6f24beed 100644 --- a/ishtar_common/urls.py +++ b/ishtar_common/urls.py @@ -64,6 +64,8 @@ urlpatterns = patterns( check_rights(['change_organization', 'change_own_organization'])( views.organization_modification_wizard), name='organization_modification'), + url(r'organization_modify/(?P<pk>.+)/$', views.organization_modify, + name='organization_modify'), url(r'organization_deletion/(?P<step>.+)?$', check_rights(['change_organization', 'change_own_organization'])( views.organization_deletion_wizard), name='organization_deletion'), diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 8c784ac72..79d3054b3 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -143,6 +143,16 @@ organization_modification_wizard = wizards.OrganizationModifWizard.as_view( label=_(u"Organization modification"), url_name='organization_modification') + +def organization_modify(request, pk): + organization_modification_wizard(request) + wizards.OrganizationModifWizard.session_set_value( + request, 'selec-organization_modification', 'pk', pk, reset=True) + return redirect( + reverse('organization_modification', + kwargs={'step': 'identity-organization_modification'})) + + organization_deletion_wizard = wizards.OrganizationDeletionWizard.as_view( [('selec-organization_deletion', forms.OrganizationFormSelection), ('final-organization_deletion', FinalDeleteForm)], diff --git a/version.py b/version.py index 05bd3e50a..87e2537c1 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 97, 0, 1) +VERSION = (0, 97, 0, 2) def get_version(): |