# HG changeset patch # User veltr # Date 1380196446 -7200 # Node ID 984d0da5e84d3977036ae5b138046b9b5b83db5e # Parent 3d102aed3213bc32e153f37da7c3ce61631d2881 New datasheet row grouping diff -r 3d102aed3213 -r 984d0da5e84d src/jocondelab/static/jocondelab/css/front-notice.css --- a/src/jocondelab/static/jocondelab/css/front-notice.css Wed Sep 25 17:34:18 2013 +0200 +++ b/src/jocondelab/static/jocondelab/css/front-notice.css Thu Sep 26 13:54:06 2013 +0200 @@ -24,24 +24,16 @@ } } -.notice-termgroup { - margin: 10px 0 5px; font-size: 16px; font-weight: 800; -} - .notice-datasheet { font-size: 13px; } -.notice-title { - font-size: 15px; -} - -.notice-datasheet tr { - line-height: 1em; +.datasheet-title { + font-size: 15px; font-weight: bold; } .notice-datasheet th { - width: 130px; font-weight: 700; text-align: left; padding-right: 2px; + width: 130px; font-style: italic; text-align: left; padding-right: 2px; } html[dir=rtl] .notice-datasheet th { @@ -53,32 +45,48 @@ } .notice-datasheet th, .notice-datasheet td { - padding-top: 3px; -} - -.notice-marginabove th, .notice-marginabove td { - padding-top: 10px; + line-height: 1.2em; padding-top: 8px; } .notice-term { margin: -2px 5px 4px 0; } -.notice-term.term-untranslated, .notice-term.contribution-null { - background: transparent; color: #333333; font-style: italic; +.notice-term.term-untranslated { + background: transparent; padding: 0; +} + +.notice-term.term-untranslated:after { + content: " ;"; +} + +.notice-term.term-untranslated:last-child:after { + display: none; } .notice-small { font-size: 11px; } +.datasheet-group { + display: inline; +} + +.datasheet-group:before { + content: " | "; +} + +.datasheet-group:first-child:before { + display: none; +} + .notice-contribution-field { font-size: 12px; line-height: 20px; height: 20px; padding: 0 4px; border: 1px solid #999999; margin-bottom: 8px; border-radius: 4px; width: 90%; } .notice-jocondelink { - margin: 10px 0; font-size: 16px; color: #0000C0; + margin: 15px 0; font-size: 16px; color: #0000C0; } .contribution-frame { @@ -101,6 +109,10 @@ font-size: 14px; line-height: 16px; } +.notice-term.contribution-null { + background: transparent; font-style: italic; +} + .contribution-vote { float: right; height: 16px; width: 13px; margin-left: 3px; } diff -r 3d102aed3213 -r 984d0da5e84d src/jocondelab/templates/jocondelab/front_notice.html --- a/src/jocondelab/templates/jocondelab/front_notice.html Wed Sep 25 17:34:18 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/front_notice.html Thu Sep 26 13:54:06 2013 +0200 @@ -47,43 +47,84 @@
- {% show_datasheet_row 'AUTR' row_class='notice-title' %} - {% show_datasheet_row 'ECOL' row_class='notice-marginabove' %} - {% show_datasheet_row 'DOMN' row_class='notice-marginabove' %} -
-

{% trans 'Désignation' %}

- - {% show_datasheet_row 'TITR' row_class='notice-title' %} - {% show_datasheet_row 'APPL' row_class='notice-title' %} - {% show_datasheet_row 'DENO' row_class='notice-title' %} + {% if object.autr %} + + + + + {% endif %} + {% if object.ecol %} + + + + + {% endif %} + {% if object.domn %} + + + + + {% endif %} + {% if object.titr or object.deno or object.appl %} + + + + + {% endif %} {% if object.repr or object.srep %} -
{% trans 'Auteur(s) :' %}{% show_datasheet_row 'AUTR' %}
{% trans 'École :' %}{% show_datasheet_row 'ECOL' %}
{% trans 'Domaine(s) :' %}{% show_datasheet_row 'DOMN' %}
{% trans 'Désignation :' %}{% show_datasheet_row 'TITR' %}{% show_datasheet_row 'APPL' %}{% show_datasheet_row 'DENO' %}
-

{% trans 'Sujet représenté' %}

- - {% show_datasheet_row 'REPR' %} - {% show_datasheet_row 'SREP' %} + + + + {% endif %} {% if object.peri or object.mill or object.epoq %} -
{% trans 'Sujet représenté :' %}{% show_datasheet_row 'REPR' %}{% show_datasheet_row 'SREP' %}
-

{% trans 'Datation' %}

- - {% show_datasheet_row 'PERI' %} - {% show_datasheet_row 'MILL' %} - {% show_datasheet_row 'EPOQ' %} + + + + {% endif %} - {% show_datasheet_row 'TECH' row_class='notice-marginabove' %} - {% show_datasheet_row 'DIMS' row_class='notice-marginabove' %} + {% if object.tech %} + + + + + {% endif %} + {% if object.tech %} + + + + + {% endif %} {% if object.lieux or object.decv %} -
{% trans 'Datation :' %}{% show_datasheet_row 'PERI' %}{% show_datasheet_row 'MILL' %}{% show_datasheet_row 'EPOQ' %}
{% trans 'Matériaux / Techniques :' %}{% show_datasheet_row 'TECH' %}
{% trans 'Mesures :' %}{% show_datasheet_row 'DIMS' %}
-

{% trans 'Provenance' %}

- - {% show_datasheet_row 'LIEUX' %} - {% show_datasheet_row 'DECV' %} + + + + + {% endif %} + {% if object.hist %} + + + + {% endif %} - {% show_datasheet_row 'HIST' row_class='notice-marginabove' %} - {% show_datasheet_row 'LOCA' row_class='notice-marginabove' %} - {% show_datasheet_row 'COPY' row_class='notice-small notice-marginabove' %} - {% show_datasheet_row 'PHOT' row_class='notice-small' %} + {% if object.loca %} + + + + + {% endif %} + {% if object.copy %} + + + + + {% endif %} + {% if object.phot %} + + + + + {% endif %}
{% trans 'Provenance :' %}{% show_datasheet_row 'LIEUX' %}{% show_datasheet_row 'DECV' %}
{% trans 'Historique :' %}{% show_datasheet_row 'HIST' %}
{% trans 'Lieu de conservation :' %}{% show_datasheet_row 'LOCA' %}
{% trans 'Copyright notice :' %}{% show_datasheet_row 'COPY' %}
{% trans 'Crédits photographiques :' %}{% show_datasheet_row 'PHOT' %}
- - + {% elif base_field %} - - {% trans fieldname context 'Thesaurus label' %}{% trans ':' %} - {{base_field}} - +{{base_field}} {% endif %} diff -r 3d102aed3213 -r 984d0da5e84d src/jocondelab/templatetags/jlutils.py --- a/src/jocondelab/templatetags/jlutils.py Wed Sep 25 17:34:18 2013 +0200 +++ b/src/jocondelab/templatetags/jlutils.py Thu Sep 26 13:54:06 2013 +0200 @@ -4,12 +4,11 @@ register = template.Library() @register.inclusion_tag('jocondelab/partial/datasheet_row.html', takes_context=True) -def show_datasheet_row(context, fieldname, **kwargs): +def show_datasheet_row(context, fieldname): return { "fieldname": fieldname, "linked_terms": context['terms_by_thesaurus'].get(fieldname.upper(),None), - "base_field": getattr(context['object'],fieldname.lower()), - "row_class": kwargs.get("row_class", None) + "base_field": getattr(context['object'],fieldname.lower()) } @register.filter