diff options
8 files changed, 258 insertions, 204 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index c605addb9..2ad74b7d2 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -9,49 +9,56 @@ {% 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"> - {% include "ishtar/blocks/window_image.html" %} - <div class="card-body"> - <p class="card-text"> - <p class='window-refs'>{{ item.parcel.short_label }}</p> - <p class="window-refs">{{ item.label|default:"" }}</p> - {% include "ishtar/blocks/sheet_external_id.html" %} - </p> - </div> +<div class="clearfix"> + <div class="card float-left col-12 col-md-6 col-lg-4"> + {% include "ishtar/blocks/window_image.html" %} + <div class="card-body"> + <p class="card-text"> + <p class='window-refs'>{{ item.parcel.short_label }}</p> + <p class="window-refs">{{ item.label|default:"" }}</p> + {% include "ishtar/blocks/sheet_external_id.html" %} + </p> </div> </div> -</div> -<div class='row'> - {% field_flex "Complete ID" item.full_label %} - {% include "ishtar/blocks/sheet_creation_section.html" %} - {% field_flex "Type" item.unit %} - {% field_flex "Excavation technic" item.excavation_technic %} - {% field_flex_multiple "Chronology" item.datings %} - {% field_flex "Town" item.town.label_with_areas %} - {% field_flex_multiple "Documentation" item.documentations %} - {% field_flex "Opening date" item.opening_date %} - {% field_flex "Closing date" item.closing_date %} - {% field_flex_full "Comment on datings" item.datings_comment "<pre>" "</pre>" %} + <div class='row'> + {% field_flex_2 "Complete ID" item.full_label %} + {% field_flex_2 "Type" item.unit %} + {% with has_image=item.images.count %} + + {% if not has_image %} + </div> </div> +<div class="row"> + {% endif %} -{% include "ishtar/blocks/sheet_json.html" %} + {% field_flex "Excavation technic" item.excavation_technic '' '' has_image %} + {% field_flex_multiple "Chronology" item.datings has_image %} + {% field_flex "Town" item.town.label_with_areas '' '' has_image %} + {% field_flex_multiple "Documentation" item.documentations has_image %} + {% field_flex "Opening date" item.opening_date '' '' has_image %} + {% field_flex "Closing date" item.closing_date '' '' has_image %} + {% field_flex_full "Comment on datings" item.datings_comment "<pre>" "</pre>" has_image %} + </div> -{% if item.diameter or item.depth_of_appearance or item.documentations.count or item.description or item.lenght or item.width or item.depth or item.thickness or item.comment %} -<h3>{% trans "Description"%}</h3> -<div class='row'> - {% field_flex_full "Description" item.description "<pre>" "</pre>" %} - {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} - {% field_flex "Length (m)" item.lenght %} - {% field_flex "Width (m)" item.width %} - {% field_flex "Diameter (m)" item.diameter %} - {% field_flex "Depth (m)" item.depth %} - {% field_flex "Thickness (m)" item.thickness %} - {% field_flex "Depth of appearance (m)" item.depth_of_appearance %} + {% if item.diameter or item.depth_of_appearance or item.documentations.count or item.description or item.lenght or item.width or item.depth or item.thickness or item.comment %} + <h3>{% trans "Description"%}</h3> + <div class='row'> + {% field_flex_full "Description" item.description "<pre>" "</pre>" has_image %} + {% field_flex_full "Comment" item.comment "<pre>" "</pre>" has_image %} + {% field_flex "Length (m)" item.lenght '' '' has_image %} + {% field_flex "Width (m)" item.width '' '' has_image %} + {% field_flex "Diameter (m)" item.diameter '' '' has_image %} + {% field_flex "Depth (m)" item.depth '' '' has_image %} + {% field_flex "Thickness (m)" item.thickness '' '' has_image %} + {% field_flex "Depth of appearance (m)" item.depth_of_appearance '' '' has_image %} + </div> + {% endif %} + +{% if has_image %} </div> {% endif %} +{% endwith %} {% if item.activity or item.identification or item.interpretation %} <h3>{% trans "Interpretation"%}</h3> @@ -74,6 +81,13 @@ </div> {% endif %} +<h3>{% trans "Sheet"%}</h3> +<div class="row"> + {% include "ishtar/blocks/sheet_creation_section.html" %} +</div> + +{% include "ishtar/blocks/sheet_json.html" %} + {% trans "Context record relations" as cr_rels %} {% if item.right_relations.count %} {% dynamic_table_document cr_rels 'context_records_relations' 'left_record_id' item.pk '' output %} diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html new file mode 100644 index 000000000..c20ca66ee --- /dev/null +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -0,0 +1,87 @@ +{% load i18n window_field from_dict link_to_window window_tables window_header humanize %} + <p class='window-refs text-center'>{{base_find.complete_id }}</p> + <p class='window-refs text-center'>{{base_find.short_id }}</p> + {% if base_find.external_id %} + <p class='window-refs text-center external-id'> + <small title="{% trans 'Internal ID' %}"> + <i class="fa fa-key" aria-hidden="true"></i> + {{base_find.external_id|default:''}} + </small> + </p>{% endif %} + + <div class='row'> + {% field_flex_detail "Operation" base_find.context_record.operation first %} + {% field_flex_detail "Archaeological site" base_find.context_record.archaeological_site first %} + {% field_flex_detail "Context record" base_find.context_record first %} + {% field_flex "Town" base_find.context_record.town.label_with_areas '' '' first %} + {% field_flex "Parcel" base_find.context_record.parcel '' '' first %} + + {# START discovery dates #} + {% if not base_find.discovery_date_taq %} + {% trans "Discovery date" as discovery_date_label %} + {% field_flex discovery_date_label base_find.discovery_date '' '' first %} + {% elif base_find.discovery_date.year == base_find.discovery_date_taq.year and base_find.discovery_date_taq|date:"d-m" == "31-12" and base_find.discovery_date|date:"d-m" == "01-01" %} + {% trans "Discovery year" as discovery_year_label %} + {% field_flex discovery_year_label base_find.discovery_date.year '' '' first %} + {% else %} + {% trans "Discovery date (TPQ)" as discovery_tpq_label %} + {% field_flex discovery_tpq_label base_find.discovery_date '' '' first %} + {% trans "Discovery date (TAQ)" as discovery_taq_label %} + {% field_flex discovery_taq_label base_find.discovery_date_taq '' '' first %} + {% endif %} + {# END discovery dates #} + + {% field_flex "Excavation ID" base_find.excavation_id '' '' first %} + {% field_flex "Batch/object" base_find.batch '' '' first %} + {% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %} + {% field_flex "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT '' '' first %} + {% endif %} + + {% field_flex "Special interest" base_find.special_interest '' '' first %} + {% field_flex_full "Description" base_find.description "<pre>" "</pre>" first %} + {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" first %} + </div> + + {% if base_find.x or base_find.y or base_find.topographic_localisation %} + <h3>{% trans "Coordinates"%}</h3> + <div class='row'> + {% field_flex "Point of topographic reference" base_find.topographic_localisation %} + <dl class="col-12 d-flex flex-wrap row"> + <dt class="col-2">{% trans "Coordinates" %}</dt> + <dd class="col-10"> + {% trans "X:"%} {{base_find.x|default_if_none:"-"}} + {% if base_find.estimated_error_x %} ({% trans "error:" %} {{base_find.estimated_error_x}}){% endif %}, + {% trans "Y:"%} {{base_find.y|default_if_none:"-"}}, + {% if base_find.estimated_error_y %} ({% trans "error:" %} {{base_find.estimated_error_y}}){% endif %}, + {% trans "Z:"%} {{base_find.z|default_if_none:"-"}} + {% if base_find.estimated_error_z %} ({% trans "error:" %} {{base_find.estimated_error_z}}){% endif %} + {% if base_find.spatial_reference_system %} + – {{base_find.spatial_reference_system.label}}{% if base_find.spatial_reference_system.srid %} - + {% trans "SRID"%} {{base_find.spatial_reference_system.srid}}{% endif %} + {% endif %} + </dd> + </dl> + </div> + {% endif %} + <h3>{% trans "Sheet"%}</h3> + <div class='row'> + {% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} + {% with item.history_creator.ishtaruser.full_label|add:"<br/><i>"|add:creation_date|add:"</i>" as creator %} + {% field_flex "Created by" creator|safe '' '' first %} + {% endwith %}{% endwith %} + {% if item.history_creation_date != item.last_edition_date %} + {% with item.last_edition_date|date:"SHORT_DATETIME_FORMAT" as edition_date %} + {% with item.history_modifier.ishtaruser.full_label|add:"<br/><i>"|add:edition_date|add:"</i>" as modifier %} + {% trans "Last modified by" as lastmodifiedby_label %} + {% field_flex lastmodifiedby_label modifier|safe '' '' first %} + {% endwith %}{% endwith %} + {% endif %} + </div> + +{% if first %} + </div> +</div> +<div class="subsection"> +{% endif %} + +{% if forloop.counter0 %}<hr/>{% endif %} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index f36dd6afe..55c02d8c7 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -9,114 +9,36 @@ {% 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"> - {% include "ishtar/blocks/window_image.html" %} - <div class="card-body"> - <p class="card-text"> - <p class="window-refs" title="{% trans 'Denomination' %}">{{ item.denomination|default:"" }}</p> - <p class="window-refs" title="{% trans 'Free ID' %}">{{ item.label|default:"" }}</p> - <p class='window-refs' title="{% trans 'Base find - Complete ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.complete_id}}{% endfor %}</p> - <p class='window-refs' title="{% trans 'Base find - Short ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.short_id}}{% endfor %}</p> - <p class="window-refs" title="{% trans 'Find - Administrative ID' %}">{{ item.administrative_index|default:"" }}</p> - {% include "ishtar/blocks/sheet_external_id.html" %} - </p> - </div> - </div> - </div> -</div> - {% if item.downstream_treatment %} <div class="alert alert-warning" role="alert"> - {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}</p> + {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}</p> </div> {% endif %} -<h2>{% trans "Associated base finds"%}</h2> - -<div class="subsection"> - {% for base_find in item.base_finds.all %} - <p class='window-refs text-center'>{{base_find.complete_id }}</p> - <p class='window-refs text-center'>{{base_find.short_id }}</p> - {% if base_find.external_id %} - <p class='window-refs text-center external-id'> - <small title="{% trans 'Internal ID' %}"> - <i class="fa fa-key" aria-hidden="true"></i> - {{base_find.external_id|default:''}} - </small> - </p>{% endif %} - - <div class='row'> - {% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} - {% with item.history_creator.ishtaruser.full_label|add:"<br/><i>"|add:creation_date|add:"</i>" as creator %} - {% field_flex "Created by" creator|safe %} - {% endwith %}{% endwith %} - {% if item.history_creation_date != item.last_edition_date %} - {% with item.last_edition_date|date:"SHORT_DATETIME_FORMAT" as edition_date %} - {% with item.history_modifier.ishtaruser.full_label|add:"<br/><i>"|add:edition_date|add:"</i>" as modifier %} - {% trans "Last modified by" as lastmodifiedby_label %} - {% field_flex lastmodifiedby_label modifier|safe %} - {% endwith %}{% endwith %} - {% endif %} - {% field_flex "Excavation ID" base_find.excavation_id %} - {% field_flex "Batch/object" base_find.batch %} - {% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %} - {% field_flex "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %} - {% endif %} +<div class="clearfix"> + <div class="card float-left col-12 col-md-6 col-lg-4"> + {% include "ishtar/blocks/window_image.html" %} + <div class="card-body"> + <p class="card-text"> + </p> + </div> + </div> - {# START discovery dates #} - {% if not base_find.discovery_date_taq %} - {% trans "Discovery date" as discovery_date_label %} - {% field_flex discovery_date_label base_find.discovery_date %} - {% elif base_find.discovery_date.year == base_find.discovery_date_taq.year and base_find.discovery_date_taq|date:"d-m" == "31-12" and base_find.discovery_date|date:"d-m" == "01-01" %} - {% trans "Discovery year" as discovery_year_label %} - {% field_flex discovery_year_label base_find.discovery_date.year %} - {% else %} - {% trans "Discovery date (TPQ)" as discovery_tpq_label %} - {% field_flex discovery_tpq_label base_find.discovery_date %} - {% trans "Discovery date (TAQ)" as discovery_taq_label %} - {% field_flex discovery_taq_label base_find.discovery_date_taq %} - {% endif %} - {# END discovery dates #} + <h2>{% trans "Associated base finds"%}</h2> - {% field_flex "Special interest" base_find.special_interest %} - {% field_flex_detail "Context record" base_find.context_record %} - {% field_flex "Town" base_find.context_record.town.label_with_areas %} - {% field_flex "Parcel" base_find.context_record.parcel %} - {% field_flex_detail "Operation" base_find.context_record.operation %} - {% field_flex_detail "Archaeological site" base_find.context_record.archaeological_site %} - {% field_flex_full "Description" base_find.description "<pre>" "</pre>" %} - {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" %} + <div class="subsection"> + {% for base_find in item.base_finds.all %} + {% with first=forloop.first|add:item.images.count %} + {% include "ishtar/sheet_basefind.html" %} + {% endwith %} + {% endfor %} </div> - {% if base_find.x or base_find.y or base_find.topographic_localisation %} - <h3>{% trans "Coordinates"%}</h3> - <div class='row'> - {% field_flex "Point of topographic reference" base_find.topographic_localisation %} - <dl class="col-12 d-flex flex-wrap row"> - <dt class="col-2">{% trans "Coordinates" %}</dt> - <dd class="col-10"> - {% trans "X:"%} {{base_find.x|default_if_none:"-"}} - {% if base_find.estimated_error_x %} ({% trans "error:" %} {{base_find.estimated_error_x}}){% endif %}, - {% trans "Y:"%} {{base_find.y|default_if_none:"-"}}, - {% if base_find.estimated_error_y %} ({% trans "error:" %} {{base_find.estimated_error_y}}){% endif %}, - {% trans "Z:"%} {{base_find.z|default_if_none:"-"}} - {% if base_find.estimated_error_z %} ({% trans "error:" %} {{base_find.estimated_error_z}}){% endif %} - {% if base_find.spatial_reference_system %} - – {{base_find.spatial_reference_system.label}}{% if base_find.spatial_reference_system.srid %} - - {% trans "SRID"%} {{base_find.spatial_reference_system.srid}}{% endif %} - {% endif %} - </dd> - </dl> - </div> - {% endif %} +<h3>{% trans "Identification" %}</h3> +<div class='text-center'> + {% include "ishtar/blocks/sheet_external_id.html" %} </div> -{% if forloop.counter0 %}<hr/>{% endif %} -{% endfor %} - -<h3>{% trans "Identification" %}</h3> <div class='row'> {% field_flex "Denomination" item.denomination %} @@ -127,7 +49,6 @@ {% field_flex "Seal number" item.seal_number %} {% trans "Administrative index" as admin_index_label %} {% field_flex admin_index_label item.administrative_index %} - {% include "ishtar/blocks/sheet_creation_section.html" %} {% field_flex_full "Mark" item.mark "<pre>" "</pre>" %} </div> @@ -176,6 +97,7 @@ {% field_flex checked_label item.checked|from_dict:item.history_object.CHECK_DICT %} {% endif%} {% field_flex "Check date" item.check_date %} + {% include "ishtar/blocks/sheet_creation_section.html" %} </div> {% if item.integrities.count or item.remarkabilities.count or item.conservatory_state or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.appraisal_date or item.treatment_emergency or item.insurance_value or item.estimated_value %} diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 91c1501ec..733b0b39a 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -9,9 +9,10 @@ {% 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"> +<h3>{% trans "General"%}</h3> + +<div class="clearfix"> + <div class="card float-left col-12 col-md-6 col-lg-4"> {% include "ishtar/blocks/window_image.html" %} <div class="card-body"> <div class="row"> @@ -25,66 +26,75 @@ </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 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> - -<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 class="row"> + {% field_flex_2 "Old code" item.old_code %} + {% trans "Begining date" as begining_date_label %} + {% field_flex_2 begining_date_label item.start_date|date:"DATE_FORMAT" %} + {% field_flex_2 "Excavation end date" item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %} + {% with has_image=item.images.count %} + {% if not has_image %} </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> + <div class="row"> + {% endif %} + + {% field_flex_detail "Head scientist" item.scientist has_image %} + {% field_flex_detail "In charge" item.in_charge has_image %} + {% field_flex_multiple "Collaborators" item.collaborators has_image %} + {% field_flex_detail "Operator" item.operator has_image %} + <div class="col-12 {% if has_image %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} 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 {% if has_image %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} 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_2 "Type" item.operation_type %} + {% if item.surface %} + <div class="col-12 {% if has_image %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} 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 {% if has_image %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} 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 {% if has_image %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} d-flex flex-wrap row"> + <dt class="col-5">{%trans "Duration"%}</dt> + <dd class='col-7'> + {{ item.duration }} {% trans "days" %} + </dd> + </div> + {% endif %} + {% if has_image %} </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> + {% endif %} + {% endwith %} </div> - {%endif%} +</div> +<div class="row"> {% field_flex_multiple "Remains" item.remains %} {% field_flex_multiple "Periods" item.periods %} {% field_flex "Record quality" item.record_quality_type %} @@ -116,6 +126,11 @@ {% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "<pre>" "</pre>" %} </div> +<h3>{% trans "Sheet"%}</h3> +<div class="row"> + {% include "ishtar/blocks/sheet_creation_section.html" %} +</div> + {% include "ishtar/blocks/sheet_json.html" %} {% if item.virtual_operation %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html index 5968f9afa..6f5d80ba8 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_detail.html @@ -1,5 +1,5 @@ {% load i18n %}{% if item %} -<dl class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> +<dl class="col-12 {% if size == 2 %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} d-flex flex-wrap row"> <dt class="col-5">{% trans caption %}</dt> <dd class="col-7">{{item}}{{link}}</dd> </dl> diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html index 60f6361b7..010200837 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html @@ -1,5 +1,5 @@ {% load i18n %}{% if data.count %} -<dl class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> +<dl class="col-12 {% if size == 2 %}col-lg-6{% else %}col-md-6 col-lg-4{% endif %} d-flex flex-wrap row"> <dt class="col-5">{% trans caption %}</dt> <dd class="col-7">{% for d in data.all %} {% if forloop.counter0 %} ; {% endif %}{{ d }} diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py index f1db8cf48..46329a3fa 100644 --- a/ishtar_common/templatetags/window_field.py +++ b/ishtar_common/templatetags/window_field.py @@ -34,8 +34,11 @@ def field_li(caption, data, pre_data='', post_data=''): @register.inclusion_tag('ishtar/blocks/window_field_flex.html') -def field_flex(caption, data, pre_data='', post_data=''): - return field(caption, data, pre_data, post_data) +def field_flex(caption, data, pre_data='', post_data='', small=False): + size = None + if small: + size = 2 + return field(caption, data, pre_data, post_data, size=size) @register.inclusion_tag('ishtar/blocks/window_field_flex.html') @@ -44,8 +47,11 @@ def field_flex_2(caption, data, pre_data='', post_data=''): @register.inclusion_tag('ishtar/blocks/window_field_flex_full.html') -def field_flex_full(caption, data, pre_data='', post_data=''): - return field(caption, data, pre_data, post_data) +def field_flex_full(caption, data, pre_data='', post_data='', small=False): + size = None + if small: + size = 2 + return field(caption, data, pre_data, post_data, size=size) @register.inclusion_tag('ishtar/blocks/window_field_url.html') @@ -85,8 +91,8 @@ def field_flex_file(context, caption, link): @register.inclusion_tag('ishtar/blocks/window_field_multiple.html') -def field_multiple(caption, data, li=False): - return {'caption': caption, 'data': data, 'li': li} +def field_multiple(caption, data, li=False, size=None): + return {'caption': caption, 'data': data, 'li': li, "size": size} @register.inclusion_tag('ishtar/blocks/window_field_multiple.html') @@ -95,14 +101,17 @@ def field_li_multiple(caption, data): @register.inclusion_tag('ishtar/blocks/window_field_flex_multiple.html') -def field_flex_multiple(caption, data): - return field_multiple(caption, data) +def field_flex_multiple(caption, data, small=False): + size = None + if small: + size = 2 + return field_multiple(caption, data, size=size) @register.inclusion_tag('ishtar/blocks/window_field_detail.html') -def field_detail(caption, item, li=False): +def field_detail(caption, item, li=False, size=None): return {'caption': caption, 'item': item, 'link': link_to_window(item), - 'li': li} + 'li': li, 'size': size} @register.inclusion_tag('ishtar/blocks/window_field_detail.html') @@ -111,5 +120,8 @@ def field_li_detail(caption, item): @register.inclusion_tag('ishtar/blocks/window_field_flex_detail.html') -def field_flex_detail(caption, item): - return field_detail(caption, item) +def field_flex_detail(caption, item, small=False): + size = None + if small: + size = 2 + return field_detail(caption, item, size=size) diff --git a/scss/custom.scss b/scss/custom.scss index e0b9cbe74..2406a1d98 100644 --- a/scss/custom.scss +++ b/scss/custom.scss @@ -290,10 +290,14 @@ textarea { background-color: $gray-200; } -.sheet .row{ +.sheet .row.toolbar{ padding: 0.5em 0.75em; } +.sheet .row{ + padding: 0 0.75em; +} + .clean-table h4{ margin-top: 1em; } |