Commit 39750e91 authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Add chamber icons on dossier list

parent 75d85817
......@@ -101,6 +101,15 @@ def chamber_icon(chamber):
abbr=cssify(chamber.abbreviation)))
@register.filter
def chamber_small_icon(chamber):
return mark_safe(
u'<span class="chamber-icon ' +
u'chamber-icon-{abbr}" title="{name}"></span>'.format(
name=chamber.name,
abbr=cssify(chamber.abbreviation)))
@register.filter
def mandate_icon(main_mandate):
return mark_safe(
......
......@@ -15,7 +15,9 @@ class DossierList(PaginationMixin, generic.ListView):
current_filter = None
queryset = Dossier.objects.prefetch_related(
'proposals',
'proposals__recommendation'
'proposals__recommendation',
'documents',
'documents__chamber'
).annotate(
nb_proposals=Count('proposals'),
nb_recomm=Count('proposals__recommendation')
......
- extends "base.html"
- load i18n
- load memopol_tags
- block head
......@@ -25,6 +26,8 @@
%table.table
%tr
%th
- trans "Chambers"
%th
- trans "Title"
%th
......@@ -36,6 +39,9 @@
- for dossier in object_list
%tr
%td
- for chamber in dossier.chambers
= chamber | chamber_small_icon
%td
%a{'href': "{% url 'dossier-detail' dossier.pk %}"}
{{ dossier.title }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment