Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony
memopol
Commits
fbfd3126
Commit
fbfd3126
authored
May 28, 2016
by
Nicolas Joyard
Browse files
Enhance dossier list a bit
parent
e28cbe1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
memopol/views.py
View file @
fbfd3126
# Project specific "glue" coupling of all apps
from
django.db
import
models
from
django.db.models
import
Count
from
core.views
import
GridListMixin
,
PaginationMixin
,
CSVDownloadMixin
from
representatives
import
views
as
representatives_views
...
...
@@ -82,4 +83,9 @@ class RepresentativeDetail(representatives_views.RepresentativeDetail):
class
DossierList
(
PaginationMixin
,
representatives_votes_views
.
DossierList
):
queryset
=
Dossier
.
objects
.
exclude
(
proposals__recommendation
=
None
)
queryset
=
Dossier
.
objects
.
prefetch_related
(
'proposals'
,
'proposals__recommendation'
).
annotate
(
nb_recomm
=
Count
(
'proposals__recommendation'
)
).
order_by
(
'-reference'
)
templates/_header.haml
View file @
fbfd3126
...
...
@@ -34,4 +34,4 @@
-
trans
'Committees'
%li
%a
{
href:
"{% url 'representatives_votes:dossier-list' %}"
}
-
trans
'
Vote
s'
-
trans
'
Dossier
s'
templates/representatives_votes/dossier_list.haml
View file @
fbfd3126
-
extends
"base.html"
-
load
i18n
-
block
content
%h1
Dossiers
%h1
-
trans
"Dossiers"
%table
.table
%tr
%th
-
trans
"Title"
%th
-
trans
"Recommendations"
%th
-
trans
"Reference"
-
for
dossier
in
object_list
%tr
%td
%a
{
'href'
:
"{{ dossier.get_absolute_url }}"
}
{{ dossier.title }}
%td
=
dossier
.
nb_recomm
%td
=
dossier
.
reference
-
include
"core/blocks/pagination.html"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment