]> WPIA git - motion.git/blobdiff - templates/single_motion.html
upd: move cancel and finish button and add confirm question
[motion.git] / templates / single_motion.html
index ac4ff79148bc4ef86292b5040f1611cbda0c8a75..bc93bee4073e371f4dcec5bfb1e34fbc1ade3669 100644 (file)
@@ -1,23 +1,69 @@
 {% extends "base.html" %}
 {% block title -%}
-Motion: {{motion.name}}
+{{_('Motion')}}: {{motion.name}}
 {%- endblock %}
 {% block body %}
 {%- include 'motion.html' %}
+{%- if votes %}
+<div class="motion card" id="votes">
+  <div class="card-heading text-white bg-info">
+    {{_('Motion Votes')}}
+  </div>
+  <div class="card-body">
+    {%- for row in votes %}
+    <div>{{row.email}}: {{row.result}}{%- if row.proxyemail %} : {_('given by')}} {{row.proxyemail}}{%- endif %}</div>
+    {%- endfor %}
+  </div>
+</div>
+{%- endif %}
+
 {%- if motion.running %}
+{%- if may_cancel or may_finish %}
+<h3>{{_('Motion handling')}}</h3>
+
+{%- if may_cancel %}
+<form action="/motion/{{motion.identifier}}/cancel" method="POST" class="form-inline">
+<input type="text" placeholder="{{_('Cancelation reason')}}" name="reason" class="form-control" required="yes">
+<button type="submit" class="btn btn-danger btn-confirm" data-confirm="{{_('Do you really want to cancel the motion?')}}" data-reply="{{_('Cancel')}},{{_('Confirm')}}" name="cancel" value="cancel" id="cancel">{{_('Cancel')}}</button></br>
+</form>
+{%- endif %}
+{%- if may_finish %}
+<form action="/motion/{{motion.identifier}}/finish" method="POST" class="form-inline">
+<button type="submit" class="btn btn-danger btn-confirm" data-confirm="{{_('Do you really want to finish the motion?')}}" data-reply="{{_('Cancel')}},{{_('Confirm')}}" name="finish" value="finish" id="finish">{{_('Finish')}}</button></br>
+</form>
+{%- endif %}
+{%- endif %}
+
 {%- if may_vote %}
-<form action="/motion/{{motion.id}}/vote" method="POST">
-{%- for vote in ['yes','no','abstain'] %}
-<button type="submit" class="btn btn-{{ 'success' if vote == motion.result else 'primary' }}" name="vote" value="{{vote}}" id="vote-{{vote}}">{{vote}}</button>
+<div class="panel panel-info" id="votes">
+  <div class="panel-body">
+<h3>{{_('My vote')}}</h3>
+{%- if proxyname %}
+{{_('Given by %(pn)s', pn=proxyname[0][0])}}
+
+{%- endif %}
+<form action="/motion/{{motion.identifier}}/vote/{{g.voter}}" method="POST">
+{%- for vote in ['yes', 'no', 'abstain'] %}
+<button type="submit" class="btn btn-{{ 'success' if vote == motion.result else 'primary' }}" name="vote" value="{{vote}}" id="vote-{{vote}}">{{_(vote)|capitalize}}</button>
 {%- endfor %}
 </form>
+
+{%- for p in proxyvote %}
+<h3>{{_('Vote for %(email)s', email=p.email)}}</h3>
+{%- if p.owneremail and p.result%}
+{{_('Voted by %(email)s', email=p.owneremail)}}
 {%- endif %}
-{%- if may_cancel %}
-<form action="/motion/{{motion.id}}/cancel" method="POST" class="form-inline">
-<input type="text" placeholder="cancelation reason" name="reason" class="form-control" required="yes">
-<button type="submit" class="btn btn-danger">Cancel</button>
+<form action="/motion/{{motion.identifier}}/vote/{{p.voter_id}}" method="POST">
+{%- for vote in ['yes', 'no', 'abstain'] %}
+<button type="submit" class="btn btn-{{ 'success' if vote == p.result else 'primary' }}" name="vote" value="{{vote}}" id="vote-{{vote}}">{{_(vote)|capitalize}}</button>
+{%- endfor %}
 </form>
+{%- endfor %}
 {%- endif %}
+
+
 {%- endif %}
-<a href="/?start={{motion.id}}#motion-{{motion.id}}" class="btn btn-primary">Back</a>
+<a href="/?start={{motion.id}}#motion-{{motion.id}}" class="btn btn-primary">{{_('Back')}}</a>
 {%- endblock %}
+  </div>
+</div>