]> WPIA git - motion.git/blobdiff - templates/index.html
chg: Prev/Next/Back-links as bootstrap-buttons
[motion.git] / templates / index.html
index 6e18c960ca9d09d2f9a837b90d6bb8c43167dc9b..fdbb01029c085df7c6d552b077002b64239a7e5d 100644 (file)
@@ -1,11 +1,22 @@
 {% extends "base.html" %}
 {% block body %}
 <div class="container">
+{%- if categories|length != 0 %}
 <form action="/motion" method="POST" class="form-inline">
 <div class="motion panel panel-default">
   <div class="motion-title panel-heading from-group">
-    <input class="form-control" placeholder="Motion title" type="text" name="title" id="title">
-    <select class="form-control" name="days">
+    <input class="form-control motion-title-input" placeholder="Motion title" type="text" name="title" id="title">
+    {%- if categories|length == 1 %}
+    <input type="text" class="float form-control" maxwidth="10" disabled value="{{categories[0]}}">
+    <input type="hidden" name="category" value="{{categories[0]}}">
+    {%- else %}
+    <select class="float form-control" name="category">
+      {%- for cat in categories %}
+      <option>{{cat}}</option>
+      {%- endfor %}
+    </select>
+    {%- endif %}
+    <select class="float form-control" name="days">
       {%- for time in times %}
       <option>{{time}}</option>
       {%- endfor %}
   </div>
 </div>
 </form>
-{% for motion in motions %}
+{%- endif %}
+{%- if prev %}
+{%- if prev == -1 %}
+<a href="/" class="btn btn-primary">Prev</a>
+{%- else %}
+<a href="/?start={{ prev }}" class="btn btn-primary">Prev</a>
+{%- endif %}
+{%- endif %}
+{%- for motion in motions %}
 {% include 'motion.html' %}
-{% endfor %}
+{%- endfor %}
 {%- if more %}
-<a href="/?start={{ more }}">Next</a>
+<a href="/?start={{ more }}" class="btn btn-primary">Next</a>
 {%- endif %}
 </div>
 {%- endblock %}