Refactors Candidate form

This commit is contained in:
2016-12-24 02:16:21 +01:00
parent 9d9c86ea0f
commit 02913d91e6
3 changed files with 88 additions and 85 deletions

View File

@ -5,9 +5,12 @@
{% endblock %}
{% block content %}
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{%- if election.can_candidate(user) or user.can_edit(election) %}
<section class="election__add-candidature">
<form action="{{url('election:candidate', election_id=election.id)}}" method="post">{{form.as_p()}}
<p><input type="submit" value="{% trans %}Candidate{% endtrans %}" /></p>
{% csrf_token %}
</form>
</section>
{%- endif %}
{% endblock content %}