diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-24 23:13:11 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-24 23:13:11 +0100 |
commit | a498cd10ac20770c020bce05f15e320a0cae9c96 (patch) | |
tree | c984d00f04cdeb2303d7d36ea813c4e6b79db9db /archaeological_operations | |
parent | 651524bf93ee64f5f28605884f6b60256db43d1f (diff) | |
download | Ishtar-a498cd10ac20770c020bce05f15e320a0cae9c96.tar.bz2 Ishtar-a498cd10ac20770c020bce05f15e320a0cae9c96.zip |
UI: work on sheets
Diffstat (limited to 'archaeological_operations')
4 files changed, 152 insertions, 114 deletions
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 934a3ee19..8fbac5aa1 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -10,7 +10,7 @@ {% block content %} <div class="row"> - <div class="offset-md-4 col-sm-4"> + <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}}"> @@ -35,90 +35,128 @@ </div> </div> - <h3>{% trans "General"%}</h3> - - {% 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" %} - </p> - </div> +<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 %} - -<ul class='form-flex'> - {% 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 %} @@ -175,18 +213,18 @@ <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 %} +{% field_flex "Number of administrative acts" item.nb_acts %} +{% field_flex "Number of indexed administrative acts" item.nb_indexed_acts %} </ul> <h4>{% trans "Parcels" %}</h4> <ul class='form-flex'> -{% field_li "Number of parcels" item.nb_parcels %} +{% field_flex "Number of parcels" item.nb_parcels %} </ul> <h4>{% trans "Context records" %}</h4> <ul class='form-flex'> -{% field_li "Number of context records" item.nb_context_records %} +{% field_flex "Number of context records" item.nb_context_records %} </ul> <ul class='form-flex'> {% if item.nb_context_records_by_type %} @@ -209,7 +247,7 @@ <h4>{% trans "Finds" %}</h4> <ul class='form-flex'> -{% field_li "Number of finds" item.nb_finds %} +{% field_flex "Number of finds" item.nb_finds %} </ul> <ul class='form-flex'> {% if item.nb_finds_by_material_type %} @@ -240,7 +278,7 @@ <h4>{% trans "Sources" %}</h4> <ul class='form-flex'> -{% field_li "Number of sources" item.nb_documents %} +{% field_flex "Number of sources" item.nb_documents %} </ul> <ul class='form-flex'> {% if item.nb_documents_by_types %} @@ -256,10 +294,10 @@ {% 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 %} +{% field_flex "Mean" item.nb_stats_finds_by_ue.mean %} +{% field_flex "Min" item.nb_stats_finds_by_ue.min %} +{% field_flex "Max" item.nb_stats_finds_by_ue.max %} +{% field_flex "Mode" item.nb_stats_finds_by_ue.mode %} </ul> {% endif %} |