Commit 047b3f3d authored by luxcem's avatar luxcem

Merge remote-tracking branch 'origin/dev_campaign' into dev

Conflicts:
	core/templates/base.html
	core/templates/core/blocks/navigation.haml
	memopol_representatives/templates/memopol_representatives/view.html
	memopol_representatives/views.py
parents 75e160a7 33c28b26
# Django apps
compotista_django-representatives
representatives
chronograph
......@@ -24,6 +25,8 @@ __pycache__/
# Distribution / packaging
.Python
env/
venv/
ve/
build/
var/
......
......@@ -128,7 +128,7 @@ li {
.panel {
background: none repeat scroll 0% 0% #F2F2F2;
border: 1px solid #E6E6E6;
margin: 0px 0px 22px;
margin: 0px 20px 22px;
padding: 20px;
}
......
......@@ -7,8 +7,8 @@
<meta name="viewport" content="width=device-width" />
{% block head %}{% endblock %}
<title>{% block title %}Home{% endblock %} - The Political Memory of {{ organization_name }}</title>
<link rel="stylesheet" href="{{ STATIC_URL }}/css/reset.css" type="text/css" />
<link rel="stylesheet" href="{{ STATIC_URL }}/css/base.css" type="text/css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" type="text/css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/base.css" type="text/css" />
</head>
<body {% block bodyattrs %}{% endblock %}>
{% include "core/blocks/header.html" %}
......
......@@ -10,8 +10,7 @@
%a#header_banner{href: "/"}
-trans "Political Memory"
%p
-# =organization_name
La Quadrature du Net
=organization_name
-include "core/blocks/navigation.html"
......@@ -4,8 +4,10 @@
.row
.large-8.columns
%p
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam maximus blandit nisl ut tempor. Vivamus feugiat, dui ut imperdiet tincidunt, arcu mi efficitur arcu, eget interdum urna sapien in nunc. Nam vestibulum orci nec purus aliquet, nec imperdiet nulla consequat. Phasellus ac lorem tortor. Suspendisse sit amet ullamcorper magna. Morbi congue eu ante at scelerisque. Pellentesque nunc leo, fermentum blandit eros id, facilisis lobortis quam. Etiam tincidunt ante et fermentum imperdiet.
Actually Memopol is actually reachable only in <b>reduced functionality mode</b>. By the way, you could access to <a href="/representatives">the actual list of MEPs</a>.
%p
Cras eget odio lacus. Donec nisl enim, sagittis id mauris quis, ultrices lacinia dui. Donec a interdum nibh. Nunc nibh tellus, sollicitudin et lacus at, sollicitudin placerat quam. Aliquam egestas nibh quis lorem consequat, eu pharetra velit vestibulum. Fusce pellentesque semper est ac viverra. Quisque dignissim mi magna, in auctor massa vulputate sed. Sed suscipit orci dui, sed mollis felis congue non. Quisque porta nunc nec dui suscipit, non facilisis lectus consequat. Vivamus ipsum felis, volutpat sollicitudin iaculis at, sagittis eu enim. Ut eget auctor neque. Aenean eget est quis felis dapibus aliquet. Duis commodo, turpis sit amet ultrices lacinia, ligula ipsum viverra erat, ac porttitor lacus sapien sed orci.
You can help on building the new Memopol by <a href="https://wiki.laquadrature.net/Projects/Memopol/Roadmap">coding, translating, de signing, funding, etc...</a>.
%p
<a href="http://memopol.org">Memopol Blog</a> is available as well as the new <a href="http://git.laquadrature.net/memopol/memopol_political_memory/issues">bugtracking system</a>
.large-4.columns
- include "core/blocks/what_is_memopol.html"
......@@ -7,5 +7,5 @@ class HomeView(TemplateView):
def get_context_data(self, **kwargs):
return {
'organization_name': 'LQDN'
'organization_name': 'La Quadrature du Net'
}
......@@ -10,10 +10,21 @@
<h1>{{ representative.full_name }}</h1>
<p>
{{ representative.country.name }} {{ representative.gender }} <br>
Born in {{ representative.birth_place }} the {{ representative.birth_date }} <br>
</p>
{% for mandate in representative.mandate_set.all %}
{% if mandate.group.kind == "group" %}
<h3>{{ mandate.role }} of {{ mandate.group.name }}</h3>
{% endif %}
{% endfor %}
<p>Born in {{ representative.birth_place }} the {{ representative.birth_date }} ({{ representative.get_gender_display }})</p>
<p>{{ representative.country.name }}</p>
<h2 style="clear: both">Committees</h2>
{% for mandate in representative.mandate_set.all %}
{% if mandate.group.kind == "committee" %}
<p>{{ mandate.role }} of {{ mandate.group.name }} ({{ mandate.group.abbreviation }})
{% endif %}
{% endfor %}
<h2 style="clear: both">Mandates</h2>
{% for mandate in representative.active_mandates %}
......
......@@ -5,5 +5,6 @@ from memopol_representatives import views
urlpatterns = patterns(
'',
url(r'^$', views.index, name='index'),
url(r'^committee/(?P<committee>\w{4})$', views.committee, name='committee'),
url(r'^view/(?P<num>\d+)$', views.view, name='view'),
)
......@@ -20,7 +20,7 @@ def index(request):
else:
representative_list = Representative.objects.all()
paginator = Paginator(representative_list, 15)
paginator = Paginator(representative_list, 50)
page = request.GET.get('page')
try:
......@@ -38,6 +38,43 @@ def index(request):
)
def committee(request, committee):
context = {}
if request.GET.get('search'):
search = request.GET.get('search')
representative_list = Representative.objects.filter(
mandate__group__kind='committee',
mandate__group__abbreviation=committee
).filter(
Q(full_name__icontains=search)
)
queries_without_page = request.GET.copy()
if 'page' in queries_without_page:
del queries_without_page['page']
context['queries'] = queries_without_page
else:
representative_list = list(set(Representative.objects.filter(
mandate__group__kind='committee',
mandate__group__abbreviation=committee
).all()))
paginator = Paginator(representative_list, 50)
page = request.GET.get('page')
try:
representatives = paginator.page(page)
except PageNotAnInteger:
representatives = paginator.page(1)
except EmptyPage:
representatives = paginator.page(paginator.num_pages)
context['representatives'] = representatives
return render(
request,
'memopol_representatives/list.html',
context
)
def view(request, num):
representative = get_object_or_404(Representative, pk=num)
......
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