From 051c405c70022937f7e55948588f6a18beab9fdf Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 4 Aug 2017 23:01:45 +0200 Subject: [PATCH] Select all items in collection (fix #151) --- .../telemeta/js/mediacollection_list.js | 17 +++ .../telemeta/inc/mediaitem_list.html | 132 +++++++++--------- 2 files changed, 83 insertions(+), 66 deletions(-) create mode 100644 telemeta/static/telemeta/js/mediacollection_list.js diff --git a/telemeta/static/telemeta/js/mediacollection_list.js b/telemeta/static/telemeta/js/mediacollection_list.js new file mode 100644 index 00000000..99ffcf66 --- /dev/null +++ b/telemeta/static/telemeta/js/mediacollection_list.js @@ -0,0 +1,17 @@ +/** + * Created by crem on 19/05/16. + */ +$(function () { + $("#selectAll").click(function () { + if (this.checked) { + $(".check1").each(function () { + this.checked = true; + }); + } + else { + $(".check1").each(function () { + this.checked = false; + }); + } + }); +}); diff --git a/telemeta/templates/telemeta/inc/mediaitem_list.html b/telemeta/templates/telemeta/inc/mediaitem_list.html index 93dc3fa4..819af103 100644 --- a/telemeta/templates/telemeta/inc/mediaitem_list.html +++ b/telemeta/templates/telemeta/inc/mediaitem_list.html @@ -4,85 +4,85 @@ {% block extra_javascript %} + {% endblock %} {% if items %} {% if user.is_authenticated %} +
+ {% csrf_token %} + {% endif %} - -{% csrf_token %} + + + + + + + + {% if location_name %} + + {% else %} + + {% endif %} + + + {% if user.is_authenticated %} + + {% endif %} + + + -{% endif %} + {% for item in items %} + + + + + -
{% trans "Title" %}{% trans "Digitized" %}{% trans "Recordist" %}{% trans "Location" %}{% trans "Country/Continent" %}{% trans "Year of recording" %}{% trans "Code" %} select all
+ {% if item.file %} +

d

+ {% endif %} +
+ {{ item }} + + {% if item.file %} +

d

+ {% endif %} +
- - - - - - - {% if location_name %} - - {% else %} - - {% endif %} - - - {% if user.is_authenticated %} - - {% endif %} - - - -{% for item in items %} - - - - - + {% if location_name %} + + {% else %} + {% endif %} - - - {% if location_name %} - - {% else %} - - {% endif %} - - - {% if user.is_authenticated %} - - {% endif %} - -{% endfor %} - -
{% trans "Title" %}{% trans "Digitized" %}{% trans "Recordist" %}{% trans "Location" %}{% trans "Country/Continent" %}{% trans "Year of recording" %}{% trans "Code" %} select all
- {% if item.file %} -

d

- {% endif %} -
- {{ item }} - - {% if item.file %} -

d

+
{{ item.collector }}{{ item.location.name }}{{ item.country_or_continent|default:' ' }}{{ item.collector }}{{ item.location.name }}{{ item.country_or_continent|default:' ' }} - {% if item.recorded_from_date %} - {{ item.recorded_from_date.year }} - {% if item.recorded_to_date and not item.recorded_to_date.year|equals:item.recorded_from_date.year %} - - {{ item.recorded_to_date.year }} + + {% if item.recorded_from_date %} + {{ item.recorded_from_date.year }} + {% if item.recorded_to_date and not item.recorded_to_date.year|equals:item.recorded_from_date.year %} + - {{ item.recorded_to_date.year }} + {% endif %} {% endif %} - {% endif %} - - {{ item.code|default:item.old_code }} -
- - {% if user.is_authenticated %} - - + -
+ + {{ item.code|default:item.old_code }} + + {% if user.is_authenticated %} + {% endif %} + + {% endfor %} + + + + {% if user.is_authenticated %} + + + {% endif %} {% else %}

{% trans "No item" %}

-- 2.39.5