From: olivier <> Date: Wed, 27 Jan 2010 15:49:59 +0000 (+0000) Subject: update item detail template (data fields) X-Git-Tag: 1.1~571 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=01268f9f998dd571a3bff3f513b88cab16df2a18;p=telemeta.git update item detail template (data fields) --- diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 56dc17ee..472fc6e2 100644 Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ diff --git a/telemeta/locale/fr/LC_MESSAGES/django.po b/telemeta/locale/fr/LC_MESSAGES/django.po index beac1804..836b783e 100644 --- a/telemeta/locale/fr/LC_MESSAGES/django.po +++ b/telemeta/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-27 14:25+0100\n" +"POT-Creation-Date: 2010-01-27 16:46+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,15 +16,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: models/core.py:127 +#: models/core.py:130 msgid "Duration" msgstr "" -#: models/core.py:132 +#: models/core.py:135 msgid "Enter a valid duration in HH:MM[:ss[.uuuuuu]] format." msgstr "" -#: models/crem.py:150 +#: models/crem.py:150 models/crem.py:313 msgid "reference" msgstr "référence" @@ -68,7 +68,7 @@ msgstr "auteur de la notice éditée" msgid "related documentation" msgstr "documentation associée" -#: models/crem.py:163 models/crem.py:308 +#: models/crem.py:163 msgid "collector" msgstr "collecteur" @@ -236,6 +236,10 @@ msgstr "" msgid "copy of" msgstr "copie de" +#: models/crem.py:308 +msgid "recorded by" +msgstr "enregistré par" + #: models/crem.py:309 msgid "cultural area" msgstr "aire culturelle" @@ -248,14 +252,14 @@ msgstr "nom générique" msgid "collector selection" msgstr "sélection collecteur" -#: models/crem.py:313 -msgid "depositor reference" -msgstr "référence du déposant" - #: models/crem.py:315 msgid "file" msgstr "fichier" +#: models/crem.py:322 +msgid "keywords" +msgstr "mots-clés" + #: models/crem.py:378 models/crem.py:504 models/crem.py:644 msgid "item" msgstr "item" @@ -277,7 +281,7 @@ msgstr "valeur" msgid "name" msgstr "nom" -#: models/crem.py:482 models/crem.py:495 models/crem.py:506 +#: models/crem.py:482 models/crem.py:495 msgid "instrument" msgstr "" @@ -285,13 +289,21 @@ msgstr "" msgid "parent instrument" msgstr "instrument parent" -#: models/crem.py:493 models/crem.py:508 models/crem.py:615 +#: models/crem.py:493 models/crem.py:615 msgid "alias" msgstr "alias" +#: models/crem.py:506 +msgid "scientific instrument" +msgstr "instrument scientifique" + +#: models/crem.py:508 +msgid "vernacular instrument" +msgstr "instrument vernaculaire" + #: models/crem.py:509 -msgid "instruments num" -msgstr "nb instruments" +msgid "number" +msgstr "nombre" #: models/crem.py:510 msgid "interprets" @@ -390,6 +402,7 @@ msgid "Recording year" msgstr "Année d'enregistrement" #: templates/telemeta_default/collection_detail.html:61 +#: templates/telemeta_default/mediaitem_detail.html:149 msgid "Geographic and cultural informations" msgstr "Indications géographiques et culturelles" @@ -402,21 +415,46 @@ msgid "Collector" msgstr "Collecteur" #: templates/telemeta_default/collection_detail.html:100 +#: templates/telemeta_default/mediaitem_detail.html:214 msgid "Archiving data" msgstr "Données d'archivage" #: templates/telemeta_default/collection_detail.html:121 +#: templates/telemeta_default/mediaitem_detail.html:229 msgid "Technical data" msgstr "Données techniques" #: templates/telemeta_default/collection_detail.html:126 +#: templates/telemeta_default/mediaitem_detail.html:232 msgid "Media type" msgstr "Type de media" #: templates/telemeta_default/collection_detail.html:126 +#: templates/telemeta_default/mediaitem_detail.html:232 msgid "Audio" msgstr "" #: templates/telemeta_default/collection_detail.html:130 msgid "Number of items" msgstr "Nombre d'items" + +#: templates/telemeta_default/mediaitem_detail.html:136 +msgid "Collection title" +msgstr "Titre collection" + +#: templates/telemeta_default/mediaitem_detail.html:140 +msgid "Recording date" +msgstr "Date d'enregistrement" + +#: templates/telemeta_default/mediaitem_detail.html:152 +msgid "Location" +msgstr "Lieu" + +#: templates/telemeta_default/mediaitem_detail.html:167 +msgid "Musical informations" +msgstr "Informations sur la musique" + +#: templates/telemeta_default/mediaitem_detail.html:203 +msgid "General informations" +msgstr "Informations générales" + diff --git a/telemeta/models/crem.py b/telemeta/models/crem.py index dd937840..d5618133 100755 --- a/telemeta/models/crem.py +++ b/telemeta/models/crem.py @@ -305,21 +305,21 @@ class MediaItem(MediaResource): external_references = TextField(_('published reference')) moda_execut = CharField(_('moda_execut')) copied_from_item = WeakForeignKey('self', related_name="copies", verbose_name=_('copy of')) - collector = CharField(_('collector')) + collector = CharField(_('recorded by')) cultural_area = CharField(_('cultural area')) generic_style = WeakForeignKey('GenericStyle', related_name="items", verbose_name=_('generic name')) collector_selection = CharField(_('collector selection')) - creator_reference = CharField(_('depositor reference')) + creator_reference = CharField(_('reference')) comment = TextField(_('comment')) file = FileField(_('file'), upload_to='items/%Y/%m/%d', db_column="filename") public_access = CharField(_('public access'), choices=PUBLIC_ACCESS_CHOICES, max_length=16, default="metadata") objects = query.MediaItemManager() - @property def keywords(self): - return ContextKeyword.objects.filter(mediaitemkeyword__item = self) + return ContextKeyword.objects.filter(item_relations__item = self) + keywords.verbose_name = _('keywords') @property def public_id(self): @@ -503,10 +503,10 @@ class MediaItemPerformance(ModelCore): media_item = ForeignKey('MediaItem', related_name="performances", verbose_name=_('item')) instrument = WeakForeignKey('Instrument', related_name="performances", - verbose_name=_('instrument')) + verbose_name=_('scientific instrument')) alias = WeakForeignKey('InstrumentAlias', related_name="performances", - verbose_name=_('alias')) - instruments_num = CharField(_('instruments num')) + verbose_name=_('vernacular instrument')) + instruments_num = CharField(_('number')) musicians = CharField(_('interprets')) class Meta(MetaCore): @@ -641,8 +641,8 @@ class ContextKeyword(Enumeration): class MediaItemKeyword(ModelCore): "Item keyword" - item = ForeignKey('MediaItem', verbose_name=_('item')) - keyword = ForeignKey('ContextKeyword', verbose_name=_('keyword')) + item = ForeignKey('MediaItem', verbose_name=_('item'), related_name="keyword_relations") + keyword = ForeignKey('ContextKeyword', verbose_name=_('keyword'), related_name="item_relations") class Meta(MetaCore): db_table = 'media_item_keywords' diff --git a/telemeta/models/dublincore.py b/telemeta/models/dublincore.py index 5c833371..a839e7f6 100644 --- a/telemeta/models/dublincore.py +++ b/telemeta/models/dublincore.py @@ -205,7 +205,7 @@ def express_item(item): creator, Element('contributor', item.collection.metadata_author), Element.multiple('subject', settings.TELEMETA_SUBJECTS), - Element.multiple('subject', item.keywords), + Element.multiple('subject', item.keywords()), Element('description', item.context_comment, 'abstract'), Element('publisher', item.collection.publisher), Element('publisher', settings.TELEMETA_ORGANIZATION), diff --git a/telemeta/templates/telemeta_default/collection_detail.html b/telemeta/templates/telemeta_default/collection_detail.html index fa915b92..1220740a 100644 --- a/telemeta/templates/telemeta_default/collection_detail.html +++ b/telemeta/templates/telemeta_default/collection_detail.html @@ -61,8 +61,8 @@

{% trans "Geographic and cultural informations" %}

- {% dl_field collection "countries" join with ", " %} - {% dl_field collection "ethnic_groups" join with ", " %} + {% dl_field collection "countries" join with ", " %} + {% dl_field collection "ethnic_groups" join with ", " %}
diff --git a/telemeta/templates/telemeta_default/mediaitem_detail.html b/telemeta/templates/telemeta_default/mediaitem_detail.html index 1344907e..655d0922 100644 --- a/telemeta/templates/telemeta_default/mediaitem_detail.html +++ b/telemeta/templates/telemeta_default/mediaitem_detail.html @@ -1,5 +1,6 @@ {% extends "telemeta/base.html" %} {% load telemeta_utils %} +{% load i18n %} {% block stylesheets %} {{ block.super }} @@ -127,15 +128,17 @@ load_player({{ item.get_duration }});
{% block general_info %}
- {% if item.auteur %}
Auteur
{{ item.auteur }}
{% endif %} - {% if item.annee_enr %}
Année d'enregistrement
{{ item.annee_enr }}
{% endif %} - {% if item.dates_enregistr %}
Date d'enregistrement
{{ item.dates_enregistr }}
{% endif %} - {% if item.title %}
Titre
{{ item.title }}
{% endif %} - {% if item.transcrip_trad %}
Traduction du titre
{{ item.transcrip_trad }}
{% endif %} -
Collection
{{ item.collection.title }}
- {% if item.duree %}
Durée
{{ item.duree }}
{% endif %} - {% if item.collection.ispublished and item.Ref %} -
Ref
{{ item.Ref }}
+ {% dl_field item "collection" %} + {% dl_field item "title" %} + {% dl_field item "alt_title" %} + {% dl_field item "collector" %} + {% if item.collection.title %} +
{% trans "Collection title" %}
+
{{ item.collection.title }}
+ {% endif %} + {% if item.recorded_from_date %} +
{% trans "Recording date" %}
+
{{ item.recorded_from_date }} {{ item.recorded_to_date|prepend:" - " }}
{% endif %}
{% endblock general_info %} @@ -143,85 +146,96 @@ load_player({{ item.get_duration }});
{% block geoethnic_data %}
-

Informations géographiques et ethnographiques

+

{% trans "Geographic and cultural informations" %}

- {% if item.continent %}
Continent
{{ item.continent }}
{% endif %} - {% if item.etat %}
État / Nation
{{ item.etat }}
{% endif %} - {% if item.region_village %}
Région / Village
{{ item.region_village }}
{% endif %} - {% if item.ethnie_grsocial %}
Ethnie/ Groupe social
{{ item.ethnie_grsocial }}
{% endif %} - {% if item.aire_geo_cult %}
Aire culturelle
{{ item.aire_geo_cult }}
{% endif %} - {% if item.fonction_usage or item.comm_fonctusage %} -
Contexte ethnographique
- {% if item.fonction_usage %}
Mots clés
{{ item.fonction_usage }}
{% endif %} - {% if item.comm_fonctusage %}
Commentaires
{{ item.comm_fonctusage }}
{% endif %} - {% endif %} + {% if item.location %} +
{% trans "Location" %}
+
{{ item.location.fullname }}
+ {% endif %} + {% dl_field item "location_comment" %} + {% dl_field item "cultural_area" %} + {% dl_field item "ethnic_group" %} + {% dl_field item "context_comment" %} + {% dl_field item "keywords" join with ", " %}
{% endblock geoethnic_data %}
- {% block musical_performances %} + {% block musical_data %}
-

Formation musicale

+

{% trans "Musical informations" %}

- {% if item.form_genr_style %}
Forme / genre vernaculaire
{{ item.form_genr_style }}
{% endif %} - {% if item.formstyl_generi %}
Forme / genre générique
{{ item.formstyl_generi }}
{% endif %} + {% dl_field item "vernacular_style" %} + {% dl_field item "generic_style" %} + {% dl_field item "author" %}
+ {% if item.performances %}
- - - - + + + + + {% for performance in item.performances.all %} - - - - + + + + + {% endfor %}
NombreNom génériqueNom vernaculaireInterprète {% field_label "MediaItemPerformance" "instruments_num" %}{% field_label "MediaItemPerformance" "instrument" %}{% field_label "MediaItemPerformance" "alias" %}{% field_label "MediaItemPerformance" "musicians" %}
----{{ performance.instruments_num }}{{ performance.instrument|default:"" }}{{ performance.alias|default:"" }}{{ performance.musicians }}
+ {% endif %}
- {% endblock musical_performances %} + {% endblock musical_data %}
- {% block document_identification %} + {% block general_data %}
-

Identification du document

+

{% trans "General informations" %}

- {% if item.format %}
Format
{{ item.format }}
{% endif %} - {% if item.id %}
Cote item
{{ item.id }}
{% endif %} - {% if item.face_plage %}
N° de l'item
{{ item.face_plage }}
{% endif %} + {% dl_field item "comment" %} + {% dl_field item "collector_selection" %}
- {% endblock document_identification %} + {% endblock general_data %}
- {% block document_data %} + {% block archive_data %}
-

Informations documentaires

+

{% trans "Archiving data" %}

- {% if item.choixcollecteur %}
choixcollecteur
{{ item.choixcollecteur }}
{% endif %} - {% if item.copie_de %}
Copie de
{{ item.copie_de }}
{% endif %} - {% if item.enregistre_par %}
Enregistré par
{{ item.enregistre_par }}
{% endif %} - {% if item.file %}
File
{{ item.file }}
{% endif %} - {% if item.get_duration %}
get duration
{{ item.get_duration }}
{% endif %} - {% if item.moda_execut %}
moda execut
{{ item.moda_execut }}
{% endif %} - {% if item.nroband_nropiec %}
nroband nropiec
{{ item.nroband_nropiec }}
{% endif %} - {% if item.remarques %}
Remarques
{{ item.remarques }}
{% endif %} - {% if item.repere_bande %}
Repère bande
{{ item.repere_bande }}
{% endif %} - {% if item.struct_modale %}
Struct modale
{{ item.struct_modale }}
{% endif %} - {% if item.struct_rythm %}
Struct rythm
{{ item.struct_rythm }}
{% endif %} - {% if item.titre_support %}
Titre support
{{ item.titre_support }}
{% endif %} + {% dl_field item "code" %} + {% dl_field item "old_code" %} + {% dl_field item "track" %} + {% dl_field item "creator_reference" %} + {% dl_field item "external_references" %} + {% dl_field item "public_access" %}
- {% endblock document_data %} + {% endblock archive_data %} +
+
+ {% block technical_data %} +
+

{% trans "Technical data" %}

+
+
+
{% trans "Media type" %}
{% trans "Audio" %}
+ {% dl_field item "approx_duration" %} + {% dl_field item "computed_duration" %} +
+
+
+ {% endblock technical_data %}
diff --git a/telemeta/templatetags/telemeta_utils.py b/telemeta/templatetags/telemeta_utils.py index e92cbfdf..86d7bf76 100644 --- a/telemeta/templatetags/telemeta_utils.py +++ b/telemeta/templatetags/telemeta_utils.py @@ -1,6 +1,6 @@ from django import template from django.utils.http import urlquote -from telemeta.models import MediaItem, MediaCollection +from telemeta import models from django.core.urlresolvers import reverse import telemeta.models.dublincore as dc from django.utils import html @@ -84,15 +84,15 @@ def code_or_id(resource): @register.filter def is_item(resource): - return isinstance(resource, MediaItem) + return isinstance(resource, models.MediaItem) @register.filter def is_collection(resource): - return isinstance(resource, MediaCollection) + return isinstance(resource, models.MediaCollection) @register.filter def to_dublincore(resource): - if isinstance(resource, MediaItem): + if isinstance(resource, models.MediaItem): return dc.express_item(resource) else: return dc.express_collection(resource) @@ -161,3 +161,11 @@ def prepend(str, prefix): if str: return prefix + unicode(str) return '' + +@register.simple_tag +def field_label(model, field): + if isinstance(model, basestring): + model = getattr(models, model) + + return capfirst(unicode(model.field_label(field))) +