From: Kaltar5679 Date: Tue, 2 Jun 2015 14:31:13 +0000 (+0200) Subject: add accordeon for playlist to make easier for view X-Git-Tag: 1.6a^2~15^2~43 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=77808c7ea76fa637ba265e1631ba3134315addb2;p=telemeta.git add accordeon for playlist to make easier for view --- diff --git a/telemeta/templates/telemeta/lists.html b/telemeta/templates/telemeta/lists.html index df2f3cb0..f5355825 100644 --- a/telemeta/templates/telemeta/lists.html +++ b/telemeta/templates/telemeta/lists.html @@ -2,6 +2,12 @@ {% load telemeta_utils %} {% load i18n %} +{% comment "added by Killian Mary" %}{% endcomment %} +{% block extra_stylesheets %} + +{% endblock %} +{% comment "added by Killian Mary end" %}{% endcomment %} + {% block extra_javascript %} @@ -29,10 +35,29 @@ $(document).ready(function(){ {% endfor %} }); -{% comment "added by Killian Mary end" %}{% endcomment %} + + + + {% endblock %} +{% comment "added by Killian Mary end" %}{% endcomment %} + {% block content %}
@@ -65,80 +90,86 @@ $(document).ready(function(){ +
+ {% for playlist in playlists %} - - - - - - {% if playlist.playlist.description %} - - - - {% endif %} -
{{ playlist.playlist.title }} - {% trans "Edit" %} - CSV Collections - CSV Items - {% trans "Delete" %} -
{{ playlist.playlist.description }}
- {% comment "added by Killian Mary, for sort table" %}{% endcomment %} - - - - - - - - - - - - - - {% for resource in playlist.resources %} - - - - - - - - - - - {% endfor %} - -
{% trans "Title" %}{% trans "Type" %}{% trans "Code" %}{% trans "Recordist" %}{% trans "Recording period" %}{% trans "Digitized" %}{% trans "Action" %}
- {% if resource.type == "item" and not resource.element == None %} - {{ resource.element }} - {% endif %} - {% if resource.type == "collection" and not resource.element == None %} - {% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %} - {% endif %} - {% if resource.type == "marker" and not resource.element == None %} - {{ resource.element }} - {% endif %} - {% if resource.type == "corpus" or resource.type == "fonds" %} - {{ resource.element.title }} - {% endif %} - {% if resource.element == None %}{% trans "deleted" %}{% endif %} - {{ resource.type }} - {{ resource.element.public_id }} - {{ resource.element.apparent_collector }} - {% if resource.element.recorded_from_date %} - {{ resource.element.recorded_from_date.year }} - {% if resource.element.recorded_to_date and not resource.element.recorded_to_date.year|equals:resource.element.recorded_from_date.year %} - - {{ resource.element.recorded_to_date.year }} - {% endif %} - {% endif %} - - {% if resource.element.file or resource.element.has_mediafile %} -

d

- {% endif %} -
- -
+ +
{{ playlist.playlist.title }}
+
+ + + + + + {% if playlist.playlist.description %} + + + + {% endif %} +
{{ playlist.playlist.title }} + {% trans "Edit" %} + CSV Collections + CSV Items + {% trans "Delete" %} +
{{ playlist.playlist.description }}
+ {% comment "added by Killian Mary, for sort table" %}{% endcomment %} + + + + + + + + + + + + + + {% for resource in playlist.resources %} + + + + + + + + + + + {% endfor %} + +
{% trans "Title" %}{% trans "Type" %}{% trans "Code" %}{% trans "Recordist" %}{% trans "Recording period" %}{% trans "Digitized" %}{% trans "Action" %}
+ {% if resource.type == "item" and not resource.element == None %} + {{ resource.element }} + {% endif %} + {% if resource.type == "collection" and not resource.element == None %} + {% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %} + {% endif %} + {% if resource.type == "marker" and not resource.element == None %} + {{ resource.element }} + {% endif %} + {% if resource.type == "corpus" or resource.type == "fonds" %} + {{ resource.element.title }} + {% endif %} + {% if resource.element == None %}{% trans "deleted" %}{% endif %} + {{ resource.type }} + {{ resource.element.public_id }} + {{ resource.element.apparent_collector }} + {% if resource.element.recorded_from_date %} + {{ resource.element.recorded_from_date.year }} + {% if resource.element.recorded_to_date and not resource.element.recorded_to_date.year|equals:resource.element.recorded_from_date.year %} + - {{ resource.element.recorded_to_date.year }} + {% endif %} + {% endif %} + + {% if resource.element.file or resource.element.has_mediafile %} +

d

+ {% endif %} +
+ +
+
{% endfor %}
{% endblock %} diff --git a/telemeta/views/core.py b/telemeta/views/core.py index 61cad537..c7ed919a 100644 --- a/telemeta/views/core.py +++ b/telemeta/views/core.py @@ -227,7 +227,7 @@ def get_playlists(request, user=None): element = None resources.append({'element': element, 'type': resource.resource_type, 'public_id': resource.public_id }) playlists.append({'playlist': playlist, 'resources': resources}) - #add by Killian Mary for sort list by title + #add by Killian Mary for sort playlist by title playlists.sort(key=lambda x: x['playlist'].title) return playlists