]> git.parisson.com Git - telemeta.git/commitdiff
add some metadata to musical selections
authoryomguy <yomguy@parisson.com>
Wed, 26 Oct 2011 16:00:01 +0000 (18:00 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 26 Oct 2011 16:00:01 +0000 (18:00 +0200)
telemeta/templates/telemeta_default/index.html
telemeta/templates/telemeta_default/mediaitem_list.html
telemeta/templatetags/telemeta_utils.py
telemeta/urls.py

index 9416c5d6b61ca50e8dac9d8da74c02484725b229..cf2e037f914fae5ed3d64da70cf3488772b428e5 100644 (file)
 <div style="margin-top: 1ex;">
 <h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" />
     {% trans "Musical selection" %}</h1>
-<table><tr>
+<table style="font-size: 90%"><tr>
 {% for item in sound_items %}
-<td><iframe width='375' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{item.public_id }}/player/362x130/'></iframe></td>
+<td width="390"><a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>{% if item.alt_title %} ({{ item.alt_title }}){% endif %}<br /><span style="font-size: 90%">{{ item.location.fullnames|to_string }}</span><br />
+<iframe width='375' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{item.public_id }}/player/362x130/'></iframe></td>
 {% endfor %}
 </tr>
 </table>
index 237c2af78314f566e00979591fd5d5b0d5dded4b..d6486c62aa6c55f8bd22cae66051856f9ebf639a 100644 (file)
@@ -9,6 +9,8 @@
 {% endblock %}
 
 {% block title_buttons %}
+    <a href="{% url telemeta-items %}" class="component_icon button icon_filter">{% trans "All" %}</a>
+    <a href="{% url telemeta-items-sound %}" class="component_icon button icon_filter">{% trans "Sound" %}</a>
     {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
       <a href="{% url telemeta-item-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
     {% endif %}
index b1fbf716a579d0a4d502e04931f8d5a7c244b4f8..d344e2125f80ad94444289f09663daab44e14d2e 100644 (file)
@@ -312,3 +312,7 @@ def html_line_break(text):
 @register.simple_tag
 def profile(user):
     return user.get_profile()
+
+@register.filter
+def to_string(list):
+    return list[0].encode('utf-8')
index 34413871ce79612d375f1048c28302a953773cfe..f37acee337e9c338f81c8e42099a0d26d037c395 100644 (file)
@@ -57,6 +57,7 @@ geo_view = GeoView()
 
 # query sets for Django generic views
 all_items = { 'queryset': MediaItem.objects.enriched().order_by('code', 'old_code') }
+all_sound_items = { 'queryset': MediaItem.objects.sound().order_by('code', 'old_code') }
 all_collections = { 'queryset': MediaCollection.objects.enriched(), }
 
 # CREM collections
@@ -76,6 +77,8 @@ urlpatterns = patterns('',
     url(r'^items/$', 'django.views.generic.list_detail.object_list', 
         dict(all_items, paginate_by=20, template_name="telemeta/mediaitem_list.html"),
         name="telemeta-items"),
+    url(r'^items_sound/$', 'django.views.generic.list_detail.object_list',
+        dict(all_sound_items, paginate_by=20, template_name="telemeta/mediaitem_list.html"), name="telemeta-items-sound"),
     url(r'^items/(?P<public_id>[A-Za-z0-9._-]+)/$', item_view.item_detail, 
         name="telemeta-item-detail"),
     url(r'^items/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', item_view.item_detail,