Commit 4ae5ac4c authored by Nicolas Joyard's avatar Nicolas Joyard

Add 'no recommendation' label to dossier detail and #proposals to dossier list

parent 2f172532
...@@ -17,6 +17,7 @@ class DossierList(PaginationMixin, generic.ListView): ...@@ -17,6 +17,7 @@ class DossierList(PaginationMixin, generic.ListView):
'proposals', 'proposals',
'proposals__recommendation' 'proposals__recommendation'
).annotate( ).annotate(
nb_proposals=Count('proposals'),
nb_recomm=Count('proposals__recommendation') nb_recomm=Count('proposals__recommendation')
).order_by('-nb_recomm', '-reference') ).order_by('-nb_recomm', '-reference')
......
...@@ -17,4 +17,9 @@ table.detail-view { ...@@ -17,4 +17,9 @@ table.detail-view {
.grid-list-selector { .grid-list-selector {
// text-align: right; // text-align: right;
}
.no-recommendation {
font-style: italic;
text-align: center;
} }
\ No newline at end of file
...@@ -34,8 +34,15 @@ ...@@ -34,8 +34,15 @@
%small %small
{{ proposal.reference }} {{ proposal.reference }}
{{ proposal.kind }} {{ 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.status
%td= proposal.total_for %td= proposal.total_for
%td= proposal.total_against %td= proposal.total_against
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
- trans "Title" - trans "Title"
%th %th
- trans "Recommendations" - trans "Recommendations"
%th
- trans "Proposals"
%th %th
- trans "Reference" - trans "Reference"
...@@ -38,6 +40,7 @@ ...@@ -38,6 +40,7 @@
%a{'href': "{% url 'dossier-detail' dossier.pk %}"} %a{'href': "{% url 'dossier-detail' dossier.pk %}"}
{{ dossier.title }} {{ dossier.title }}
%td= dossier.nb_recomm %td= dossier.nb_recomm
%td= dossier.nb_proposals
%td= dossier.reference %td= dossier.reference
- include "core/blocks/pagination.html" - include "core/blocks/pagination.html"
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