Skip to content
Extraits de code Groupes Projets
Valider b2747903 rédigé par Nicolas Joyard's avatar Nicolas Joyard
Parcourir les fichiers

Add no results message and test

parent f02e9913
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -122,3 +122,6 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
def test_filter_multiple(self):
self.filter_test('e', 110, 1, 17)
def test_filter_notfound(self):
self.filter_test('non-existing-rep-name')
......@@ -59,4 +59,12 @@
}
}
}
}
.no-results {
margin-top: 1em;
font-size: larger;
font-weight: bold;
color: #555;
margin: 2em 0;
}
\ No newline at end of file
......@@ -15,47 +15,53 @@
{% url 'representative-list' as action_url %}
- include 'representatives/_filter_form.html' with action=action_url form=filter.form qs=request.GET.urlencode
- include 'core/blocks/pagination.html'
- block list
%table.table
%tr
%th
- trans 'Photo'
%th
- trans 'Name'
%th
- trans 'Chamber'
%th
- trans 'Country'
%th
- trans 'Group'
%th
- trans 'Score'
- for representative in object_list
%tr.representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'}
%td.photo
%a{'href': "{% url 'representative-detail' representative.slug %}"}
%img{'src': '={representative.photo}', 'width': '80'}/
%td
%a{'href': "{% url 'representative-detail' representative.slug %}"}
= representative.full_name
%td
%a{'href': "{% chamber_url representative.chamber %}"}
= representative.chamber
%td
%a{'href': "{% country_url representative.country %}"}
= representative.country
%td
%a{'href': "{% group_url representative.main_mandate.group %}"}
= representative.main_mandate.group|group_icon
%td
= representative.score.score|score_label
- include 'core/blocks/pagination.html'
- if object_list|length == 0
.no-results="No matching representatives found :("
- else
- include 'core/blocks/pagination.html'
- block list
%table.table
%tr
%th
- trans 'Photo'
%th
- trans 'Name'
%th
- trans 'Chamber'
%th
- trans 'Country'
%th
- trans 'Group'
%th
- trans 'Score'
- for representative in object_list
%tr.representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'}
%td.photo
%a{'href': "{% url 'representative-detail' representative.slug %}"}
%img{'src': '={representative.photo}', 'width': '80'}/
%td
%a{'href': "{% url 'representative-detail' representative.slug %}"}
= representative.full_name
%td
%a{'href': "{% chamber_url representative.chamber %}"}
= representative.chamber
%td
%a{'href': "{% country_url representative.country %}"}
= representative.country
%td
%a{'href': "{% group_url representative.main_mandate.group %}"}
= representative.main_mandate.group|group_icon
%td
= representative.score.score|score_label
- include 'core/blocks/pagination.html'
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter