]> git.parisson.com Git - telemeta.git/commitdiff
display doctype_code if not null or 0
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Dec 2013 19:22:39 +0000 (20:22 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Dec 2013 19:22:39 +0000 (20:22 +0100)
telemeta/models/media.py
telemeta/templates/telemeta/collection_detail.html
telemeta/templates/telemeta/collection_edit.html

index 0d9740c988e4502af45fffd575bf13f4a4172537..811d60beb1d4e87f56f977b874661188f71a63cb 100644 (file)
@@ -209,7 +209,7 @@ class MediaCollection(MediaResource):
     publisher_serial      = CharField(_('publisher serial number'))
     booklet_author        = CharField(_('author of published notice'))
     external_references   = TextField(_('bibliographic references'))
-    doctype_code          = IntegerField(_('document type'))
+    doctype_code          = IntegerField(_('document type'), null=True, blank=True)
     public_access         = CharField(_('public access'), choices=PUBLIC_ACCESS_CHOICES,
                                       max_length=16, default="metadata")
     legal_rights          = WeakForeignKey('LegalRight', related_name="collections",
index 5f6aee152808825c03b38b237af83ace9615f911..740d57a160890928ba4217f444002fee0372a118 100644 (file)
                         {% dl_field collection "booklet_author" %}
                         <dt>{% trans "Bibliographic references" %}</dt>
                         <dd>{{ collection.external_references|html_line_break|safe }}</dd>
-                        {% dl_field collection "doctype_code" %}
+                        {% if collection.doctype_code %}
+                         {% dl_field collection "doctype_code" %}
+                        {% endif %}
                         {% dl_field collection "public_access_label" %}
                         {% dl_field collection "legal_rights" %}
                     </dl>
index 7d3ec6bdeb769963d6c349f35652164185a59e8b..af931f6d558feb67686eb47ad8d5f964fcc7c4f3 100644 (file)
@@ -18,7 +18,7 @@
        <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
        {% for field in form %}
        <tr>
-        {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
+        {% if field.html_name == "copied_from_item" %}
             <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
         {% else %}
             <tr><td class="error">{{ field.errors }}</td></tr>