from telemeta.models.instrument import *
from telemeta.models.enum import *
from telemeta.models.system import *
+from telemeta.models.query import *
def by_fuzzy_collector(self, pattern):
return self.filter(self.by_fuzzy_collector_q(pattern))
-
+
+
class MediaItemManager(CoreManager):
"Manage media items queries"
return self.get_query_set().by_location(*args, **kwargs)
by_location.__doc__ = MediaItemQuerySet.by_location.__doc__
+
class MediaCollectionQuerySet(CoreQuerySet):
def quick_search(self, pattern):
def by_fuzzy_collector(self, pattern):
return self.filter(self.by_fuzzy_collector_q(pattern))
+
class MediaCollectionManager(CoreManager):
"Manage collection queries"
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)
{% 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>
<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 %}
<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>
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())
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]+)$',