From aa1889e62a8d0b8da1bcfb135d414c6ae9800308 Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 18 Sep 2012 01:48:26 +0200 Subject: [PATCH] fix some fields, begin field filtering --- telemeta/forms/media.py | 4 ++++ telemeta/templates/telemeta/mediaitem_detail.html | 4 ++-- telemeta/templates/telemeta/mediaitem_edit.html | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/telemeta/forms/media.py b/telemeta/forms/media.py index c222eaeb..932c88f2 100644 --- a/telemeta/forms/media.py +++ b/telemeta/forms/media.py @@ -69,6 +69,10 @@ class MediaCollectionRelatedForm(ModelForm): class MediaItemForm(ModelForm): class Meta: model = MediaItem + fields = ('title', 'recorded_from_date', 'recorded_to_date', 'collector', + 'collection', 'summary', 'scientist', 'contributor', 'author', + 'topic', 'comment', 'public_access') + def clean_code(self): return self.cleaned_data['code'] or None diff --git a/telemeta/templates/telemeta/mediaitem_detail.html b/telemeta/templates/telemeta/mediaitem_detail.html index aeae1a07..638815bb 100644 --- a/telemeta/templates/telemeta/mediaitem_detail.html +++ b/telemeta/templates/telemeta/mediaitem_detail.html @@ -221,7 +221,7 @@ Item : {{ item }} {% endif %} {% dl_field item "author" %} - {% dl_field item "subject" %} + {% dl_field item "topic" %}
{% trans "Remarks" %}
{{ item.comment|html_line_break|safe }}
@@ -245,7 +245,7 @@ Item : {{ item }}
{% trans "Organization" %}
{% organization %}
- {% dl_field item "public_access_label" %} + {% dl_field item "public_access" %} {% dl_field item "depositor" %}
{% trans "Rights" %}
{% if item.performances %} diff --git a/telemeta/templates/telemeta/mediaitem_edit.html b/telemeta/templates/telemeta/mediaitem_edit.html index e22224aa..09ef8073 100644 --- a/telemeta/templates/telemeta/mediaitem_edit.html +++ b/telemeta/templates/telemeta/mediaitem_edit.html @@ -24,7 +24,12 @@ {{ field.label_tag.as_hidden }}{{ field.as_hidden }} {% else %} {{ field.errors }} - {{ field.label_tag }}: + {% if field.required %} + {{ field.label_tag }}: + {% else %} + {{ field.label_tag }}: + {% endif %} + {% if field.html_name == "collection" %}  {% trans "Title" %} : {{ item.collection.title }}
 {% trans "Code" %} : {{ item.collection.code }}
-- 2.39.5