Fix database and add some view

This commit is contained in:
2016-12-05 23:49:13 +01:00
parent d685e9ba29
commit 135fa00e25
7 changed files with 92 additions and 5 deletions

View File

@ -0,0 +1,27 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Election list{% endtrans %}
{% endblock %}
{% block content %}
{% if object.has_voted(request.user) %}
A voté
{% endif %}
<h1>{{object.title}}</h1>
<p>{{object.description}}</p>
<p>{% trans %}End :{% endtrans %} {{object.end_date}}</p>
{% for resp in object.responsability.all() %}
<h2>{{resp.title}}</h2>
{% for user in resp.candidate.all() %}
<a href="{{url('core:user_profile', user_id=user.subscriber.id)}}"><h3>{{user.subscriber.first_name}} {{user.subscriber.last_name}} ({{user.subscriber.nick_name}})</h3></a>
{% if user.subscriber.profile_pict %}
<img src="{{user.subscriber.profile_pict.get_download_url()}}" alt="{% trans %}Profile{% endtrans %}"/>
{% endif %}
{% if user.program %}
<h4>Programme</h4>
<p>{{user.program}}</p>
{% endif %}
{% endfor %}
{% endfor %}
{% endblock %}

View File

@ -7,7 +7,7 @@
{% block content %}
{% for el in object_list %}
{% if el.is_active %}
<p>{{el}}</p>
<p><a href="{{ url('election:detail', election_id=el.id) }}">{{el}}</a></p>
{% endif %}
{% endfor %}
{% endblock %}