Commit 20999807 authored by James Pic's avatar James Pic

Merge pull request #50 from political-memory/bugfix_link

Use Country.get_absolute_url in templates
parents 9c884e2a 95639bc9
<div class="container-fluid main-container">
<!DOCTYPE html>
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />
<title>
Home
- 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.53baf9815401.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>
</head>
<body >
<!-- -load memopol_tags cache -->
<div id='header' class='container-fluid'>
<a id='logo' href='/'>
<img src='/static/collected/images/logo.png' />
</a>
<h1>
<a id='header_banner' href='/'>
Political Memory
</a>
</h1>
<p class='organization'>
</p>
</div>
<div id='nav' class='container-fluid'>
<ul class='nav'>
<li>
<a href='/legislature/representative/'>
Representatives
</a>
</li>
<li>
<a href='/legislature/groups/country/'>
Countries
</a>
</li>
<li>
<a href='/legislature/groups/group/'>
Parties
</a>
</li>
<li>
<a href='/legislature/groups/delegation/'>
Delegations
</a>
</li>
<li>
<a href='/legislature/groups/committee/'>
Committees
</a>
</li>
<li>
<a href='/votes/dossier/'>
Votes
</a>
</li>
</ul>
</div>
<div class="container-fluid main-container">
<form action='' method='get'>
<label for='search'>
......@@ -11,15 +84,15 @@
<input type='submit' value='Go' />
</form>
<div class='pagination-block'>
<nav>
<ul class='pagination pagination-sm'>
</ul>
</nav>
<div class='count'>
......@@ -28,35 +101,35 @@
Number of displayed results :
12
(
<a href='?paginate_by=12'>
12
</a>
/
<a href='?paginate_by=24'>
24
</a>
/
<a href='?paginate_by=48'>
48
</a>
/
<a href='?paginate_by=96'>
96
</a>
)
<span class='grid-list-selector'>
<a href='?display=grid'>
<i class="fa fa-th"></i>
......@@ -68,12 +141,12 @@
</span>
</div>
</div>
<table class='table'>
<tr>
......@@ -94,7 +167,7 @@
</th>
</tr>
<tr>
<td>
<a href='/legislature/representative/eva-joly/'>
......@@ -109,8 +182,10 @@
</a>
</td>
<td>
<a href='/legislature/representative/country/France/'>
France [FR]
</a>
</td>
<td>
<a href='/legislature/representative/group/Group%20of%20the%20Greens/European%20Free%20Alliance/'>
......@@ -122,17 +197,17 @@
</td>
</tr>
</table>
<div class='pagination-block'>
<nav>
<ul class='pagination pagination-sm'>
</ul>
</nav>
<div class='count'>
......@@ -141,35 +216,35 @@
Number of displayed results :
12
(
<a href='?paginate_by=12'>
12
</a>
/
<a href='?paginate_by=24'>
24
</a>
/
<a href='?paginate_by=48'>
48
</a>
/
<a href='?paginate_by=96'>
96
</a>
)
<span class='grid-list-selector'>
<a href='?display=grid'>
<i class="fa fa-th"></i>
......@@ -181,8 +256,32 @@
</span>
</div>
</div>
</div>
<div id='footer' class='container-fluid'>
Memopol is free software
<a href="https://gitorious.org/memopol2-0">released</a>
under the terms of the
<a href="http://www.gnu.org/licenses/agpl.html">GNU aGPLV3+</a>
<a href='https://projets.lqdn.fr/projects/mempol'>
Bug tracking system
</a>
<a href='https://projets.lqdn.fr/projects/mempol/issues/new'>
Report a bug
</a>
<br />
Provided by <a href="http://www.laquadrature.net/">La Quadrature du Net</a>
</div>
</body>
</html>
# -*- coding: utf8 -*-
from django.test import TestCase
from responsediff.response import Response
from .base import UrlGetTestMixin
......@@ -23,7 +25,8 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self.response = self.client.get(url)
self.assertExpectedHtmlInResult()
expected = Response.for_test(self)
expected.assertNoDiff(self.response)
def test_page1_paginateby12_displaylist(self):
self.functional_test(1, 12, 'list')
......
......@@ -15,7 +15,7 @@ setup(name='political-memory',
'django-compressor>=1.6,<1.7',
'django-datetime-widget>=0.9,<1.0',
'django-filter>=0.11,<0.12',
'django-representatives>=0.0.6',
'django-representatives>=0.0.9',
'django-representatives-votes>=0.0.7',
'django-taggit>=0.17,<0.18',
'django>=1.8,<1.9',
......@@ -28,6 +28,7 @@ setup(name='political-memory',
],
extras_require={
'testing': [
'django-responsediff',
'flake8',
'pep8',
'pytest',
......
......@@ -21,7 +21,8 @@
%tr
%th Country
%td<
= representative.country|country_flag
%a{:href => "{{ representative.country.get_absolute_url }}"}
= representative.country|country_flag
%tr
%th Party
%td<
......
......@@ -16,7 +16,7 @@
%a{'href': "{{ representative.get_absolute_url }}"}
= representative.full_name
%li.country
%a{'href': "{% url 'representatives:representative-list' group_kind='country' group=representative.country.code %}"}
%a{'href': "{{ representative.country.get_absolute_url }}"}
= representative.country|country_flag
%li.mandate
%a{'href': "{{ representative.main_mandate.group.get_absolute_url }}"}
......
......@@ -42,6 +42,7 @@
= representative.full_name
%td
%a{'href': "{{ representative.country.get_absolute_url }}"}
= representative.country
%td
......
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