]> git.parisson.com Git - telemeta.git/commitdiff
- fix MediaItem.comment label (remarks)
authorolivier <>
Mon, 8 Mar 2010 17:39:22 +0000 (17:39 +0000)
committerolivier <>
Mon, 8 Mar 2010 17:39:22 +0000 (17:39 +0000)
- fix MediaItem.author label (author / compositor)
- prepare for displaying certain fields even if empty
- display missing collection reference
- display missing collection recording_context
- display missing collection metadata_author
- do not display redundant metadata_writer
- workaround a layout problem with long field names
- fix recordist label
- fix MediaCollection.items_done label

telemeta/locale/fr/LC_MESSAGES/django.mo
telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/models/media.py
telemeta/templates/telemeta_default/collection_detail.html
telemeta/templatetags/telemeta_utils.py

index 667dc756221197bfc1a0450812ad6aaa261c29d5..cad407b5613976b99b3b78f4a4cd39849a843567 100644 (file)
Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ
index b8fe4d2cd447e46e22647521018924cd9f9908da..0833e065cf19f2476cc6f081be723f090b52d5a1 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-16 22:25+0100\n"
+"POT-Creation-Date: 2010-03-08 18:30+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Olivier Guilyardi <olivier samalyse com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -85,7 +85,7 @@ msgid "population / social group"
 msgstr "population / groupe social"
 
 #: models/enum.py:157 models/instrument.py:41 models/instrument.py:51
-#: models/location.py:50 models/location.py:142 models/media.py:348
+#: models/location.py:50 models/location.py:148 models/media.py:348
 msgid "name"
 msgstr "nom"
 
@@ -97,7 +97,7 @@ msgstr "instrument"
 msgid "parent instrument"
 msgstr "instrument parent"
 
-#: models/instrument.py:73 models/location.py:150
+#: models/instrument.py:73 models/location.py:156
 msgid "alias"
 msgstr "alias"
 
@@ -125,20 +125,20 @@ msgstr "type complet"
 msgid "current location"
 msgstr "lieu actuel"
 
-#: models/location.py:57 models/location.py:151 models/location.py:165
+#: models/location.py:57 models/location.py:157 models/location.py:171
 msgid "authoritative"
 msgstr "officiel"
 
-#: models/location.py:105 models/location.py:149 models/location.py:162
+#: models/location.py:111 models/location.py:155 models/location.py:168
 #: models/media.py:223
 msgid "location"
 msgstr "lieu"
 
-#: models/location.py:141
+#: models/location.py:147
 msgid "identifier"
 msgstr "identifiant"
 
-#: models/location.py:163
+#: models/location.py:169
 msgid "ancestor location"
 msgstr "lieu ancêtre"
 
@@ -196,7 +196,7 @@ msgstr "documentation associée"
 
 #: models/media.py:90 models/media.py:236
 msgid "recordist"
-msgstr "enregistré par"
+msgstr "collecteur"
 
 #: models/media.py:91
 msgid "recordist identical to depositor"
@@ -222,7 +222,7 @@ msgstr "numéro dans la série"
 msgid "bibliographic references"
 msgstr "références bibliographiques"
 
-#: models/media.py:102 models/media.py:243
+#: models/media.py:102
 msgid "comment"
 msgstr "commentaire"
 
@@ -260,7 +260,7 @@ msgstr "déposant CNRS"
 
 #: models/media.py:119
 msgid "items finished"
-msgstr "fiches faîtes"
+msgstr "fiches items faîtes"
 
 #: models/media.py:120
 msgid "a_informer_07_03"
@@ -299,8 +299,8 @@ msgid "location details"
 msgstr "précisions lieu"
 
 #: models/media.py:229
-msgid "author"
-msgstr "auteur"
+msgid "author / compositor"
+msgstr "auteur / compositeur"
 
 #: models/media.py:232
 msgid "comments"
@@ -330,6 +330,10 @@ msgstr "aire culturelle"
 msgid "recordist selection"
 msgstr "sélection collecteur"
 
+#: models/media.py:243
+msgid "remarks"
+msgstr "remarques"
+
 #: models/media.py:244
 msgid "file"
 msgstr "fichier"
@@ -464,7 +468,7 @@ msgstr "Visitez le projet libre Telemeta"
 msgid "Collection"
 msgstr "Collection"
 
-#: templates/telemeta_default/collection_detail.html:51
+#: templates/telemeta_default/collection_detail.html:52
 msgid "Recording year"
 msgstr "Année d'enregistrement"
 
@@ -481,7 +485,7 @@ msgstr "Mentions légales"
 #: templates/telemeta_default/inc/collection_list.html:17
 #: templates/telemeta_default/inc/mediaitem_list.html:16
 msgid "Recordist"
-msgstr "Enregistré par"
+msgstr "Collecteur"
 
 #: templates/telemeta_default/collection_detail.html:100
 #: templates/telemeta_default/mediaitem_detail.html:211
@@ -503,7 +507,7 @@ msgstr "Type de media"
 msgid "Audio"
 msgstr "Audio"
 
-#: templates/telemeta_default/collection_detail.html:132
+#: templates/telemeta_default/collection_detail.html:133
 #: templates/telemeta_default/geo_countries.html:14
 msgid "Number of items"
 msgstr "Nombre d'items"
@@ -603,12 +607,14 @@ msgid "Number of collections"
 msgstr "Nombre de collections"
 
 #: templates/telemeta_default/geo_countries.html:22
+#, python-format
 msgid "1 collection"
 msgid_plural "%(counter)s collections"
 msgstr[0] "1 collection"
 msgstr[1] "%(counter)s collections"
 
 #: templates/telemeta_default/geo_countries.html:29
+#, python-format
 msgid "1 item"
 msgid_plural "%(counter)s items "
 msgstr[0] "1 item"
@@ -724,14 +730,14 @@ msgstr "Etat/Continent"
 msgid "No item"
 msgstr "Aucun item"
 
-#: templatetags/telemeta_utils.py:204
+#: templatetags/telemeta_utils.py:218
 #, python-format
 msgid "%(count)d item"
 msgid_plural "%(count)d items"
 msgstr[0] "%(count)d item"
 msgstr[1] "%(count)d items"
 
-#: templatetags/telemeta_utils.py:207
+#: templatetags/telemeta_utils.py:221
 #, python-format
 msgid "%(count)d collection"
 msgid_plural "%(count)d collections"
index d7c34a52e5016322465ad19c5bd7170f5f070cfd..a86f87827a5dd712d75b0e4f6f8eb9533670e51e 100644 (file)
@@ -226,7 +226,7 @@ class MediaItem(MediaResource):
                                            verbose_name=_('population / social group'))
     title                 = CharField(_('title'))
     alt_title             = CharField(_('original title / translation'))
-    author                = CharField(_('author'))
+    author                = CharField(_('author / compositor'))
     vernacular_style      = WeakForeignKey('VernacularStyle', related_name="items", 
                                            verbose_name=_('vernacular style'))
     context_comment       = TextField(_('comments'))
@@ -240,7 +240,7 @@ class MediaItem(MediaResource):
                                            verbose_name=_('generic style'))
     collector_selection   = CharField(_('recordist selection'))
     creator_reference     = CharField(_('reference'))
-    comment               = TextField(_('comment'))
+    comment               = TextField(_('remarks'))
     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")
 
index 35b9bd4b40f3c2c37f4a1f14f44f3accd131c028..cf87ccdfeaceafa39887adfe7afb178f57a3bc6f 100644 (file)
         <div class="infos">\r
         {% block general_info %}\r
             <dl class="listing">\r
-                {% dl_field collection "title" %}\r
+                {% dl_field collection "reference" %}\r
+                {% dl_field collection "title"  %}\r
                 {% dl_field collection "alt_title" %}\r
-                {% dl_field collection "creator" %}\r
+                {% dl_field collection "creator"  %}\r
+                {% dl_field collection "recording_context" %}\r
                 {% if collection.recorded_from_year %}\r
-                <dt>{% trans "Recording year" %}</dt>\r
-                <dd>{{ collection.recorded_from_year }} {{ collection.recorded_to_year|prepend:" - "  }}</dd>\r
+                    <dt>{% trans "Recording year" %}</dt>\r
+                    <dd>{{ collection.recorded_from_year|default:'' }} {{ collection.recorded_to_year|prepend:" - "  }}</dd>\r
                 {% endif %}\r
-                {% dl_field collection "year_published" %}\r
+                {% dl_field collection "year_published"  %}\r
             </dl>\r
         {% endblock general_info %}\r
         </div>\r
@@ -62,7 +64,7 @@
                 <div>\r
                     <dl class="listing">\r
                         {% dl_field collection "countries" join with ", " %}\r
-                        {% dl_field collection "ethnic_groups" join with ", " %}\r
+                        {% dl_field collection "ethnic_groups" join with ", "  %}\r
                     </dl>\r
                 </div>\r
             </div>\r
                     <dl class="listing">\r
                         {% dl_field collection "acquisition_mode" %}\r
                         {% dl_field collection "cnrs_contributor" %}\r
-                        {% dl_field collection "metadata_writer" %}\r
+                        {% dl_field collection "metadata_author" %}\r
                         {% dl_field collection "booklet_description" %}\r
                         {% dl_field collection "publishing_status" %}\r
                         <!-- FIXME: alt_ids unsupported\r
                         {% dl_field collection "approx_duration" %}\r
                         {% dl_field collection "computed_duration" %}\r
                         {% dl_field collection "physical_items_num" %}\r
+                        <div class="wazing"></div>\r
                         <dt>{% trans "Number of items" %}</dt><dd>{{ collection.items.count }}</dd>\r
                         {% dl_field collection "physical_format" %}\r
                         {% dl_field collection "ad_conversion" %}\r
index 75876685ca2e525d12b6f629e9aa6a4db586b6be..512470619daf6099562a933ec10ef126d67e420f 100644 (file)
@@ -108,10 +108,11 @@ def to_dublincore(resource):
         return dc.express_collection(resource)
 
 class DescriptionListFieldNode(template.Node):
-    def __init__(self, model, attr, join_with = None):
+    def __init__(self, model, attr, join_with = None, show_empty = False):
         self.model  = model
         self.member = attr
         self.join_with = join_with
+        self.show_empty = show_empty
 
     def render(self, context):
         try:
@@ -135,7 +136,9 @@ class DescriptionListFieldNode(template.Node):
             pass
         if self.join_with:
             value = self.join_with.join([unicode(v) for v in value])
-        if value:
+        if not value:
+            value = ''
+        if value or self.show_empty:
             value = html.escape(unicode(value))
             markup  = '<dt>%s</dt><dd>%s</dd>' % (label, value)
             return markup
@@ -146,25 +149,36 @@ class DescriptionListFieldNode(template.Node):
 def dl_field(parser, token):
     cut = token.split_contents()
     join_with = None
-    try:
+    show_empty = False
+    if len(cut) == 3:
         tag_name, model, attr = cut
-    except ValueError:
-        try:
-            tag_name, model, attr, arg3, arg4, arg5  = cut
-            if arg3 == 'join' and arg4 == 'with'and arg5[0] == arg5[-1] and arg5[0] in ('"', "'"):
-                join_with = arg5[1:-1]
+    elif len(cut) == 4:
+        tag_name, model, attr, arg3 = cut
+        if arg3 == 'placeholder':
+            show_empty = True
+        else:
+            raise ValueError()
+    elif len(cut) >= 6:
+        tag_name, model, attr, arg3, arg4, arg5  = cut[0:6]
+        if arg3 == 'join' and arg4 == 'with'and arg5[0] == arg5[-1] and arg5[0] in ('"', "'"):
+            join_with = arg5[1:-1]
+        else:
+            raise ValueError()
+        if len(cut) > 6:
+            if cut[6] == 'placeholder':
+                show_empty = True
             else:
-                raise ValueError()
-        except ValueError:
-            raise template.TemplateSyntaxError("%r tag: invalid arguments" 
-                                               % token.contents.split()[0])
+                raise ValueError();
+    else:                
+        raise template.TemplateSyntaxError("%r tag: invalid arguments" 
+                                           % token.contents.split()[0])
 
     if attr[0] == attr[-1] and attr[0] in ('"', "'"):
         attr = attr[1:-1]
     else:
         attr = template.Variable(attr)
     model = template.Variable(model)
-    return DescriptionListFieldNode(model, attr, join_with=join_with)
+    return DescriptionListFieldNode(model, attr, join_with=join_with, show_empty=show_empty)
 
 @register.filter
 def prepend(str, prefix):