From e3a1f1aa0d0aa05f8f969adb3e40701aaa9ad39f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 12:16:20 +0100 Subject: Imports: add a name (refs #3452) --- ishtar_common/templates/ishtar/import_delete.html | 33 ++++++++++++----------- ishtar_common/templates/ishtar/import_list.html | 6 ++++- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/import_delete.html b/ishtar_common/templates/ishtar/import_delete.html index 30217bf8d..4b48ebc8c 100644 --- a/ishtar_common/templates/ishtar/import_delete.html +++ b/ishtar_common/templates/ishtar/import_delete.html @@ -4,21 +4,22 @@ {% block content %}

{{page_name}}

-
{% csrf_token %} -

{% trans "The current items are linked to this import:" %}

-{% for accessor, imported in object.get_all_imported %} -{% ifchanged imported|verbose_model_name %} -{% if forloop.counter %}{% endif %} -

{{imported|verbose_model_name}}

-
    -{%endifchanged%} -
  • {{imported}}
  • -{% endfor %} -
-

{% trans "All these items will be deleted with this import." %}

-{% trans "Are you sure?" %} - -
-

{% trans "Back" %}

+

{{object}}

+
{% csrf_token %} +

{% trans "The current items are linked to this import:" %}

+ {% for accessor, imported in object.get_all_imported %} + {% ifchanged imported|verbose_model_name %} + {% if forloop.counter %}{% endif %} +

{{imported|verbose_model_name}}

+
    + {%endifchanged%} +
  • {{imported}}
  • + {% endfor %} +
+

{% trans "All these items will be deleted with this import." %}

+ {% trans "Are you sure?" %} + +
+

{% trans "Back" %}

{% endblock %} diff --git a/ishtar_common/templates/ishtar/import_list.html b/ishtar_common/templates/ishtar/import_list.html index 55a4ea883..a33786f6b 100644 --- a/ishtar_common/templates/ishtar/import_list.html +++ b/ishtar_common/templates/ishtar/import_list.html @@ -8,8 +8,9 @@

{% trans "No pending imports." %}

{% else %}
{% csrf_token %} - +
+ @@ -18,6 +19,9 @@ {% for import in object_list %} + -- cgit v1.2.3 From ac840acf81be5a2b002948cfd92871112ba40567 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 12:40:11 +0100 Subject: Imports: admin can see all imports (refs #3450) --- ishtar_common/static/media/style.css | 2 ++ ishtar_common/templates/ishtar/import_list.html | 2 +- ishtar_common/views.py | 21 +++++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 06c80c194..2fd56f697 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -1490,6 +1490,7 @@ table.table-form td input{ margin: 10px 0 10px 0; width: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); + border-collapse: collapse; } .clean-table h4{ @@ -1526,6 +1527,7 @@ table.table-form td input{ background: #DA2D2D; text-align: center; padding: 0.2em 0.4em; + border-right: 1px solid #fff; } .clean-table tr th.sub { diff --git a/ishtar_common/templates/ishtar/import_list.html b/ishtar_common/templates/ishtar/import_list.html index a33786f6b..5dba51b6f 100644 --- a/ishtar_common/templates/ishtar/import_list.html +++ b/ishtar_common/templates/ishtar/import_list.html @@ -29,7 +29,7 @@ {% trans "Source file" %}
{% trans "Name" %} {% trans "Type" %} {% trans "File" context "file" %} {% trans "Creation" %}
+ {{import.name|default:"-"}} + {{import.importer_type}} - {{import.creation_date}} + {{import.creation_date}} ({{import.user}}) {{import.status}} diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 18bdc6e36..95b7689ec 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1629,9 +1629,11 @@ class ImportListView(IshtarMixin, LoginRequiredMixin, ListView): current_url = 'current_imports' def get_queryset(self): + q = self.model.objects.exclude(state='AC') + if self.request.user.is_superuser: + return q.order_by('-creation_date') user = models.IshtarUser.objects.get(pk=self.request.user.pk) - return self.model.objects.filter(user=user).exclude( - state='AC').order_by('-creation_date') + return q.filter(user=user).order_by('-creation_date') def post(self, request, *args, **kwargs): for field in request.POST: @@ -1643,10 +1645,11 @@ class ImportListView(IshtarMixin, LoginRequiredMixin, ListView): imprt = models.Import.objects.get(pk=int(field.split('-')[-1])) except (models.Import.DoesNotExist, ValueError): continue - # user can only edit his own imports - user = models.IshtarUser.objects.get(pk=self.request.user.pk) - if imprt.user != user: - continue + if not self.request.user.is_superuser: + # user can only edit his own imports + user = models.IshtarUser.objects.get(pk=self.request.user.pk) + if imprt.user != user: + continue action = request.POST[field] if action == 'D': return HttpResponseRedirect(reverse('import_delete', @@ -1665,9 +1668,11 @@ class ImportOldListView(ImportListView): current_url = 'old_imports' def get_queryset(self): + q = self.model.objects.filter(state='AC') + if self.request.user.is_superuser: + return q.order_by('-creation_date') user = models.IshtarUser.objects.get(pk=self.request.user.pk) - return self.model.objects.filter( - user=user, state='AC').order_by('-creation_date') + return q.filter(user=user).order_by('-creation_date') class ImportLinkView(IshtarMixin, LoginRequiredMixin, ModelFormSetView): -- cgit v1.2.3 From 83a5855c7bb49f0caca9b18d01579688b6490380 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 13:54:25 +0100 Subject: Sheets: add ishtar ID (refs #3517) --- .../templates/ishtar/sheet_contextrecord.html | 18 +++--------- archaeological_files/models.py | 5 ++++ .../templates/ishtar/sheet_file.html | 27 +++++------------- .../templates/ishtar/sheet_find.html | 32 +++++++++------------- archaeological_operations/models.py | 4 +++ .../templates/ishtar/sheet_operation.html | 3 +- .../templates/ishtar/sheet_container.html | 6 ++-- .../templates/ishtar/sheet_warehouse.html | 7 +++-- example_project/settings.py | 1 + ishtar_common/static/media/style.css | 4 +++ .../ishtar/blocks/sheet_creation_section.html | 19 +++++++++++++ .../templates/ishtar/blocks/sheet_external_id.html | 7 +++++ version.py | 2 +- 13 files changed, 76 insertions(+), 59 deletions(-) create mode 100644 ishtar_common/templates/ishtar/blocks/sheet_creation_section.html create mode 100644 ishtar_common/templates/ishtar/blocks/sheet_external_id.html (limited to 'ishtar_common/templates') diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 1c024dcfc..7ba34fd13 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -12,23 +12,13 @@

{{ item.parcel.short_label }}

{{ item.label|default:"" }}

+{% include "ishtar/blocks/sheet_external_id.html" %}
  • {{item.full_label}}
  • -
  • - - {{item.history_creator.ishtaruser.person}}
    - {{item.history_creation_date|date:"DATETIME_FORMAT"}} -
    -
  • - {% if item.history_creation_date != item.last_edition_date %} -
  • - - {{item.history_modifier.ishtaruser.person}}
    - {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} -
    -
  • - {% endif %} + + {% include "ishtar/blocks/sheet_creation_section.html" %} + {% field_li "Type" item.unit %} {% field_li_multiple "Chronology" item.datings %} {% field_li "Town" item.parcel.town %} diff --git a/archaeological_files/models.py b/archaeological_files/models.py index c8134f28f..7f37a298f 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -235,6 +235,11 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, def short_class_name(self): return _(u"FILE") + @property + def full_internal_ref(self): + return u"{}{}".format(settings.ISHTAR_FILE_PREFIX or '', + self.external_id or '') + @property def delay_date(self): cache_key, val = get_cache(self.__class__, [self.pk, 'delay_date']) diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html index 408edde34..bfd92eb6f 100644 --- a/archaeological_files/templates/ishtar/sheet_file.html +++ b/archaeological_files/templates/ishtar/sheet_file.html @@ -11,29 +11,16 @@ {% window_nav item window_id 'show-file' 'file_modify' 'show-historized-file' 'revert-file' previous next 1 %} {% endif %} +

    {{item.full_internal_ref|default:''}}

    +

    {{item.internal_reference|default:''}}

    +

    {{item.name|default:''}}

    +{% include "ishtar/blocks/sheet_external_id.html" %} +

    {% trans "General"%}

      -{% field_li "Year" item.year "" "" %} -{% field_li "Numerical reference" item.numeric_reference "" "" %} -{% field_li "Other reference" item.internal_reference %} -{% field_li "Name" item.name %} - {% field_li "Reception date" item.reception_date|date:"DATE_FORMAT" %} - -
    • - - {{item.history_creator.ishtaruser.person}}
      - {{item.history_creation_date|date:"DATETIME_FORMAT"}} -
      -
    • - {% if item.history_creation_date != item.last_edition_date %} -
    • - - {{item.history_modifier.ishtaruser.person}}
      - {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} -
      -
    • - {% endif %} + {% field_li "Reception date" item.reception_date|date:"DATE_FORMAT" %} + {% include "ishtar/blocks/sheet_creation_section.html" %} {% comment %} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index b088f3161..7889870b9 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -15,26 +15,13 @@

      {% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.short_id}}{% endfor %}

      {{ item.administrative_index|default:"" }}

      {{ item.contextrecord|default:"" }}

      - +{% include "ishtar/blocks/sheet_external_id.html" %}
        -{% field_li "Previous ID" item.previous_id %} - -
      • - - {{item.history_creator.ishtaruser.person}}
        - {{item.history_creation_date|date:"DATETIME_FORMAT"}} -
        -
      • - {% if item.history_creation_date != item.last_edition_date %} -
      • - - {{item.history_modifier.ishtaruser.person}}
        - {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} -
        -
      • - {% endif %} + {% field_li "Previous ID" item.previous_id %} + + {% include "ishtar/blocks/sheet_creation_section.html" %} {% field_li "Administrative index" item.administrative_index %} {% field_li_multiple "Material types" item.material_types %} {% field_li "Dating" item.dating %} @@ -176,9 +163,16 @@

        {% trans "Associated base finds"%}

        {% for base_find in item.base_finds.all %} +

        {{base_find.complete_id }}

        +

        {{base_find.short_id }}

        +{% if base_find.external_id %} +

        + + + {{base_find.external_id|default:''}} + +

        {% endif %}
          -{% field_li "Complete ID" base_find.complete_id %} -{% field_li "Short ID" base_find.short_id %} {% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} {% with item.history_creator.ishtaruser.full_label|add:"
          "|add:creation_date|add:"" as creator %} {% field_li "Created by" creator|safe %} diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index bc2169009..ebe9ae551 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -403,6 +403,10 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, def short_class_name(self): return _(u"OPE") + @property + def external_id(self): + return self.code_patriarche + @property def short_label(self): if settings.COUNTRY == 'fr': diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index d3eb980c4..3e89c3c39 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -20,10 +20,11 @@

          {% if item.year or item.operation_code %}{{item.year|default:''}}-{{item.operation_code|default:''}}{% endif %}{% if item.code_patriarche %} – OA{{item.code_patriarche}}{% endif %}

          {{item.common_name|default:''}}

          +{% include "ishtar/blocks/sheet_external_id.html" %}

          {% trans "General"%}

            -{% field_li "Old code" item.old_code %} + {% field_li "Old code" item.old_code %}
          • {{item.history_creator.ishtaruser.person}}
            diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 4a7b2f0b9..94be2fc04 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -6,9 +6,11 @@ {% block content %} {% window_nav item window_id 'show-container' '' '' '' previous next 1 %} +

            {{ item.reference|default:"" }}

            +

            {{ item.container_type|default:"" }}

            +{% include "ishtar/blocks/sheet_external_id.html" %} +
              - {% field_li "Reference" item.reference %} - {% field_li "Container type" item.container_type %} {% field_li_detail "Responsible warehouse" item.responsible %} {% field_li_detail "Location (warehouse)" item.location %}
            diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 9fd022281..410108a52 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -6,10 +6,13 @@ {% block content %} {% window_nav item window_id 'show-warehouse' '' '' '' previous next 1 %} +

            {{ item.name|default:"" }}

            +

            {{ item.warehouse_type|default:"" }}

            +{% include "ishtar/blocks/sheet_external_id.html" %} +
              - {% field_li "Name" item.name %} - {% field_li "Warehouse type" item.warehouse_type %} {% field_li "Person in charge" item.person_in_charge %} + {% include "ishtar/blocks/sheet_creation_section.html" %}
            {% field "Comment" item.comment "
            " "
            " %} diff --git a/example_project/settings.py b/example_project/settings.py index b19867662..efbf0297a 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -214,6 +214,7 @@ APP_NAME = "SRA - Pays de la Loire" SURFACE_UNIT = 'square-metre' SURFACE_UNIT_LABEL = u'm²' JOINT = u" | " +ISHTAR_FILE_PREFIX = u"" ISHTAR_OPE_PREFIX = u"OA" ISHTAR_DEF_OPE_PREFIX = u"OP" # string len of find indexes - i.e: find with index 42 will be 00042 diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 2fd56f697..84ef710b2 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -1546,3 +1546,7 @@ table.table-form td input{ display: block; } +.external-id{ + font-family: monospace; + font-size: 0.9em; +} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html new file mode 100644 index 000000000..1312cbcd5 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html @@ -0,0 +1,19 @@ +{% load i18n link_to_window %} +{% if item.history_creator.ishtaruser.person %} +
          • + + {{item.history_creator.ishtaruser.person}} + {{item.history_creator.ishtaruser.person|link_to_window}}
            + {{item.history_creation_date|date:"DATETIME_FORMAT"}} +
            +
          • +{% endif %} +{% if item.history_creation_date != item.last_edition_date %} +
          • + + {{item.history_modifier.ishtaruser.person}} + {{item.history_modifier.ishtaruser.person|link_to_window}}
            + {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} +
            +
          • +{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_external_id.html b/ishtar_common/templates/ishtar/blocks/sheet_external_id.html new file mode 100644 index 000000000..95628ab15 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/sheet_external_id.html @@ -0,0 +1,7 @@ +{% load i18n %}{% if item.external_id %} +

            + + + {{item.external_id|default:''}} + +

            {% endif %} diff --git a/version.py b/version.py index faeadf711..4d6a65db2 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 15) +VERSION = (0, 99, 15, 1) def get_version(): -- cgit v1.2.3 From 5317d6b6b585d7bf6a4144871026d354fed85105 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 14:04:12 +0100 Subject: Sheet person: fix layout --- ishtar_common/templates/ishtar/sheet_person.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html index 5339e4f07..0d7f9621b 100644 --- a/ishtar_common/templates/ishtar/sheet_person.html +++ b/ishtar_common/templates/ishtar/sheet_person.html @@ -6,6 +6,7 @@ {% window_nav item window_id 'show-person' 'person_modify' %}

            {% trans "Identity" %}

            +
              {% field_li "Title" item.full_title %} {% field_li "Name" item.name %} {% field_li "Surname" item.surname %} @@ -13,6 +14,7 @@ {% field_li_detail "Created by" item.history_creator.ishtaruser.person %} {% field_li "Email" item.email %} {% field_li "Type(s)" item.person_types_list %} +
            {% if item.phone or item.phone2 or item.phone3 or item.mobile_phone %} -- cgit v1.2.3 From c16ab41306843a0f00dc5980cc2793134ba6d3ef Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 15:03:33 +0100 Subject: Sheets: improve layout --- .../templates/ishtar/sheet_operation.html | 15 +-------- .../templates/ishtar/sheet_container.html | 1 + ishtar_common/templates/ishtar/sheet_person.html | 39 ++++++++++++---------- 3 files changed, 23 insertions(+), 32 deletions(-) (limited to 'ishtar_common/templates') diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 3e89c3c39..f35954488 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -25,20 +25,7 @@

            {% trans "General"%}

              {% field_li "Old code" item.old_code %} -
            • - - {{item.history_creator.ishtaruser.person}}
              - {{item.history_creation_date|date:"DATETIME_FORMAT"}} -
              -
            • - {% if item.history_creation_date != item.last_edition_date %} -
            • - - {{item.history_modifier.ishtaruser.person}}
              - {% firstof item.history_date|date:"DATETIME_FORMAT" item.history.all.0.history_date|date:"DATETIME_FORMAT" %} -
              -
            • - {% endif %} + {% include "ishtar/blocks/sheet_creation_section.html" %} {% field_li "Begining date" item.start_date %} {% field_li "Excavation end date" item.excavation_end_date|default:"-" %} {% field_li_detail "Head scientist" item.scientist %} diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 94be2fc04..cd8a3602b 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -12,6 +12,7 @@
                {% field_li_detail "Responsible warehouse" item.responsible %} + {% include "ishtar/blocks/sheet_creation_section.html" %} {% field_li_detail "Location (warehouse)" item.location %}
              {% field "Location" item.precise_location %} diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html index 0d7f9621b..8d51846b2 100644 --- a/ishtar_common/templates/ishtar/sheet_person.html +++ b/ishtar_common/templates/ishtar/sheet_person.html @@ -44,30 +44,33 @@ {% if item.address or item.postal_code or item.town %}

              {% trans "Business address" %}

              -{% field_li "Address" item.address %} -{% field_li "Address complement" item.address_complement %} -{% field_li "Postal code" item.postal_code %} -{% field_li "Town" item.town %} -{% endif %} +
                + {% field_li "Address" item.address %} + {% field_li "Address complement" item.address_complement %} + {% field_li "Postal code" item.postal_code %} + {% field_li "Town" item.town %} +
              {% endif %} {% if item.alt_address or item.alt_postal_code or item.alt_town %}

              {% trans "Other address" %}

              -{% field_li "Address" item.alt_address %} -{% field_li "Address complement" item.alt_address_complement %} -{% field_li "Postal code" item.alt_postal_code %} -{% field_li "Town" item.alt_town %} -{% endif %} +
                + {% field_li "Address" item.alt_address %} + {% field_li "Address complement" item.alt_address_complement %} + {% field_li "Postal code" item.alt_postal_code %} + {% field_li "Town" item.alt_town %} +
              {% endif %} {% if item.attached_to %}

              {% trans "Associated organization"%}

              -{% field_li "Name" item.attached_to %} -{% field_li "Address" item.attached_to.address %} -{% field_li "Address complement" item.attached_to.address_complement %} -{% field_li "Postal code" item.attached_to.postal_code %} -{% field_li "Town" item.attached_to.town %} -{% field_li "Phone" item.attached_to.phone %} -{% field_li "Mobile phone" item.attached_to.mobile_phone %} -{% endif %} +
                + {% field_li "Name" item.attached_to %} + {% field_li "Address" item.attached_to.address %} + {% field_li "Address complement" item.attached_to.address_complement %} + {% field_li "Postal code" item.attached_to.postal_code %} + {% field_li "Town" item.attached_to.town %} + {% field_li "Phone" item.attached_to.phone %} + {% field_li "Mobile phone" item.attached_to.mobile_phone %} +
              {% endif %} {% trans "Associated operations as scientist" as ao %} -- cgit v1.2.3 From e90c8378415c5ee394a220890a07615d1f4b011e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 15:05:01 +0100 Subject: Sheet person: link to the attached organization (refs #3469) --- ishtar_common/templates/ishtar/sheet_person.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html index 8d51846b2..aa5192dc4 100644 --- a/ishtar_common/templates/ishtar/sheet_person.html +++ b/ishtar_common/templates/ishtar/sheet_person.html @@ -63,7 +63,7 @@ {% if item.attached_to %}

              {% trans "Associated organization"%}

                - {% field_li "Name" item.attached_to %} + {% field_li_detail "Name" item.attached_to %} {% field_li "Address" item.attached_to.address %} {% field_li "Address complement" item.attached_to.address_complement %} {% field_li "Postal code" item.attached_to.postal_code %} -- cgit v1.2.3 From 5dd2be142e031d21108296b601c261665d32fb7e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 15 Mar 2017 11:54:54 +0100 Subject: Sheets: mark explicitly some fields as translated fields (refs #3459) --- .../templates/ishtar/sheet_contextrecord.html | 3 ++- .../templates/ishtar/sheet_contextrecordsource.html | 3 ++- archaeological_finds/models_finds.py | 3 ++- archaeological_finds/templates/ishtar/sheet_find.html | 3 ++- archaeological_finds/templates/ishtar/sheet_findsource.html | 3 ++- .../templates/ishtar/sheet_treatmentfilesource.html | 3 ++- archaeological_finds/templates/ishtar/sheet_treatmentsource.html | 3 ++- archaeological_operations/templates/ishtar/sheet_operation.html | 3 ++- .../templates/ishtar/sheet_operationsource.html | 3 ++- ishtar_common/templates/ishtar/sheet_source.html | 6 ++++-- 10 files changed, 22 insertions(+), 11 deletions(-) (limited to 'ishtar_common/templates') diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 3f19289e0..8398a0523 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -73,7 +73,8 @@ {% endif %}
                  {% field_li "Year" item.operation.year %} -{% field_li "Numerical reference" item.operation.operation_code %} + {% trans "Numerical reference" as num_ref_label %} + {% field_li num_ref_label item.operation.operation_code %} {% field_li "Patriarche OA code" item.operation.code_patriarche %} {% field_li_detail "Head scientist" item.operation.scientist %}
                • {% if item.operation.is_active %}{% trans "Active file" %}{% else %}{%trans "Closed operation" %}{% endif %}
                • diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html index 253d5f047..bd6cdcdba 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html @@ -8,5 +8,6 @@ {% endblock %} {% block related %} -{% field "Related context record" item.owner '' item.owner|link_to_window %} +{% trans "Related context record" as related_item_label %} +{% field related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 5872a241f..4ece0b286 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -485,7 +485,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'base_finds__context_record__operation__common_name', 'base_finds__context_record__parcel', 'base_finds__context_record__label', - 'material_types__label', 'object_types', 'datings__period__label', + 'material_types__label', 'object_types', + 'datings__period__label', 'container__cached_label', 'base_finds__batch', ] if settings.COUNTRY == 'fr': diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 7889870b9..df9fedb10 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -22,7 +22,8 @@ {% field_li "Previous ID" item.previous_id %} {% include "ishtar/blocks/sheet_creation_section.html" %} -{% field_li "Administrative index" item.administrative_index %} + {% trans "Administrative index" as admin_index_label %} + {% field_li admin_index_label item.administrative_index %} {% field_li_multiple "Material types" item.material_types %} {% field_li "Dating" item.dating %} {% field_li "Length (cm)" item.length %} diff --git a/archaeological_finds/templates/ishtar/sheet_findsource.html b/archaeological_finds/templates/ishtar/sheet_findsource.html index 69d14d161..fedb20911 100644 --- a/archaeological_finds/templates/ishtar/sheet_findsource.html +++ b/archaeological_finds/templates/ishtar/sheet_findsource.html @@ -8,5 +8,6 @@ {% endblock %} {% block related %} -{% field "Related find" item.owner '' item.owner|link_to_window %} +{% trans "Related find" as related_item_label %} +{% field related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfilesource.html b/archaeological_finds/templates/ishtar/sheet_treatmentfilesource.html index e558296a8..17cc14b5b 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfilesource.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfilesource.html @@ -8,5 +8,6 @@ {% endblock %} {% block related %} -{% field "Related treatment request" item.owner '' item.owner|link_to_window %} +{% trans "Related treatment request" as related_item_label %} +{% field related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentsource.html b/archaeological_finds/templates/ishtar/sheet_treatmentsource.html index 0825810ad..70e69c704 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentsource.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentsource.html @@ -8,5 +8,6 @@ {% endblock %} {% block related %} -{% field "Related treatment" item.owner '' item.owner|link_to_window %} +{% trans "Related treatment" as related_item_label %} +{% field related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 19fdc930a..e920dd226 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -27,7 +27,8 @@
                    {% field_li "Old code" item.old_code %} {% include "ishtar/blocks/sheet_creation_section.html" %} -{% field_li "Begining date" item.start_date %} + {% trans "Begining date" as begining_date_label %} + {% field_li begining_date_label item.start_date %} {% field_li "Excavation end date" item.excavation_end_date|default:"-" %} {% field_li_detail "Head scientist" item.scientist %} {% field_li_detail "In charge" item.in_charge %} diff --git a/archaeological_operations/templates/ishtar/sheet_operationsource.html b/archaeological_operations/templates/ishtar/sheet_operationsource.html index 9b8cbf509..55c48b319 100644 --- a/archaeological_operations/templates/ishtar/sheet_operationsource.html +++ b/archaeological_operations/templates/ishtar/sheet_operationsource.html @@ -8,5 +8,6 @@ {% endblock %} {% block related %} -{% field "Related operation" item.owner '' item.owner|link_to_window %} +{% trans "Related operation" as related_item_label %} +{% field related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html index 1c00b684e..244ca1be3 100644 --- a/ishtar_common/templates/ishtar/sheet_source.html +++ b/ishtar_common/templates/ishtar/sheet_source.html @@ -5,7 +5,8 @@ {% block window_nav %}{% endblock %} {% block general %} {% block related %} -{% field "Related item" item.owner %} +{% trans "Related item" as related_item_label %} +{% field related_item_label item.owner %} {% endblock %} {% if item.image %} @@ -18,7 +19,8 @@ {% field_li "Source type" item.source_type %} {% field_li "Format type" item.format_type %} {% field_li "Scale" item.scale %} -{% field_li_url "Web link" item.associated_url %} + {% trans "Web link" as weblink_label %} + {% field_li_url weblink_label item.associated_url %} {% field_li "Item number" item.item_number %} {% field_li "Ref." item.reference %} {% field_li "Internal ref." item.internal_reference %} -- cgit v1.2.3 From e20e666c551e1d4d4630949fcd5000395697a5b2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 16 Mar 2017 10:31:21 +0100 Subject: Sheet: remove ":" from labels --- ishtar_common/templates/ishtar/blocks/sheet_creation_section.html | 4 ++-- ishtar_common/templates/ishtar/blocks/window_field.html | 2 +- ishtar_common/templates/ishtar/blocks/window_field_detail.html | 2 +- ishtar_common/templates/ishtar/blocks/window_field_multiple.html | 2 +- ishtar_common/templates/ishtar/blocks/window_field_url.html | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html index 1312cbcd5..e6ce31c25 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_creation_section.html @@ -1,6 +1,6 @@ {% load i18n link_to_window %} {% if item.history_creator.ishtaruser.person %} -
                  • +
                  • {{item.history_creator.ishtaruser.person}} {{item.history_creator.ishtaruser.person|link_to_window}}
                    @@ -9,7 +9,7 @@
                  • {% endif %} {% if item.history_creation_date != item.last_edition_date %} -
                  • +
                  • {{item.history_modifier.ishtaruser.person}} {{item.history_modifier.ishtaruser.person|link_to_window}}
                    diff --git a/ishtar_common/templates/ishtar/blocks/window_field.html b/ishtar_common/templates/ishtar/blocks/window_field.html index 969f32dbb..b52ed78ee 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field.html +++ b/ishtar_common/templates/ishtar/blocks/window_field.html @@ -1,3 +1,3 @@ -{% load i18n %}{% if data %}{% if li %}
                  • {% else %}

                    {% endif %} +{% load i18n %}{% if data %}{% if li %}

                  • {% else %}

                    {% endif %} {{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe}}{% if li %}

                  • {% else %}

                    {% endif %} {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_detail.html b/ishtar_common/templates/ishtar/blocks/window_field_detail.html index 2be9c5ec4..594c67529 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_detail.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_detail.html @@ -1,3 +1,3 @@ -{% load i18n %}{% if item %}{% if li %}
                  • {% else %}

                    {% endif %} +{% load i18n %}{% if item %}{% if li %}

                  • {% else %}

                    {% endif %} {{item}}{{link}}{% if li %}

                  • {% else %}

                    {% endif %} {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_multiple.html b/ishtar_common/templates/ishtar/blocks/window_field_multiple.html index cc817490c..f07630174 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_multiple.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_multiple.html @@ -1,4 +1,4 @@ -{% load i18n %}{% if data.count %}{% if li %}
                  • {% else %}

                    {% endif %} +{% load i18n %}{% if data.count %}{% if li %}

                  • {% else %}

                    {% endif %} {% for d in data.all %} {% if forloop.counter0 %} ; {% endif %}{{ d }} {% endfor %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_url.html b/ishtar_common/templates/ishtar/blocks/window_field_url.html index d63ebdca9..cd6365106 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_url.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_url.html @@ -1,3 +1,3 @@ -{% load i18n %}{% if link %}{% if li %}

                  • {% else %}

                    {% endif %}

                    +{% load i18n %}{% if link %}{% if li %}

                  • {% else %}

                    {% endif %}

                    {% if link_name %}{{link_name}}{% else %}{{link}}{% endif %}{% if li %}

                  • {% else %}

                    {% endif %} {% endif%} -- cgit v1.2.3 From 9e5be05c239888f4c2fc0c457e0713a15915613d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 16 Mar 2017 12:47:33 +0100 Subject: Basket: add a close button (refs #3407) --- archaeological_finds/templates/ishtar/sheet_find.html | 2 +- archaeological_finds/urls.py | 2 ++ archaeological_finds/views.py | 4 +++- archaeological_warehouse/urls.py | 2 +- ishtar_common/static/media/style.css | 5 +++++ ishtar_common/templates/ishtar/display_item.html | 2 +- ishtar_common/templates/ishtar/manage_basket.html | 11 +++++++++++ ishtar_common/views.py | 8 +++++--- version.py | 2 +- 9 files changed, 30 insertions(+), 8 deletions(-) (limited to 'ishtar_common/templates') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 381c81a31..912bf1b93 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -142,7 +142,7 @@
            - + diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index 4a8dec030..9c554a124 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -267,6 +267,8 @@ urlpatterns += patterns( name=models.FindSource.SHOW_URL), url(r'^show-find/basket-(?P.+)/(?P.+)?$', 'show_findbasket', name='show-findbasket'), + url(r'^display-find/basket-(?P.+)/$', 'display_findbasket', + name='display-findbasket'), url(r'^show-find(?:/(?P.+))?/(?P.+)?$', 'show_find', name=models.Find.SHOW_URL), url(r'^display-find/(?P.+)/$', 'display_find', diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 084f15d13..341734ae7 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -108,10 +108,12 @@ show_findsource = show_item(models.FindSource, 'findsource') get_findsource = get_item(models.FindSource, 'get_findsource', 'findsource') show_find = show_item(models.Find, 'find') -display_find = display_item(models.Find, 'find') +display_find = display_item(models.Find) revert_find = revert_item(models.Find) show_findbasket = show_item(models.FindBasket, 'findbasket') +display_findbasket = display_item(models.FindBasket, + show_url='show-find/basket-') find_creation_steps = [ ('selecrecord-find_creation', RecordFormSelectionTable), diff --git a/archaeological_warehouse/urls.py b/archaeological_warehouse/urls.py index e5920606a..5d4427301 100644 --- a/archaeological_warehouse/urls.py +++ b/archaeological_warehouse/urls.py @@ -23,7 +23,7 @@ from ishtar_common.wizards import check_rights import views from archaeological_warehouse import models -# be carreful: each check_rights must be relevant with ishtar_menu +# be careful: each check_rights must be relevant with ishtar_menu # forms urlpatterns = patterns( diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 84ef710b2..adaf94200 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -410,6 +410,11 @@ a.button{ color: white; } +#validate-button{ + background-color: #fff; + display: inline-block; +} + .display_details_inline, .display_details{ display:inline-block; diff --git a/ishtar_common/templates/ishtar/display_item.html b/ishtar_common/templates/ishtar/display_item.html index e00fef05b..e1c63b775 100644 --- a/ishtar_common/templates/ishtar/display_item.html +++ b/ishtar_common/templates/ishtar/display_item.html @@ -4,7 +4,7 @@ {% endblock %} diff --git a/ishtar_common/templates/ishtar/manage_basket.html b/ishtar_common/templates/ishtar/manage_basket.html index de17f3ad7..a6065a7c2 100644 --- a/ishtar_common/templates/ishtar/manage_basket.html +++ b/ishtar_common/templates/ishtar/manage_basket.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load i18n inline_formset %} +{% load url from future %} {% block content %}

            {{page_name}}{% trans ":"%} {{basket}}

            {% csrf_token %} @@ -13,6 +14,16 @@

            {% trans "Basket content" %}

            + {% block "footer" %} + + {% endblock %}
            {{ treatment.year }} - {{treatment.index}}{{ treatment.label }}{{ treatment.label|default_if_none:"-" }} {{ treatment.treatment_types_lbl }} {{ treatment.treatment_state|default_if_none:"-" }} {% for item in items %}{{item}} {{ item|link_to_window}}{% endfor %}