diff --git a/memopol/views/dossier_list.py b/memopol/views/dossier_list.py index 48087409ed42aa50a454d981b17ce071f4cd094f..ac3c4470154e8b0b98324efaf34aae9cc5b42319 100644 --- a/memopol/views/dossier_list.py +++ b/memopol/views/dossier_list.py @@ -17,6 +17,7 @@ class DossierList(PaginationMixin, generic.ListView): 'proposals', 'proposals__recommendation' ).annotate( + nb_proposals=Count('proposals'), nb_recomm=Count('proposals__recommendation') ).order_by('-nb_recomm', '-reference') diff --git a/static/scss/table.scss b/static/scss/table.scss index b4a4c0df4af0ba910598c4a978538e1ff5d4197a..106ae2490e52ab00e7f0de058a0a92ce1ac77b70 100644 --- a/static/scss/table.scss +++ b/static/scss/table.scss @@ -17,4 +17,9 @@ table.detail-view { .grid-list-selector { // text-align: right; +} + +.no-recommendation { + font-style: italic; + text-align: center; } \ No newline at end of file diff --git a/templates/representatives_votes/dossier_detail.haml b/templates/representatives_votes/dossier_detail.haml index 6c04315710f5abef18c46988bd19ad22d183fe69..08fa4aedfdf50147b0eafed8f285f191aecf8e64 100644 --- a/templates/representatives_votes/dossier_detail.haml +++ b/templates/representatives_votes/dossier_detail.haml @@ -34,8 +34,15 @@ %small {{ proposal.reference }} {{ proposal.kind }} - %td= proposal.recommendation.title - %td= proposal.recommendation.recommendation | position_icon + + - if proposal.recommendation + + %td= proposal.recommendation.title + %td= proposal.recommendation.recommendation | position_icon + + - else + %td.no-recommendation{colspan:2}= "No recommendation" + %td= proposal.status %td= proposal.total_for %td= proposal.total_against diff --git a/templates/representatives_votes/dossier_list.haml b/templates/representatives_votes/dossier_list.haml index aed6045f9c499799fca2b68cc54d947077a0a55e..215aef3a3aa7ec7d0cec4e7203645c05596d6a93 100644 --- a/templates/representatives_votes/dossier_list.haml +++ b/templates/representatives_votes/dossier_list.haml @@ -29,6 +29,8 @@ - trans "Title" %th - trans "Recommendations" + %th + - trans "Proposals" %th - trans "Reference" @@ -38,6 +40,7 @@ %a{'href': "{% url 'dossier-detail' dossier.pk %}"} {{ dossier.title }} %td= dossier.nb_recomm + %td= dossier.nb_proposals %td= dossier.reference - include "core/blocks/pagination.html"