diff options
Diffstat (limited to 'archaeological_operations')
5 files changed, 276 insertions, 199 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 6ba343508..fed48a8ff 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -49,7 +49,7 @@ from ishtar_common import widgets from ishtar_common.forms import FinalForm, FormSet, get_now, \ reverse_lazy, get_form_selection, TableSelect, get_data_from_formset, \ - ManageOldType, CustomForm, FieldType + ManageOldType, IshtarForm, CustomForm, FieldType from ishtar_common.forms_common import TownFormSet, SourceForm, SourceSelect, \ get_town_field, TownForm @@ -66,7 +66,7 @@ class ParcelField(forms.MultiValueField): return u"-".join(data_list) -class ParcelForm(forms.Form): +class ParcelForm(IshtarForm): form_label = _("Parcels") base_model = 'parcel' associated_models = {'parcel': models.Parcel, 'town': models.Town, } @@ -202,7 +202,7 @@ class ParcelForm(forms.Form): return res -class ParcelSelectionForm(forms.Form): +class ParcelSelectionForm(IshtarForm): _town = forms.ChoiceField(label=_("Town"), choices=(), required=False, validators=[valid_id(models.Town)]) _parcel_selection = forms.CharField( @@ -367,7 +367,7 @@ class ParcelFormSet(FormSet): return self.cleaned_data -class RecordRelationsForm(ManageOldType, forms.Form): +class RecordRelationsForm(ManageOldType): base_model = 'right_relation' current_model = models.RelationType current_related_model = models.Operation @@ -618,13 +618,13 @@ class OperationSelect(TableSelect): return ids -class OperationFormSelection(forms.Form): +class OperationFormSelection(IshtarForm): form_label = _(u"Operation search") associated_models = {'pk': models.Operation} currents = {'pk': models.Operation} pk = forms.IntegerField( label="", required=False, - widget=widgets.JQueryJqGrid( + widget=widgets.DataTable( reverse_lazy('get-operation'), OperationSelect, models.Operation, source_full=reverse_lazy('get-operation-full')), validators=[valid_id(models.Operation)]) @@ -662,7 +662,7 @@ class OperationCodeInput(forms.TextInput): return mark_safe(rendered + js) -class OperationFormFileChoice(forms.Form): +class OperationFormFileChoice(IshtarForm): form_label = _(u"Associated file") associated_models = {'associated_file': File, } currents = {'associated_file': File} @@ -673,7 +673,7 @@ class OperationFormFileChoice(forms.Form): validators=[valid_id(File)], required=False) -class OperationFormAbstract(CustomForm, forms.Form): +class OperationFormAbstract(CustomForm, IshtarForm): form_label = _(u"Abstract") form_admin_name = _(u"Operation - 090 - Abstract") form_slug = "operation-090-abstract" @@ -762,7 +762,7 @@ class DashboardForm(forms.Form): return fltr -class OperationFormGeneral(ManageOldType, CustomForm, forms.Form): +class OperationFormGeneral(CustomForm, ManageOldType): form_label = _(u"General") form_admin_name = _(u"Operation - 010 - General") form_slug = "operation-010-general" @@ -1008,7 +1008,7 @@ OperationFormModifGeneral.associated_models = \ OperationFormModifGeneral.associated_models['associated_file'] = File -class CollaboratorForm(CustomForm, forms.Form): +class CollaboratorForm(CustomForm, IshtarForm): form_label = _(u"Collaborators") form_admin_name = _(u"Operation - 020 - Collaborators") form_slug = "operation-020-collaborators" @@ -1024,7 +1024,7 @@ class CollaboratorForm(CustomForm, forms.Form): self.fields['collaborator'].widget.attrs['full-width'] = True -class OperationFormPreventive(CustomForm, forms.Form): +class OperationFormPreventive(CustomForm, IshtarForm): form_label = _(u"Preventive informations - excavation") form_admin_name = _(u"Operation - 033 - Preventive - Excavation") form_slug = "operation-033-preventive-excavation" @@ -1043,7 +1043,7 @@ class OperationFormPreventive(CustomForm, forms.Form): validators.MaxValueValidator(100)]) -class OperationFormPreventiveDiag(CustomForm, forms.Form): +class OperationFormPreventiveDiag(CustomForm, IshtarForm): form_label = _("Preventive informations - diagnostic") form_admin_name = _(u"Operation - 037 - Preventive - Diagnostic") form_slug = "operation-037-preventive-diagnostic" @@ -1058,7 +1058,7 @@ class OperationFormPreventiveDiag(CustomForm, forms.Form): label=_(u"Prescription on geoarchaeological context")) -class SelectedTownForm(forms.Form): +class SelectedTownForm(IshtarForm): form_label = _("Towns") associated_models = {'town': Town} town = forms.ChoiceField(label=_("Town"), choices=(), @@ -1085,7 +1085,7 @@ TownFormset.form_admin_name = _(u"Operation - 040 - Towns (2)") TownFormset.form_slug = "operation-040-towns-2" -class SelectedParcelForm(forms.Form): +class SelectedParcelForm(IshtarForm): form_label = _("Parcels") associated_models = {'parcel': models.Parcel} parcel = forms.ChoiceField( @@ -1171,7 +1171,7 @@ class PeriodForm(CustomForm, ManageOldType, forms.Form): ] -class ArchaeologicalSiteForm(ManageOldType, forms.Form): +class ArchaeologicalSiteForm(ManageOldType): reference = forms.CharField(label=_(u"Reference"), max_length=20) name = forms.CharField(label=_(u"Name"), max_length=200, required=False) periods = forms.MultipleChoiceField( @@ -1212,7 +1212,7 @@ class ArchaeologicalSiteForm(ManageOldType, forms.Form): return item -class ArchaeologicalSiteBasicForm(forms.Form): +class ArchaeologicalSiteBasicForm(IshtarForm): form_label = _("Archaeological site") base_model = 'archaeological_site' associated_models = {'archaeological_site': models.ArchaeologicalSite} @@ -1234,7 +1234,7 @@ ArchaeologicalSiteFormSet.form_admin_name = _( ArchaeologicalSiteFormSet.form_slug = "operation-030-archaeological-sites" -class ArchaeologicalSiteSelectionForm(forms.Form): +class ArchaeologicalSiteSelectionForm(IshtarForm): form_label = _("Associated archaeological sites") archaeological_sites = forms.IntegerField( widget=widgets.JQueryAutoComplete( @@ -1386,13 +1386,13 @@ class AdministrativeActOpeSelect(TableSelect): return ids -class AdministrativeActOpeFormSelection(forms.Form): +class AdministrativeActOpeFormSelection(IshtarForm): form_label = _("Administrative act search") associated_models = {'pk': models.AdministrativeAct} currents = {'pk': models.AdministrativeAct} pk = forms.IntegerField( label="", required=False, - widget=widgets.JQueryJqGrid( + widget=widgets.DataTable( reverse_lazy('get-administrativeactop'), AdministrativeActOpeSelect, models.AdministrativeAct, table_cols='TABLE_COLS_OPE'), @@ -1406,7 +1406,7 @@ class AdministrativeActOpeFormSelection(forms.Form): return cleaned_data -class AdministrativeActOpeForm(CustomForm, ManageOldType, forms.Form): +class AdministrativeActOpeForm(CustomForm, ManageOldType): form_label = _("General") form_admin_name = _(u"Operation - Administrative act - General") form_slug = "operation-adminact-general" @@ -1482,7 +1482,7 @@ class FinalAdministrativeActDeleteForm(FinalForm): confirm_end_msg = _(u"Would you like to delete this administrative act?") -class DocumentGenerationAdminActForm(forms.Form): +class DocumentGenerationAdminActForm(IshtarForm): _associated_model = models.AdministrativeAct document_template = forms.ChoiceField(label=_("Template"), choices=[]) @@ -1529,7 +1529,7 @@ class DocumentGenerationAdminActForm(forms.Form): return template.publish(c_object) -class GenerateDocForm(forms.Form): +class GenerateDocForm(IshtarForm): form_label = _("Doc generation") doc_generation = forms.ChoiceField( required=False, choices=[], label=_(u"Generate the associated doc?")) @@ -1552,13 +1552,13 @@ class AdministrativeActRegisterSelect(AdministrativeActOpeSelect): self.fields['act_type'].help_text = models.ActType.get_help() -class AdministrativeActRegisterFormSelection(forms.Form): +class AdministrativeActRegisterFormSelection(IshtarForm): form_label = pgettext_lazy('admin act register', u"Register") associated_models = {'pk': models.AdministrativeAct} currents = {'pk': models.AdministrativeAct} pk = forms.IntegerField( label="", required=False, - widget=widgets.JQueryJqGrid( + widget=widgets.DataTable( reverse_lazy('get-administrativeact'), AdministrativeActRegisterSelect, models.AdministrativeAct, table_cols='TABLE_COLS', diff --git a/archaeological_operations/templates/ishtar/blocks/window_tables/administrativacts.html b/archaeological_operations/templates/ishtar/blocks/window_tables/administrativacts.html index 4c41ed89e..6b651092b 100644 --- a/archaeological_operations/templates/ishtar/blocks/window_tables/administrativacts.html +++ b/archaeological_operations/templates/ishtar/blocks/window_tables/administrativacts.html @@ -1,14 +1,15 @@ {% load i18n %} <h4>{{caption}}</h4> -<div class='clean-table'> -<div class='clean-table-wrap'> -<table> +<table class="table table-striped"> + <thead> <tr> <th>{% trans "Ref." %}</th> <th>{% trans "Type" %}</th> <th>{% trans "Date" %}</th> <th>{% trans "Object" %}</th> </tr> + </thead> + <tbody> {% for act in data %} <tr> <td>{{act.full_ref}}</td> @@ -19,6 +20,5 @@ {% empty %} <tr><td colspan="4" class='no_items'>{% trans "No administrative act associated" %}</td></tr> {% endfor %} + </tbody> </table> -</div> -</div> diff --git a/archaeological_operations/templates/ishtar/blocks/window_tables/archaeologicalsites.html b/archaeological_operations/templates/ishtar/blocks/window_tables/archaeologicalsites.html index d570b9db2..26b1915da 100644 --- a/archaeological_operations/templates/ishtar/blocks/window_tables/archaeologicalsites.html +++ b/archaeological_operations/templates/ishtar/blocks/window_tables/archaeologicalsites.html @@ -1,24 +1,23 @@ {% load i18n %} <h4>{{caption}}</h4> -<div class='clean-table'> -<div class='clean-table-wrap'> -<table> - <tr> - <th>{% trans "Ref." %}</th> - <th>{% trans "Name" %}</th> - <th>{% trans "Periods" %}</th> - <th>{% trans "Remains" %}</th> - </tr> - {% for archaeosite in data %} - <tr> - <td class='string'>{{archaeosite.reference}}</td> - <td class='string'>{{archaeosite.name}}</td> - <td class='string'>{% for period in archaeosite.periods.all %}{{period}}{% include "blocks/comma_list.html" %}{% endfor %}</td> - <td class='string'>{% for remain in archaeosite.remains.all %}{{remain}}{% include "blocks/comma_list.html" %}{% endfor %}</td> - </tr> - {% empty %} - <tr><td colspan="4" class='no_items'>{% trans "No archaeological site associated" %}</td></tr> - {% endfor %} +<table class="table table-striped"> + <thead> + <tr> + <th>{% trans "Ref." %}</th> + <th>{% trans "Name" %}</th> + <th>{% trans "Periods" %}</th> + <th>{% trans "Remains" %}</th> + </tr> + <tbody> + {% for archaeosite in data %} + <tr> + <td class='string'>{{archaeosite.reference}}</td> + <td class='string'>{{archaeosite.name}}</td> + <td class='string'>{% for period in archaeosite.periods.all %}{{period}}{% include "blocks/comma_list.html" %}{% endfor %}</td> + <td class='string'>{% for remain in archaeosite.remains.all %}{{remain}}{% include "blocks/comma_list.html" %}{% endfor %}</td> + </tr> + {% empty %} + <tr><td colspan="4" class='no_items'>{% trans "No archaeological site associated" %}</td></tr> + {% endfor %} + </tbody> </table> -</div> -</div> diff --git a/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html b/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html index 37be138b1..c52e5cd76 100644 --- a/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html +++ b/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html @@ -1,15 +1,16 @@ {% load i18n %} <h4>{{ parcels_label }}</h4> -<div class='clean-table'> -<div class='clean-table-wrap'> -<table> - <tr> - <th>{% trans "Town" %}</th> - <th>{% trans "Year" %}</th> - <th>{% trans "Section" %}</th> - <th>{% trans "Parcels" %}</th> - {#<th>{% trans "Owner" %}</th>#} - </tr> +<table class="table table-striped"> + <thead> + <tr> + <th>{% trans "Town" %}</th> + <th>{% trans "Year" %}</th> + <th>{% trans "Section" %}</th> + <th>{% trans "Parcels" %}</th> + {#<th>{% trans "Owner" %}</th>#} + </tr> + </thead> + <tbody> {% for parcel in item.grouped_parcels %} <tr> <td class='string'>{{parcel.town}}</td> @@ -21,5 +22,5 @@ {% empty %} <tr><td colspan="4" class='no_items'>{% trans "No parcel" %}</td></tr> {% endfor %} + </tbody> </table> -</div></div> diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index e46db74c7..0052dde7b 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -1,97 +1,162 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_tables window_header window_ope_tables window_field from_dict %} -{% block head_title %}{% trans "Operation" %}{% endblock %} +{% block head_title %}{% trans "Operation:" %} {{item.short_label}}{% endblock %} -{% block content %} +{% block toolbar %} {% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next 1 %} +{% endblock %} + +{% block content %} + +<div class="row"> + <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12"> + <div class="card"> + {% if item.image %} + <img class='card-img-top' src="{{item.thumbnail.url}}"> + {% endif%} + <div class="card-body"> + <div class="row"> + <div class="col main"> + {% if item.year or item.operation_code %} + {{item.year|default:''}}-{{item.operation_code|default:''}}{% endif %}<br> + {% if item.code_patriarche %}OA{{item.code_patriarche}}{% endif %} + </div> + <div class="col text-muted"> + {% include "ishtar/blocks/sheet_external_id.html" %} + </div> + </div> + <p class="card-text"> + <p class='window-refs' title="{% trans 'Name' %}">{{item.common_name|default:''}}</p> + <p class='window-refs' title="{% trans 'Address' %}">{{item.address|default:''}}</p> + </p> + </div> + </div> + </div> +</div> -{% if item.image %} -<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> -{% endif%} +<h3>{% trans "General"%}</h3> + +<div class="row"> + {% field_flex "Old code" item.old_code %} + {% include "ishtar/blocks/sheet_creation_section.html" %} + {% trans "Begining date" as begining_date_label %} + {% field_flex begining_date_label item.start_date|date:"DATE_FORMAT" %} + {% field_flex "Excavation end date" item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %} + {% field_flex_detail "Head scientist" item.scientist %} + {% field_flex_detail "In charge" item.in_charge %} + {% field_flex_multiple "Collaborators" item.collaborators %} + {% field_flex_detail "Operator" item.operator %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{%trans "State"%}</dt> + <dd class='col-7'> + {% if item.is_active %}{%trans "Active file"%} + {% else %}{%trans "Closed operation"%}{% endif %} + </dd> + </div> + {% if item.closing.date %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{%trans "Closing date"%}</dt> + <dd class='col-7'> + {{ item.closing.date }} <strong>{%trans "by" %}</strong> {{ item.closing.user }} + </dd> + </div> + {% endif %} + {% field_flex "Type" item.operation_type %} + {% if item.surface %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{%trans "Surface"%}</dt> + <dd class='col-7'> + {{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha) + </dd> + </div> + {% endif %} + {% if item.cost %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{%trans "Cost" %}</dt> + <dd class='col-7'> + {{ item.cost }} €{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} €/m<sup>2</sup>){%endif%} + </dd> + </div> + {%endif%} + {% if item.duration %} + <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{%trans "Duration"%}</dt> + <dd class='col-7'> + {{ item.duration }} {% trans "days" %} + </dd> + </div> + {%endif%} + {% field_flex_multiple "Remains" item.remains %} + {% field_flex_multiple "Periods" item.periods %} + {% if item.QUALITY_DICT %}{% field_flex "Record quality" item.record_quality|from_dict:item.QUALITY_DICT %}{% endif %} + {% if item.history_object and item.history_object.QUALITY_DICT %}{% field_flex "Record quality" item.record_quality|from_dict:item.history_object.QUALITY_DICT %}{% endif %} + {% field_flex "Report delivery date" item.report_delivery_date %} + {% field_flex "Report processing" item.report_processing %} + {% field_flex "Deadline for submission of the documentation" item.documentation_deadline %} + {% field_flex "Documentation received" item.documentation_received %} + {% field_flex "Deadline for submission of the finds" item.finds_deadline %} + {% field_flex "Finds received" item.finds_received %} + {% field_flex_detail "Associated file" item.associated_file %} + {% field_flex "Responsible for planning service" item.associated_file.responsible_town_planning_service.full_address %} + {% if item.associated_file.town_planning_service %} + {% field_flex "Planning service organization" item.associated_file.town_planning_service.full_address %} + {% else %} + {% field_flex "Planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %} + {% endif %} + {% field_flex "Permit type" item.associated_file.permit_type %} + {% field_flex "Permit reference" item.associated_file.permit_reference %} + {% field_flex "General contractor" item.associated_file.general_contractor.full_address %} + {% if item.associated_file.corporation_general_contractor %} + {% field_flex "General contractor organization" item.associated_file.corporation_general_contractor.full_address %} + {% else%} + {% field_flex "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %} + {% endif %} +</div> +<div class="row"> + {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} + {% field_flex_full "Abstract" item.abstract "<pre>" "</pre>" %} + {% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "<pre>" "</pre>" %} + + {% include "ishtar/blocks/sheet_json.html" %} +</div> {% if item.virtual_operation %} -<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {% trans "This operation is virtual." %}</p> +<div class="alert alert-warning" role="alert"> + {% trans "This operation is virtual." %} +</div> {% endif %} + {% if not item.code_patriarche %} -<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {%trans "Patriarche OA code not yet recorded!"%}</p> +<div class="alert alert-warning" role="alert"> + {% trans "Patriarche OA code not yet recorded!"%} +</div> {% endif %} -<p class='window-refs'>{% if item.year or item.operation_code %}{{item.year|default:''}}-{{item.operation_code|default:''}}{% endif %}{% if item.code_patriarche %} – OA{{item.code_patriarche}}{% endif %} -</p> -<p class='window-refs' title="{% trans 'Name' %}">{{item.common_name|default:''}}</p> -<p class='window-refs' title="{% trans 'Address' %}">{{item.address|default:''}}</p> -{% include "ishtar/blocks/sheet_external_id.html" %} - -<h3>{% trans "General"%}</h3> -<ul class='form-flex'> - {% field_li "Old code" item.old_code %} - {% include "ishtar/blocks/sheet_creation_section.html" %} - {% 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 %} - {% field_li_multiple "Collaborators" item.collaborators %} - {% field_li_detail "Operator" item.operator %} -<li><label>{%trans "State:"%}</label> <span class='value'>{% if item.is_active %}{%trans "Active file"%}</span></p> -{% else %}{%trans "Closed operation"%}</span></li> {% endif %} -{% if item.closing.date %}<li><label>{%trans "Closing date"%}</label> <span class='value'>{{ item.closing.date }} <strong>{%trans "by" %}</strong> {{ item.closing.user }}</span></li>{% endif %} -{% field_li "Type" item.operation_type %} -{% if item.surface %}<li><label>{%trans "Surface"%}</label> <span class='value'>{{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha)</span></li>{% endif %} -{% if item.cost %}<li><label>{%trans "Cost"%}</label> <span class='value'>{{ item.cost }} €{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} €/m<sup>2</sup>){%endif%}</span></li>{%endif%} -{% if item.duration %}<li><label>{%trans "Duration"%}</label> <span class='value'>{{ item.duration }} {%trans "Day"%}s</span></li>{%endif%} -{% field_li_multiple "Remains" item.remains %} -{% field_li_multiple "Periods" item.periods %} -{% if item.QUALITY_DICT %}{% field_li "Record quality" item.record_quality|from_dict:item.QUALITY_DICT %}{% endif %} -{% if item.history_object and item.history_object.QUALITY_DICT %}{% field_li "Record quality" item.record_quality|from_dict:item.history_object.QUALITY_DICT %}{% endif %} -{% field_li "Report delivery date" item.report_delivery_date %} -{% field_li "Report processing" item.report_processing %} -{% field_li "Deadline for submission of the documentation" item.documentation_deadline %} -{% field_li "Documentation received" item.documentation_received %} -{% field_li "Deadline for submission of the finds" item.finds_deadline %} -{% field_li "Finds received" item.finds_received %} -{% field_li_detail "Associated file" item.associated_file %} -{% field_li "Responsible for planning service" item.associated_file.responsible_town_planning_service.full_address %} -{% if item.associated_file.town_planning_service %} - {% field_li "Planning service organization" item.associated_file.town_planning_service.full_address %} -{% else %} - {% field_li "Planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %} -{% endif %} -{% field_li "Permit type" item.associated_file.permit_type %} -{% field_li "Permit reference" item.associated_file.permit_reference %} -{% field_li "General contractor" item.associated_file.general_contractor.full_address %} -{% if item.associated_file.corporation_general_contractor %} - {% field_li "General contractor organization" item.associated_file.corporation_general_contractor.full_address %} -{% else%} - {% field_li "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %} -{% endif %} -</ul> -{% field "Comment" item.comment "<pre>" "</pre>" %} -{% field "Abstract" item.abstract "<pre>" "</pre>" %} -{% field "Comment about scientific documentation" item.scientific_documentation_comment "<pre>" "</pre>" %} - -{% include "ishtar/blocks/sheet_json.html" %} - {% if not next %} {% if item.towns.count %} <h3>{% trans "Localisation"%}</h3> -<ul class='form-flex'> -{% field_li "Towns" item.towns_codes|join:" ; " %} -{% field_li "Main address" item.associated_file.address %} -{% field_li "Complement" item.associated_file.address_complement %} -{% field_li "Postal code" item.associated_file.postal_code %} -</ul> +<div class="row"> + {% field_flex_full "Towns" item.towns_codes|join:" ; " %} + {% field_flex "Main address" item.associated_file.address %} + {% field_flex "Complement" item.associated_file.address_complement %} + {% field_flex "Postal code" item.associated_file.postal_code %} +</div> {% endif %} {% if item.right_relations.count %} <h3>{% trans "Relations"%}</h3> {% for rel in item.right_relations.all %} {% ifchanged rel.relation_type %} -{% if forloop.counter0 %}</ul>{% endif %} -<h4>{{rel.relation_type}}</h4><ul>{% endifchanged %} -<li><a href="#" onclick="load_window('/show-operation/{{rel.right_record.pk}}/');" class="display_details"><i class="fa fa-info-circle" aria-hidden="true"></i></a> {{rel.right_record}}</li> -{% if forloop.last %}</ul>{% endif %} +<h4>{{rel.relation_type}}</h4> +<div class="row">{% endifchanged %} + <div class="col-12"> + <a href="#" onclick="load_window('/show-operation/{{rel.right_record.pk}}/');" class="display_details"> + <i class="fa fa-info-circle" aria-hidden="true"></i> + </a> {{rel.right_record}} + </div> +{% if forloop.last %} +</div>{% endif %} {% endfor %} {% endif %} @@ -147,95 +212,107 @@ <small class="centered"><em>{% trans "These numbers are updated hourly" %}</em></small> <h4>{% trans "Administrative acts" %}</h4> -<ul class='form-flex'> -{% field_li "Number of administrative acts" item.nb_acts %} -{% field_li "Number of indexed administrative acts" item.nb_indexed_acts %} -</ul> +<div class='row'> +{% field_flex_2 "Number of administrative acts" item.nb_acts %} +{% field_flex_2 "Number of indexed administrative acts" item.nb_indexed_acts %} +</div> <h4>{% trans "Parcels" %}</h4> -<ul class='form-flex'> -{% field_li "Number of parcels" item.nb_parcels %} -</ul> +<div class='row'> +{% field_flex_2 "Number of parcels" item.nb_parcels %} +</div> <h4>{% trans "Context records" %}</h4> -<ul class='form-flex'> -{% field_li "Number of context records" item.nb_context_records %} -</ul> -<ul class='form-flex'> +<div class='row'> +{% field_flex_2 "Number of context records" item.nb_context_records %} +</div> +<div class='row'> {% if item.nb_context_records_by_type %} -<li><table class='clean-table small'> - <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_context_records_by_type %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table> + <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_context_records_by_type %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} {% if item.nb_context_records_by_periods %} -<li><table class='clean-table small'> - <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_context_records_by_periods %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table> + <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_context_records_by_periods %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} -</ul> +</div> <h4>{% trans "Finds" %}</h4> -<ul class='form-flex'> -{% field_li "Number of finds" item.nb_finds %} -</ul> -<ul class='form-flex'> +<div class='row'> +{% field_flex_2 "Number of finds" item.nb_finds %} +</div> +<div class='row'> {% if item.nb_finds_by_material_type %} -<li><table class='clean-table small'> - <tr><th>{% trans "Material type" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_finds_by_material_type %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table> + <tr><th>{% trans "Material type" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_finds_by_material_type %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} {% if item.nb_finds_by_types %} -<li><table class='clean-table small'> - <tr><th>{% trans "Object type" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_finds_by_types %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table> + <tr><th>{% trans "Object type" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_finds_by_types %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} {% if item.nb_finds_by_periods %} -<li><table class='clean-table small'> - <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_finds_by_periods %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table> + <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_finds_by_periods %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} -</ul> +</div> <h4>{% trans "Sources" %}</h4> -<ul class='form-flex'> -{% field_li "Number of sources" item.nb_documents %} -</ul> -<ul class='form-flex'> +<div class='row'> +{% field_flex "Number of sources" item.nb_documents %} +</div> +<div class='row'> {% if item.nb_documents_by_types %} -<li><table class='clean-table small'> - <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> -{% for label, nb in item.nb_documents_by_types %} - <tr><td>{{label}}</td><td>{{nb}}</td></tr> -{% endfor %} -</table></li> + <div class="col-12 col-md-6 col-lg-4"> + <table class="table"> + <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> + {% for label, nb in item.nb_documents_by_types %} + <tr><td>{{label}}</td><td>{{nb}}</td></tr> + {% endfor %} + </table> + </div> {% endif %} -</ul> +</div> {% if item.nb_stats_finds_by_ue %} <h4>{% trans "Finds by context records" %}</h4> -<ul class='form-flex'> -{% field_li "Mean" item.nb_stats_finds_by_ue.mean %} -{% field_li "Min" item.nb_stats_finds_by_ue.min %} -{% field_li "Max" item.nb_stats_finds_by_ue.max %} -{% field_li "Mode" item.nb_stats_finds_by_ue.mode %} -</ul> +<div class='row'> +{% field_flex_2 "Mean" item.nb_stats_finds_by_ue.mean %} +{% field_flex_2 "Min" item.nb_stats_finds_by_ue.min %} +{% field_flex_2 "Max" item.nb_stats_finds_by_ue.max %} +{% field_flex_2 "Mode" item.nb_stats_finds_by_ue.mode %} +</div> {% endif %} {% endif %} -{% endblock %} +{% endblock %}
\ No newline at end of file |