]> git.parisson.com Git - telemeta.git/commitdiff
add empty some fields to detail templates, fix collections qs
authoryomguy <yomguy@parisson.com>
Wed, 4 May 2011 15:13:09 +0000 (17:13 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 4 May 2011 15:13:09 +0000 (17:13 +0200)
telemeta/models/__init__.py
telemeta/models/query.py
telemeta/templates/telemeta_default/collection_detail.html
telemeta/templates/telemeta_default/collection_list.html
telemeta/templates/telemeta_default/mediaitem_detail.html
telemeta/urls.py

index 72aa524c4b4a53dcd0dd6cc8722e4bc4b75f9edd..9bec6cce797c00c8efcf6ec637263535253da5d4 100644 (file)
@@ -37,5 +37,6 @@ from telemeta.models.location import *
 from telemeta.models.instrument import *
 from telemeta.models.enum import *
 from telemeta.models.system import *
+from telemeta.models.query import *
 
 
index 624bbcdac5c60726ece40d931c419d73b6cf31f5..0324abfff26f09dbfd55578bf273feeb3bd713db 100644 (file)
@@ -190,7 +190,8 @@ class MediaItemQuerySet(CoreQuerySet):
 
     def by_fuzzy_collector(self, pattern):
         return self.filter(self.by_fuzzy_collector_q(pattern))
-
+    
+        
 class MediaItemManager(CoreManager):
     "Manage media items queries"
 
@@ -230,6 +231,7 @@ class MediaItemManager(CoreManager):
         return self.get_query_set().by_location(*args, **kwargs)
     by_location.__doc__ = MediaItemQuerySet.by_location.__doc__    
 
+
 class MediaCollectionQuerySet(CoreQuerySet):
 
     def quick_search(self, pattern):
@@ -312,6 +314,7 @@ class MediaCollectionQuerySet(CoreQuerySet):
     def by_fuzzy_collector(self, pattern):
         return self.filter(self.by_fuzzy_collector_q(pattern))
 
+
 class MediaCollectionManager(CoreManager):
     "Manage collection queries"
 
@@ -346,7 +349,7 @@ class MediaCollectionManager(CoreManager):
     def by_change_time(self, *args, **kwargs):
         return self.get_query_set().by_change_time(*args, **kwargs)
     by_change_time.__doc__ = MediaCollectionQuerySet.by_change_time.__doc__
-
+    
     @staticmethod
     def __name_cmp(obj1, obj2):
         return unaccent_icmp(obj1.name, obj2.name)
index 57511ae0158b36dc2e1894082784be4dd9ca328a..745db2a111aea14f58c7f5eb88b71952b272baa1 100644 (file)
                 {% dl_field collection "reference" %}
                 {% dl_field collection "title"  %}
                 {% dl_field collection "alt_title" %}
-                {% dl_field collection "creator"  %}
+                {% dl_field collection "creator" placeholder %}
                 {% dl_field collection "recording_context" %}
-                {% if collection.recorded_from_year %}
-                    <dt>{% trans "Recording year" %}</dt>
-                    <dd>{{ collection.recorded_from_year|default:'' }} {{ collection.recorded_to_year|prepend:" - "  }}</dd>
-                {% endif %}
-                {% dl_field collection "year_published"  %}
+                <dt>{% trans "Recording year" %}</dt>
+                    <dd>{% if collection.recorded_from_year %}{{ collection.recorded_from_year|default:'' }} {{ collection.recorded_to_year|prepend:" - "  }}{% endif %}</dd>
+                {% dl_field collection "year_published" placeholder %}
             </dl>
         {% endblock general_info %}
         </div>
                 <div>
                     <dl class="listing">
                         {% dl_field collection "countries" join with ", " %}
-                        {% dl_field collection "ethnic_groups" join with ", "  %}
+                        {% dl_field collection "ethnic_groups" join with ", " placeholder %}
                     </dl>
                 </div>
             </div>
index 3d3005fe135998c8490d7e636037fb24ccf87a86..f570a2d8c03adcbc303d0a2b4c9c19276888bf13 100644 (file)
@@ -8,7 +8,7 @@
  <h1>{% trans "Media Collections" %}</h1>
 {% endblock %}
 {% block title_buttons %}
-     <a href="{% url telemeta-collections %}" class="component_icon button icon_search">{% trans "All" %}</a>
+     <a href="{% url telemeta-collections %}" class="component_icon button icon_filter">{% trans "All" %}</a>
      <a href="{% url telemeta-collections-unpublished %}" class="component_icon button icon_filter">{% trans "Unpublished" %}</a>
      <a href="{% url telemeta-collections-published %}" class="component_icon button icon_filter">{% trans "Published" %}</a>
     {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
index 8621a39a08ca9ab23e3e48e6d462d0fe08edcb05..93e3ec3753aa3a0eaf989b4bf582bb27697e1a3d 100644 (file)
     <div class="infos">
         {% block general_info %}
         <dl class="listing">
-            {% dl_field item "title" %}
+            {% dl_field item "title" placeholder %}
             {% dl_field item "alt_title" %}
-            {% dl_field item "collector" %}
+            {% dl_field item "collector" placeholder %}
             <dt>{% field_label item "collection" %}</dt>
             <dd><a href="{% url telemeta-collection-detail item.collection.public_id %}">{{ item.collection }}</a></dd>
-            {% if item.recorded_from_date %}
             <dt>{% trans "Recording date" %}</dt>
-            <dd>{{ item.recorded_from_date }} {{ item.recorded_to_date|prepend:" - "  }}</dd>
-            {% endif %}
+            
+            <dd>{% if item.recorded_from_date %}{{ item.recorded_from_date }} {{ item.recorded_to_date|prepend:" - "  }}{% endif %}</dd>
+            
         </dl>
         {% endblock general_info %}
     </div>
         <div>
             <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4>
             <dl class="listing">
-                {% if item.location %}
                 <dt>{% trans "Location" %}</dt>
-                <dd>{{ item.location.fullnames|join:"<br/>" }}</dd>
-                {% endif %}
+                <dd>{% if item.location %}{{ item.location.fullnames|join:"<br/>" }}{% endif %}</dd>
                 {% dl_field item "location_comment" %}
                 {% dl_field item "cultural_area" %}
-                {% dl_field item "ethnic_group" %}
+                {% dl_field item "ethnic_group" placeholder %}
                 {% dl_field item "context_comment" %}
                 {% dl_field item "keywords" join with ", " %}
             </dl>
index 128df0d846500a6fb3ac432e5e207ebba2da1519..3eba1216c699b27b6e7e6fa100e1d87e39bea6af 100644 (file)
@@ -51,9 +51,10 @@ all_items = { 'queryset': MediaItem.objects.enriched(), }
 all_collections = { 'queryset': MediaCollection.objects.enriched(), }
 
 # CREM collections
-all_collections_novel = { 'queryset': MediaCollection.objects.filter(code__contains='_I_'), }
+all_collections_unpublished = { 'queryset': MediaCollection.objects.filter(code__contains='_I_'), }
 all_collections_published = { 'queryset': MediaCollection.objects.filter(code__contains='_E_'), }
 
+
 # ID's regular expressions
 export_extensions = "|".join(web_view.list_export_extensions())
 
@@ -104,7 +105,7 @@ urlpatterns = patterns('',
     url(r'^collections/$', 'django.views.generic.list_detail.object_list',
         dict(all_collections, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections"),
     url(r'^collections_unpublished/$', 'django.views.generic.list_detail.object_list',
-        dict(all_collections_novel, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-unpublished"),
+        dict(all_collections_unpublished, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-unpublished"),
     url(r'^collections_published/$', 'django.views.generic.list_detail.object_list',
         dict(all_collections_published, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-published"),
     url(r'^collections/?page=(?P<page>[0-9]+)$',