change cardinal-5 description
authorJulien Moutinho <julm+cavote@autogeree.net>
Fri, 3 Oct 2014 13:52:19 +0000 (15:52 +0200)
committerJulien Moutinho <julm+cavote@autogeree.net>
Fri, 3 Oct 2014 13:52:19 +0000 (15:52 +0200)
main.py
static/css/cavote.css
templates/vote.html

diff --git a/main.py b/main.py
index 9ce0797..14a839b 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -751,6 +751,7 @@ def admin_vote_edit(voteid):
     vote = query_db('select * from votes where id = ?', [voteid], one=True)
     if vote is None:
         abort(404)
+    print "\nvote: %s\n" % str(vote)
     if request.method == 'POST':
         if request.form['title']:
             if request.form['days'] > 0:
index c636730..1c7a21a 100644 (file)
@@ -3,6 +3,9 @@
     margin-top:9px;
  }
 
+.table-votes {
+        table-layout:fixed;
+ }
 .table-votes thead th {
     text-align: right;
     vertical-align: middle;
     background-color:#20B756 !important;
     fill:#20B756;
  }
-.cardinal-5 .value_-2__Tr_s_Hostile_ {
+.cardinal-5 .value_-2__Hostile_et_sans_moi_ {
     background-color:#DB4343 !important;
     fill:#DB4343;
  }
+.results .value_-2__Hostile_et_sans_moi_ + text {
+    font: 9px sans-serif;
+ }
 .cardinal-5 .value_-1__Hostile_ {
     background-color:#E49F37 !important;
     fill:#E49F37;
     background-color:#B1D039 !important;
     fill:#B1D039;
  }
-.cardinal-5 .value__2__Tr_s_Favorable_ {
+.cardinal-5 .value__2__Favorable_et_avec_moi_ {
     background-color:#20B756 !important;
     fill:#20B756;
  }
+.results .value__2__Favorable_et_avec_moi_ + text {
+    font: 8px sans-serif;
+ }
 .container,
 .navbar-fixed-top .container,
 .navbar-fixed-bottom .container {
     padding:0;
     overflow:visible;
  }
+.span9 {
+    width:800px;
+ }
 
 .results rect {
        //fill: steelblue;
index 7e36224..d767473 100644 (file)
 <div class="span8">
   <h2 class='page-header'>Résultats</h2>
   <svg class="results cardinal-{{ vote.id_cardinal }}"
-       width="{{ 150 + (100 * 5) + 50 + 100 + 100 }}"
+       width="{{ 150 + (100 * 5) + 100 + 100 }}"
        height="{{25 + results.list|length * 20 + 40}}">
     <g class="choice" transform="translate(100,0)">
       <text class="choice-legend" x="-10" y="9.5" dy=".35em">Légende :</text>
+      {% for value in values %}
+      <g transform="translate({{ (loop.index0 * 750 / loop.length) }},0)">
+        <rect width="{{ 750 / loop.length + 1 }}" height="18"></rect>
+        <rect class="{{ value.class }}" x="1" y ="0" width="{{ 750 / loop.length - 1}}" height="18"></rect>
+        <text class="choice-legend-item" text-anchor="start" x="{{ 750 / loop.length - 2 }}" y="9.5" dy=".35em"
+         >{{ value.name }}</text>
+       </g>
+      {% endfor %}
      </g>
-    {% for value in values %}
-    <g transform="translate({{ 150 + (loop.index0 * 640 / loop.length) }},0)">
-      <rect width="{{ 640 / loop.length + 1 }}" height="18"></rect>
-      <rect class="{{ value.class }}" x="1" y ="0" width="{{ 640 / loop.length - 1}}" height="18"></rect>
-      <text class="choice-legend-item" text-anchor="start" x="{{ 640 / loop.length - 2 }}" y="9.5" dy=".35em"
-       >{{ value.name }}</text>
-     </g>
-    {% endfor %}
     <g transform="translate({{150 + (100 * 5) + 35}},20)">
       <text class="choice-sum-legend" x="20" y="9.5" dy=".35em">somme↓</text>
      </g>