Browse Source

change cardinal-5 description

Julien Moutinho 10 years ago
parent
commit
00934384b3
3 changed files with 24 additions and 11 deletions
  1. 1 0
      main.py
  2. 14 2
      static/css/cavote.css
  3. 9 9
      templates/vote.html

+ 1 - 0
main.py

@@ -751,6 +751,7 @@ def admin_vote_edit(voteid):
     vote = query_db('select * from votes where id = ?', [voteid], one=True)
     vote = query_db('select * from votes where id = ?', [voteid], one=True)
     if vote is None:
     if vote is None:
         abort(404)
         abort(404)
+    print "\nvote: %s\n" % str(vote)
     if request.method == 'POST':
     if request.method == 'POST':
         if request.form['title']:
         if request.form['title']:
             if request.form['days'] > 0:
             if request.form['days'] > 0:

+ 14 - 2
static/css/cavote.css

@@ -3,6 +3,9 @@
     margin-top:9px;
     margin-top:9px;
  }
  }
 
 
+.table-votes {
+	 table-layout:fixed;
+ }
 .table-votes thead th {
 .table-votes thead th {
     text-align: right;
     text-align: right;
     vertical-align: middle;
     vertical-align: middle;
@@ -99,10 +102,13 @@
     background-color:#20B756 !important;
     background-color:#20B756 !important;
     fill:#20B756;
     fill:#20B756;
  }
  }
-.cardinal-5 .value_-2__Tr_s_Hostile_ {
+.cardinal-5 .value_-2__Hostile_et_sans_moi_ {
     background-color:#DB4343 !important;
     background-color:#DB4343 !important;
     fill:#DB4343;
     fill:#DB4343;
  }
  }
+.results .value_-2__Hostile_et_sans_moi_ + text {
+    font: 9px sans-serif;
+ }
 .cardinal-5 .value_-1__Hostile_ {
 .cardinal-5 .value_-1__Hostile_ {
     background-color:#E49F37 !important;
     background-color:#E49F37 !important;
     fill:#E49F37;
     fill:#E49F37;
@@ -115,10 +121,13 @@
     background-color:#B1D039 !important;
     background-color:#B1D039 !important;
     fill:#B1D039;
     fill:#B1D039;
  }
  }
-.cardinal-5 .value__2__Tr_s_Favorable_ {
+.cardinal-5 .value__2__Favorable_et_avec_moi_ {
     background-color:#20B756 !important;
     background-color:#20B756 !important;
     fill:#20B756;
     fill:#20B756;
  }
  }
+.results .value__2__Favorable_et_avec_moi_ + text {
+    font: 8px sans-serif;
+ }
 .container,
 .container,
 .navbar-fixed-top .container,
 .navbar-fixed-top .container,
 .navbar-fixed-bottom .container {
 .navbar-fixed-bottom .container {
@@ -139,6 +148,9 @@
     padding:0;
     padding:0;
     overflow:visible;
     overflow:visible;
  }
  }
+.span9 {
+    width:800px;
+ }
 
 
 .results rect {
 .results rect {
 	//fill: steelblue;
 	//fill: steelblue;

+ 9 - 9
templates/vote.html

@@ -35,19 +35,19 @@
 <div class="span8">
 <div class="span8">
   <h2 class='page-header'>Résultats</h2>
   <h2 class='page-header'>Résultats</h2>
   <svg class="results cardinal-{{ vote.id_cardinal }}"
   <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}}">
        height="{{25 + results.list|length * 20 + 40}}">
     <g class="choice" transform="translate(100,0)">
     <g class="choice" transform="translate(100,0)">
       <text class="choice-legend" x="-10" y="9.5" dy=".35em">Légende :</text>
       <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>
      </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)">
     <g transform="translate({{150 + (100 * 5) + 35}},20)">
       <text class="choice-sum-legend" x="20" y="9.5" dy=".35em">somme↓</text>
       <text class="choice-sum-legend" x="20" y="9.5" dy=".35em">somme↓</text>
      </g>
      </g>