1 {% extends "base.html" %}
5 <h2>Nonstop - {{ view.page_title }}</h2>
8 {% block more-user-links %}
10 <a href="{% url 'nonstop-quick-links' %}">Gestion nonstop</a>
16 <table id="edit-metadata">
18 <tr><th>{% trans "Title" %}</th><th>{% trans "Artist" %}</th>
19 <th class="en">EN</th><th class="fr">FR</th><th class="nl">NL</th><th class="other">Other</th><th class="na">n.a.</th>
20 <th class="instru">Instru</th><th class="sabam">Sabam</th><th class="cfwb">CFWB</th></tr>
23 {% for track in object_list %}
25 <td><input type="hidden" name="track" value="{{track.id}}">
26 <a href="{% url 'track-view' pk=track.id %}">{{track.title}}</a></td><td>{{track.artist.name|default:"-"}}</td>
27 <td class="en"><input type="radio" name="lang-{{track.id}}" value="en" {% if track.language == "en" %}checked{% endif %}></td>
28 <td class="fr"><input type="radio" name="lang-{{track.id}}" value="fr" {% if track.language == "fr" %}checked{% endif %}></td>
29 <td class="nl"><input type="radio" name="lang-{{track.id}}" value="nl" {% if track.language == "nl" %}checked{% endif %}></td>
30 <td class="other"><input type="radio" name="lang-{{track.id}}" value="other" {% if track.language == "other" %}checked{% endif %}></td>
31 <td class="na"><input type="radio" name="lang-{{track.id}}" value="na" {% if track.language == "na" %}checked{% endif %}></td>
32 <td class="instru"><input type="checkbox" name="instru-{{track.id}}" {% if track.instru %}checked{% endif %}></td>
33 <td class="sabam"><input type="checkbox" name="sabam-{{track.id}}" {% if track.sabam %}checked{% endif %}></td>
34 <td class="cfwb"><input type="checkbox" name="cfwb-{{track.id}}" {% if track.cfwb %}checked{% endif %}></td>
41 <button class="submit-button">{% trans "Save" %}</button>
46 $('table#edit-metadata th').on('click', function() {
48 if ($(this)[0].className == 'sabam') propvalue = false;
49 $('tbody').find('.' + $(this)[0].className + ' input').prop('checked', propvalue);
52 $('input[type=radio][name^=lang-]').on('change', function() {
53 var $instru = $(this).parents('tr').find('input[type=checkbox][name^=instru]');
54 if (($(this).val() == 'na' && ! $instru.is(':checked')) ||
55 ($(this).val() != 'na' && $instru.is(':checked'))) {
56 $instru.trigger('click');
60 $('input[type=checkbox][name^=instru]').on('change', function() {
61 if ($(this).is(':checked')) {
62 $(this).parents('tr').find('input[name^=lang][value=na]').trigger('click');
64 $(this).parents('tr').find('input[name^=lang]').prop('checked', false);