diff --git a/memopol/tests/RepresentativeDetailTest/test_votes_display.html b/memopol/tests/RepresentativeDetailTest/test_votes_display.html index a87fb555481a12e2e2b2b8d348f74103a8a71634..5767ab55fb39ea689b1001a8328d0983d5a64396 100644 --- a/memopol/tests/RepresentativeDetailTest/test_votes_display.html +++ b/memopol/tests/RepresentativeDetailTest/test_votes_display.html @@ -3,6 +3,7 @@ <table class='table table-condensed votes'> <tr> <th>Title</th> + <th>Date</th> <th class='icon-cell'> Memopol recommendation </th> @@ -17,14 +18,15 @@ <tr> <td>Stop acta !</td> + <td class='date-cell'>Nov.24,2010</td> <td class='icon-cell'> <i aria-label="for" class="fa fa-thumbs-up vote_positive" title="for" ></i> </td> <td class='icon-cell'> - <i aria-label="for" class="fa fa-thumbs-up vote_positive" title="for" ></i> + <i aria-label="against" class="fa fa-thumbs-down vote_negative" title="against" ></i> </td> <td class='icon-cell'> - <span class="label label-success">4</span> + <span class="label label-danger">-6</span> </td> @@ -32,6 +34,7 @@ <tr> <td>Stop acta !</td> + <td class='date-cell'>Nov.24,2010</td> <td class='icon-cell'> <i aria-label="for" class="fa fa-thumbs-up vote_positive" title="for" ></i> </td> @@ -47,14 +50,15 @@ <tr> <td>Stop acta !</td> + <td class='date-cell'>Nov.24,2010</td> <td class='icon-cell'> <i aria-label="for" class="fa fa-thumbs-up vote_positive" title="for" ></i> </td> <td class='icon-cell'> - <i aria-label="against" class="fa fa-thumbs-down vote_negative" title="against" ></i> + <i aria-label="for" class="fa fa-thumbs-up vote_positive" title="for" ></i> </td> <td class='icon-cell'> - <span class="label label-danger">-6</span> + <span class="label label-success">4</span> </td> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content index 64e881c0e18db6ff02bf3f86b24b2f2f692fd9cb..67cb48d87d85ffec2e2b9861ba4d31fc23837e82 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.66ec921b2740.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.3c5ffeab3cbf.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content index f164f6e0a672d3295152e86a98b009602982a650..3e96d141906c1c12f8ad4e44126a6287890d5990 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.66ec921b2740.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.3c5ffeab3cbf.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content index c2af6dc35e815681906690d42410562e34c198e1..788d295dbbe65a2b338e98a18ba437a0b08b3e6e 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.66ec921b2740.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.3c5ffeab3cbf.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content index 4afb6cfc838c70daaf6f9af7048bb07acc81c99d..fbb2b4a8eeb275507d1a45242380901de4db14ad 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.66ec921b2740.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.3c5ffeab3cbf.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content index 0c50c3a352427ebe773d21c385930f2ecc30dc4c..f0e6eca85aa18d4ab8b8e3b2b7dee09b8b99fdd2 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.66ec921b2740.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.3c5ffeab3cbf.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/views.py b/memopol/views.py index 8b7e4fa178328a2cb3cf1cd68ab0aeb1bb9708aa..fb7ab10a090264685448591b0af087934bfeec0d 100644 --- a/memopol/views.py +++ b/memopol/views.py @@ -66,7 +66,8 @@ class RepresentativeDetail(representatives_views.RepresentativeDetail): 'votes', queryset=VoteScore.objects.filter( proposal__in=Proposal.objects.exclude(recommendation=None), - ).select_related('proposal__recommendation') + ).select_related('proposal__recommendation').order_by( + '-proposal__datetime') ) ) return qs diff --git a/static/less/legislature.less b/static/less/legislature.less index 90791aca9dd2574709b073134f918e4adf3d2f3a..1c8c30db8262d9c1f04722c0010e4f786a122732 100644 --- a/static/less/legislature.less +++ b/static/less/legislature.less @@ -36,6 +36,10 @@ color: #333; } +.date-cell { + white-space: nowrap; +} + .representative_grid { display: flex; flex-wrap: wrap; diff --git a/templates/representatives/representative_detail.haml b/templates/representatives/representative_detail.haml index 2d81ac8638c36073c0aba38819746dbc8c8ee4eb..8d3214cd1112374c29d72746aa99270f4002a036 100644 --- a/templates/representatives/representative_detail.haml +++ b/templates/representatives/representative_detail.haml @@ -20,6 +20,7 @@ %table.table.table-condensed.votes %tr %th Title + %th Date %th.icon-cell Memopol recommendation %th.icon-cell @@ -30,6 +31,8 @@ - for vote in votes %tr %td= vote.proposal.recommendation.title + %td.date-cell + = vote.proposal.datetime|date:'N j, Y' %td.icon-cell = vote.proposal.recommendation.recommendation|position_icon %td.icon-cell