From 6f7b9f516855f8b468e0397f28d303725bc14c97 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jun 2016 08:00:03 +0200 Subject: CSS: fix short menu issue --- ishtar_common/static/media/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ishtar_common/static') diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 1d47bcbd9..09f74f28d 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -45,7 +45,7 @@ a.add-button, color:#000; } -#context_menu .basket{ +#context_menu option.basket{ color:#000; font-weight: bold; font-style: italic; -- cgit v1.2.3 From 82859c1d3b06f940aabbdc33db8897a133ac1abe Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jun 2016 08:59:53 +0200 Subject: Static grid to jqgrid --- .../templates/ishtar/sheet_find.html | 11 ++- ishtar_common/static/js/grid.tbltogrid.js | 106 +++++++++++++++++++++ ishtar_common/templates/base.html | 1 + 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 ishtar_common/static/js/grid.tbltogrid.js (limited to 'ishtar_common/static') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index c5d3eb638..429a7da2b 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -102,7 +102,10 @@ {% if forloop.counter0 %}
{% endif %} {% endfor %} - +{% if not item.source.count %} +

{% trans "No document associated to this find" %}

+{% else %} +
@@ -118,8 +121,12 @@ {% empty %} - {% endfor %}
{%trans "Documents"%}
{% trans "Title" %}{% if doc.associated_url %}{% trans "Link"%}{% endif %}
{% trans "No document associated to this find" %}
+ +{% endif %} + {% endblock %} diff --git a/ishtar_common/static/js/grid.tbltogrid.js b/ishtar_common/static/js/grid.tbltogrid.js new file mode 100644 index 000000000..addab1e48 --- /dev/null +++ b/ishtar_common/static/js/grid.tbltogrid.js @@ -0,0 +1,106 @@ +/* + Transform a table to a jqGrid. + Peter Romianowski + If the first column of the table contains checkboxes or + radiobuttons then the jqGrid is made selectable. +*/ +// Addition - selector can be a class or id +function tableToGrid(selector, options) { +jQuery(selector).each(function() { + if(this.grid) {return;} //Adedd from Tony Tomov + // This is a small "hack" to make the width of the jqGrid 100% + jQuery(this).width("99%"); + var w = jQuery(this).width(); + + // Text whether we have single or multi select + var inputCheckbox = jQuery('tr td:first-child input[type=checkbox]:first', jQuery(this)); + var inputRadio = jQuery('tr td:first-child input[type=radio]:first', jQuery(this)); + var selectMultiple = inputCheckbox.length > 0; + var selectSingle = !selectMultiple && inputRadio.length > 0; + var selectable = selectMultiple || selectSingle; + //var inputName = inputCheckbox.attr("name") || inputRadio.attr("name"); + + // Build up the columnModel and the data + var colModel = []; + var colNames = []; + jQuery('th', jQuery(this)).each(function() { + if (colModel.length === 0 && selectable) { + colModel.push({ + name: '__selection__', + index: '__selection__', + width: 0, + hidden: true + }); + colNames.push('__selection__'); + } else { + colModel.push({ + name: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'), + index: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'), + width: jQuery(this).width() || 150 + }); + colNames.push(jQuery(this).html()); + } + }); + var data = []; + var rowIds = []; + var rowChecked = []; + jQuery('tbody > tr', jQuery(this)).each(function() { + var row = {}; + var rowPos = 0; + jQuery('td', jQuery(this)).each(function() { + if (rowPos === 0 && selectable) { + var input = jQuery('input', jQuery(this)); + var rowId = input.attr("value"); + rowIds.push(rowId || data.length); + if (input.is(":checked")) { + rowChecked.push(rowId); + } + row[colModel[rowPos].name] = input.attr("value"); + } else { + row[colModel[rowPos].name] = jQuery(this).html(); + } + rowPos++; + }); + if(rowPos >0) { data.push(row); } + }); + + // Clear the original HTML table + jQuery(this).empty(); + + // Mark it as jqGrid + jQuery(this).addClass("scroll"); + + jQuery(this).jqGrid(jQuery.extend({ + datatype: "local", + width: w, + colNames: colNames, + colModel: colModel, + multiselect: selectMultiple + //inputName: inputName, + //inputValueCol: imputName != null ? "__selection__" : null + }, options || {})); + + // Add data + var a; + for (a = 0; a < data.length; a++) { + var id = null; + if (rowIds.length > 0) { + id = rowIds[a]; + if (id && id.replace) { + // We have to do this since the value of a checkbox + // or radio button can be anything + id = encodeURIComponent(id).replace(/[.\-%]/g, "_"); + } + } + if (id === null) { + id = a + 1; + } + jQuery(this).jqGrid("addRowData",id, data[a]); + } + + // Set the selection + for (a = 0; a < rowChecked.length; a++) { + jQuery(this).jqGrid("setSelection",rowChecked[a]); + } +}); +}; diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 9339df178..8cd3c7793 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -17,6 +17,7 @@ + -- cgit v1.2.3 From 1d184d869a59889242cb9c8447762c4d462988c2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jun 2016 17:11:33 +0200 Subject: Show treatments in find sheet --- archaeological_finds/models.py | 40 ++++++++- .../templates/ishtar/sheet_find.html | 98 +++++++++++++++------- ishtar_common/static/media/style.css | 14 +++- .../templates/ishtar/blocks/window_field.html | 6 +- .../ishtar/blocks/window_field_multiple.html | 6 +- .../templates/ishtar/blocks/window_field_url.html | 6 +- ishtar_common/templatetags/link_to_window.py | 8 +- ishtar_common/templatetags/window_field.py | 27 ++++-- 8 files changed, 152 insertions(+), 53 deletions(-) (limited to 'ishtar_common/static') diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 0a1e59a68..b84b7614f 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -304,10 +304,10 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): find_number = models.IntegerField(_("Find number"), blank=True, null=True) upstream_treatment = models.ForeignKey( "Treatment", blank=True, null=True, - related_name='downstream_treatment', + related_name='downstream', verbose_name=_("Upstream treatment")) downstream_treatment = models.ForeignKey( - "Treatment", blank=True, null=True, related_name='upstream_treatment', + "Treatment", blank=True, null=True, related_name='upstream', verbose_name=_("Downstream treatment")) datings = models.ManyToManyField(Dating, verbose_name=_(u"Dating"), related_name='find') @@ -413,6 +413,42 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): bf.context_record.operation.get_reference(), self.index) + def upstream_treatments(self): + treatments = [] + base_finds = [bf.pk for bf in self.base_finds.all()] + if self.upstream_treatment and \ + self.upstream_treatment.pk not in treatments: + treatments.append((self.upstream_treatment.upstream.distinct( + ).order_by('label').all(), self.upstream_treatment)) + for upstream in self.upstream_treatment.upstream.all(): + if upstream.pk != self.pk and not [ + bf.pk for bf in upstream.base_finds.all() + if bf.pk in base_finds]: + continue + for items, treatment in upstream.upstream_treatments(): + if treatment.pk not in treatments: + treatments.append((treatment.upstream.order_by( + 'label').all(), treatment)) + return treatments + + def downstream_treatments(self): + treatments = [] + base_finds = [bf.pk for bf in self.base_finds.all()] + if self.downstream_treatment and \ + self.downstream_treatment.pk not in treatments: + treatments.append((self.downstream_treatment.downstream.distinct( + ).order_by('label').all(), self.downstream_treatment)) + for downstream in self.downstream_treatment.downstream.all(): + if downstream.pk != self.pk and not [ + bf.pk for bf in downstream.base_finds.all() + if bf.pk in base_finds]: + continue + for items, treatment in downstream.downstream_treatments(): + if treatment.pk not in treatments: + treatments.append((treatment.downstream.order_by( + 'label').all(), treatment)) + return treatments + def get_department(self): bf = self.get_first_base_find() if not bf: diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 429a7da2b..ff3dc55dd 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -1,5 +1,5 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_field from_dict %} +{% load i18n window_field from_dict link_to_window %} {% block head_sheet %} {{block.super}} @@ -28,42 +28,82 @@ {% endif%} -{% field "Free-ID" item.label %} -{% field "Previous ID" item.previous_id %} -{% field "Description" item.description %} -{% field "Created by" item.history_creator.ishtaruser.full_label %} -{% field "Administrative index" item.administrative_index %} -{% field_multiple "Material types" item.material_types %} -{% field "Dating" item.dating %} -{% field "Length (cm)" item.length %} -{% field "Width (cm)" item.width %} -{% field "Height (cm)" item.height %} -{% field "Diameter (cm)" item.diameter %} -{% field "Volume (l)" item.volume %} +
    +{% field_li "Free-ID" item.label %} +{% field_li "Previous ID" item.previous_id %} +{% field_li "Description" item.description %} +{% field_li "Created by" item.history_creator.ishtaruser.full_label %} +{% field_li "Administrative index" item.administrative_index %} +{% field_li_multiple "Material types" item.material_types %} +{% field_li "Dating" item.dating %} +{% field_li "Length (cm)" item.length %} +{% field_li "Width (cm)" item.width %} +{% field_li "Height (cm)" item.height %} +{% field_li "Diameter (cm)" item.diameter %} +{% field_li "Volume (l)" item.volume %} {% if item.weight %}{% with item.weight|add:' '|add:item.weight_unit as weight %} -{% field "Weight" weight %} +{% field_li "Weight" weight %} {% endwith %}{% endif %} -{% field "Weight" item.weight %} +{% field_li "Weight" item.weight %} -{% field "Find number" item.find_number %} -{% field "Conservatory state" item.conservatory_state %} -{% field_multiple "Type of preservation to consider" item.preservation_to_considers %} -{% field_multiple "Object types" item.object_types %} -{% field_multiple "Integrity" item.integrities %} +{% field_li "Find number" item.find_number %} +{% field_li "Conservatory state" item.conservatory_state %} +{% field_li_multiple "Type of preservation to consider" item.preservation_to_considers %} +{% field_li_multiple "Object types" item.object_types %} +{% field_li_multiple "Integrity" item.integrities %} {% if item.CHECK_DICT %} -{% field "Checked" item.checked|from_dict:item.CHECK_DICT %} +{% field_li "Checked" item.checked|from_dict:item.CHECK_DICT %} {% endif%} {% if item.history_object and item.history_object.CHECK_DICT %} -{% field "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %} +{% field_li "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %} {% endif%} +{% field_li "Container" item.container %} +
-{% if item.upstream_treatment %}

-{{item.upstream_treatment}} ({% for up in item.upstream_treatment.upstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{up}}{% endfor %})

{% endif%} -{% if item.downstream_treatment %}

-{{item.downstream_treatment}} ({% for dt in item.downstream_treatment.downstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{dt}}{% endfor %})

{% endif%} -{% if item.container %}

-{{item.container}}

{% endif%} +{% if item.upstream_treatment %} + + + + + + + + + + {% for items, treatment in item.upstream_treatments %} + + + + + + + + {% endfor %} +
{% trans "Upstream treatment" %}
{% trans "Type" %}{% trans "Related find" %}{% trans "Person" %}{% trans "Start date" %}{% trans "End date" %}
{{ treatment.treatment_type }}{% for item in items %}{% if not forloop.first %} ; {% endif %} {{item}} {{ item|link_to_window}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}
+{% endif %} + +{% if item.downstream_treatment %} + + + + + + + + + + {% for items, treatment in item.downstream_treatments %} + + + + + + + + {% endfor %} +
{% trans "Downstream treatment" %}
{% trans "Type" %}{% trans "Related find" %}{% trans "Person" %}{% trans "Start date" %}{% trans "End date" %}
{{ treatment.treatment_type }}{% for item in items %}{% if not forloop.first %} ; {% endif %} {{item}} {{ item|link_to_window}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}
+{% endif %}

{% trans "Associated base finds"%}

@@ -103,7 +143,7 @@ {% endfor %} {% if not item.source.count %} -

{% trans "No document associated to this find" %}

+ {% trans "No document associated to this find" %} {% else %} diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 09f74f28d..155d4ce9d 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -546,21 +546,20 @@ ul.form-flex { margin: 0; } - ul.form-flex li{ width: 395px; } @media screen and (min-width: 1051px) { div.form, - ul.form-flex { + ul.form-flex{ width: 800px; } } @media screen and (min-width: 1400px) { div.form, - ul.form-flex { + ul.form-flex{ width: 1200px; } } @@ -571,6 +570,10 @@ ul.form-flex label { padding-left: 10px; } +#window ul.form-flex label { + width: 150px; +} + .form table{ padding:0.2em; margin-left:auto; @@ -946,6 +949,11 @@ table.confirm tr.spacer td:last-child{ width:465px; } +#window ul.form-flex span.value { + display: inline-table; + width: 230px; +} + .strong{ font-weight:bold; } diff --git a/ishtar_common/templates/ishtar/blocks/window_field.html b/ishtar_common/templates/ishtar/blocks/window_field.html index 14cf1c21e..969f32dbb 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 %}

-{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe}}

{% 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_multiple.html b/ishtar_common/templates/ishtar/blocks/window_field_multiple.html index 30903b0d5..d1ee25c7b 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_multiple.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_multiple.html @@ -1,8 +1,6 @@ -{% load i18n %} -{% if data.count %}

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

  • {% else %}

    {% endif %} {% for d in data.all %} {% if forloop.counter0 %}, {% endif %}{{ d }} {% endfor %} -

    +{% if li %}
  • {% else %}

    {% endif %} {% endif %} - diff --git a/ishtar_common/templates/ishtar/blocks/window_field_url.html b/ishtar_common/templates/ishtar/blocks/window_field_url.html index b91f318b6..637366d1d 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 link_name %}{{link_name}}{% else %}{% trans "link" %}{% endif %}

    {% endif%} +{% load i18n %}{% if link %}{% if li %}
  • {% else %}

    {% endif %}

    +{% if link_name %}{{link_name}}{% else %}{% trans "link" %}{% endif %}{% if li %}

  • {% else %}

    {% endif %} +{% endif%} diff --git a/ishtar_common/templatetags/link_to_window.py b/ishtar_common/templatetags/link_to_window.py index 5ff928bb1..009a089d2 100644 --- a/ishtar_common/templatetags/link_to_window.py +++ b/ishtar_common/templatetags/link_to_window.py @@ -3,6 +3,7 @@ from django.core.urlresolvers import reverse from django.template import Library +from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ register = Library() @@ -10,10 +11,11 @@ register = Library() @register.filter def link_to_window(item): - return u' {}'.format( + return mark_safe( + u' {}'.format( reverse(item.SHOW_URL, args=[item.pk, '']), - _("Details")) + _("Details"))) @register.filter diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py index 34071f60f..269686a91 100644 --- a/ishtar_common/templatetags/window_field.py +++ b/ishtar_common/templatetags/window_field.py @@ -5,22 +5,37 @@ register = template.Library() @register.inclusion_tag('ishtar/blocks/window_field.html') -def field(caption, data, pre_data='', post_data=''): +def field(caption, data, pre_data='', post_data='', li=False): if data in (True, False): data = _(unicode(data)) return {'caption': caption, 'data': data, "pre_data": pre_data, - 'post_data': post_data} + 'post_data': post_data, 'li': li} + + +@register.inclusion_tag('ishtar/blocks/window_field.html') +def field_li(caption, data, pre_data='', post_data=''): + return field(caption, data, pre_data, post_data, li=True) @register.inclusion_tag('ishtar/blocks/window_field_url.html') -def field_url(caption, link, link_name=''): +def field_url(caption, link, link_name='', li=False): if not link: return u'' if not link.startswith('http://'): link = 'http://' + link - return {'caption': caption, 'link': link, "link_name": link_name} + return {'caption': caption, 'link': link, "link_name": link_name, 'li': li} + + +@register.inclusion_tag('ishtar/blocks/window_field_url.html') +def field_li_url(caption, link, link_name=''): + return field_url(caption, link, link_name, li=True) + + +@register.inclusion_tag('ishtar/blocks/window_field_multiple.html') +def field_multiple(caption, data, li=False): + return {'caption': caption, 'data': data, 'li': li} @register.inclusion_tag('ishtar/blocks/window_field_multiple.html') -def field_multiple(caption, data): - return {'caption': caption, 'data': data} +def field_li_multiple(caption, data): + return field_multiple(caption, data, li=True) -- cgit v1.2.3 From f3b01cd7f12dad19a7d4a994c15fb49ee7ad327f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jun 2016 17:34:14 +0200 Subject: CSS: minor update --- archaeological_finds/templates/ishtar/sheet_find.html | 2 +- ishtar_common/static/media/style.css | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common/static') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index ff3dc55dd..370f4bb37 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -25,7 +25,7 @@ {% if item.image %} - + {% endif%}
      diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 155d4ce9d..7ea698edd 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -753,6 +753,10 @@ table.confirm tr.spacer td:last-child{ right:135px; } +a.photo{ + padding: 0.5em; +} + #global-vars textarea{ width:220px; } -- cgit v1.2.3 From 8585f7b99bd43670a7be676b23d3ef37149982c9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Jun 2016 18:42:38 +0200 Subject: Improvement on find sheet --- .../templates/ishtar/sheet_find.html | 62 +++++++++------------- ishtar_common/static/media/style.css | 16 ++++++ ishtar_common/static/media/style_basic.css | 4 ++ .../ishtar/blocks/window_field_detail.html | 3 ++ ishtar_common/templates/ishtar/sheet_toolbar.html | 2 +- ishtar_common/templatetags/window_field.py | 12 +++++ 6 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 ishtar_common/templates/ishtar/blocks/window_field_detail.html (limited to 'ishtar_common/static') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 370f4bb37..b37a9957c 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -10,7 +10,7 @@ {% if previous or next %}
      -{%if previous%} +{% if previous %} {%trans "Previous version"%} ({{previous}}) {% endif %} {% if previous and next %} - {% endif %} @@ -68,16 +68,18 @@
    + {% for items, treatment in item.upstream_treatments %} - - - - + + + + + {% endfor %}
    {%trans "Documents"%}
    {% trans "Type" %} {% trans "Related find" %} {% trans "Person" %}{% trans "Container" %} {% trans "Start date" %} {% trans "End date" %}
    {{ treatment.treatment_type }}{% for item in items %}{% if not forloop.first %} ; {% endif %} {{item}} {{ item|link_to_window}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}{% for item in items %}{{item}} {{ item|link_to_window}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
    @@ -96,7 +98,7 @@ {% for items, treatment in item.downstream_treatments %} {{ treatment.treatment_type }} - {% for item in items %}{% if not forloop.first %} ; {% endif %} {{item}} {{ item|link_to_window}}{% endfor %} + {% for item in items %}{{item}} {{ item|link_to_window}}{% endfor %} {{ treatment.person|default_if_none:"" }} {{ treatment.start_date|default_if_none:"" }} {{ treatment.end_date|default_if_none:"" }} @@ -108,44 +110,31 @@

    {% trans "Associated base finds"%}

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

    -{{base_find.complete_id}}

    - -{% field "Short ID" base_find.short_id %} +
      +{% field_li "Complete ID" base_find.complete_id %} +{% field_li "Short ID" base_find.short_id %} {% if base_find.IS_ISOLATED_DICT %} -{% field "Batch/object" base_find.batch|from_dict:base_find.IS_ISOLATED_DICT %} +{% field_li "Batch/object" base_find.batch|from_dict:base_find.IS_ISOLATED_DICT %} {% endif %} {% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %} -{% field "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %} +{% field_li "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %} {% endif %} -{% if base_find.discovery_date %} -

      -{{base_find.discovery_date}}

      -{% endif%} -{% if base_find.description %} -

      -{{base_find.description}}

      -{% endif%} -{% field "Comment" base_find.comment "
      " "
      " %} -{% if base_find.special_interest %} -

      -{{base_find.special_interest}}

      -{% endif%} +{% field_li "Discovery date" base_find.discovery_date %} +{% field_li "Special interest" base_find.special_interest %} +{% field_li_detail "Context record" base_find.context_record %} +{% if base_find.context_record %}{% field_li "Parcel" base_find.context_record.parcel %} +{% field_li_detail "Operation" base_find.context_record.operation %}{% endif %} +
    -

    -{{ base_find.context_record }}

    -

    -{{base_find.context_record.parcel}}

    -

    -{{ base_find.context_record.operation }}

    +{% field "Description" base_find.description "
    " "
    " %} +{% field "Comment" base_find.comment "
    " "
    " %} {% if forloop.counter0 %}
    {% endif %} {% endfor %} -{% if not item.source.count %} - {% trans "No document associated to this find" %} -{% else %} - +{% if item.source.count %} +

    {% trans "Documents"%}

    +
    @@ -165,7 +154,8 @@
    {%trans "Documents"%}
    {% trans "Title" %}
    {% endif %} diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 7ea698edd..b42f2fbd9 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -905,6 +905,22 @@ a.photo{ font-style:italic; } +#window table.simple td.item-list{ + text-align:left; +} + +table td.item-list span{ + padding: 4px 4px; + background-color: #eee; + margin: 0.2em; + line-height: 26px; + border-radius: 4px; +} + +#window table.simple td.item-list .display_details{ + vertical-align: middle; +} + #window .head{ text-align:center; background-color:#f1f2f6; diff --git a/ishtar_common/static/media/style_basic.css b/ishtar_common/static/media/style_basic.css index d624ae09c..1d92928dc 100644 --- a/ishtar_common/static/media/style_basic.css +++ b/ishtar_common/static/media/style_basic.css @@ -85,3 +85,7 @@ p{ width:100%; border-bottom:1px solid #922; } + +.display_details, .display_details_inline{ + display: none; +} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_detail.html b/ishtar_common/templates/ishtar/blocks/window_field_detail.html new file mode 100644 index 000000000..2be9c5ec4 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_field_detail.html @@ -0,0 +1,3 @@ +{% load i18n %}{% if item %}{% if li %}
  • {% else %}

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

  • {% else %}

    {% endif %} +{% endif %} diff --git a/ishtar_common/templates/ishtar/sheet_toolbar.html b/ishtar_common/templates/ishtar/sheet_toolbar.html index 7e2c1659a..a6736b6cc 100644 --- a/ishtar_common/templates/ishtar/sheet_toolbar.html +++ b/ishtar_common/templates/ishtar/sheet_toolbar.html @@ -1,2 +1,2 @@ -{% load i18n link_to_window %} +{% load i18n link_to_window %} {% modify_toolbar item "person_modification" %} diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py index 269686a91..9ce2cf6b6 100644 --- a/ishtar_common/templatetags/window_field.py +++ b/ishtar_common/templatetags/window_field.py @@ -1,5 +1,6 @@ from django import template from django.utils.translation import ugettext_lazy as _ +from ishtar_common.templatetags.link_to_window import link_to_window register = template.Library() @@ -39,3 +40,14 @@ def field_multiple(caption, data, li=False): @register.inclusion_tag('ishtar/blocks/window_field_multiple.html') def field_li_multiple(caption, data): return field_multiple(caption, data, li=True) + + +@register.inclusion_tag('ishtar/blocks/window_field_detail.html') +def field_detail(caption, item, li=False): + return {'caption': caption, 'item': item, 'link': link_to_window(item), + 'li': li} + + +@register.inclusion_tag('ishtar/blocks/window_field_detail.html') +def field_li_detail(caption, item): + return field_detail(caption, item, li=True) -- cgit v1.2.3 From aef35a14f4bd3f3f87c1e19188d57cc66e6694b6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 8 Jun 2016 18:08:59 +0200 Subject: A default welcome page --- ishtar_common/static/media/style.css | 5 +++++ ishtar_common/templates/index.html | 2 +- ishtar_common/templates/welcome.html | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ishtar_common/templates/welcome.html (limited to 'ishtar_common/static') diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index b42f2fbd9..e74a6d205 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -434,6 +434,11 @@ div#main_menu > ul > li{ } */ +div#welcome{ + text-align:left; + font-size: 1.2em; +} + div#content{ clear:both; margin-top:190px ; diff --git a/ishtar_common/templates/index.html b/ishtar_common/templates/index.html index c28dfd0bb..2b6d7004e 100644 --- a/ishtar_common/templates/index.html +++ b/ishtar_common/templates/index.html @@ -1,3 +1,3 @@ {% extends "base.html" %} {% load i18n %} -{% block content %}{% if homepage %}{{homepage|safe}}{% endif %}{% endblock %} +{% block content %}
    {% if homepage %}{{homepage|safe}}{% else %}{% include "welcome.html" %}{% endif %}
    {% endblock %} diff --git a/ishtar_common/templates/welcome.html b/ishtar_common/templates/welcome.html new file mode 100644 index 000000000..42935d8f9 --- /dev/null +++ b/ishtar_common/templates/welcome.html @@ -0,0 +1,11 @@ +{% load i18n %} +{% load url from future %} + +

    {% trans "Welcome in Ishtar, open source software for management and inventory of archaeological data" %}

    +

    {% trans "Some useful links:" %}

    + -- cgit v1.2.3