mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Refactors Candidate form
This commit is contained in:
@ -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 %}
|
@ -344,20 +344,15 @@ th {
|
||||
<button class="election__sumbit-button" form="vote-form">{% trans %}Submit the vote !{% endtrans %}</button>
|
||||
</section>
|
||||
{%- endif %}
|
||||
{%- if user.can_edit(election) %}
|
||||
<section class="election__add-elements">
|
||||
<a href="{{url('election:create_list')}}">{% trans %}Add a new list{% endtrans %}</a>
|
||||
<a href="{{url('election:create_role')}}">{% trans %}Add a new role{% endtrans %}</a>
|
||||
</section>
|
||||
{%- endif %}
|
||||
{%- 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">{{candidate_form}}
|
||||
{% csrf_token %}
|
||||
<p><input type="submit" value="{% trans %}Candidate{% endtrans %}" /></p>
|
||||
</form>
|
||||
</section>
|
||||
<a href="{{url('election:candidate', election_id=object.id)}}">{% trans %}Candidate{% endtrans %}</a>
|
||||
{%- endif %}
|
||||
<a href="{{url('election:create_list')}}">{% trans %}Add a new list{% endtrans %}</a>
|
||||
{%- if user.can_edit(election) %}
|
||||
<a href="{{url('election:create_role')}}">{% trans %}Add a new role{% endtrans %}</a>
|
||||
{%- endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
|
Reference in New Issue
Block a user