poll_detail.html 4.23 KB
Newer Older
christophe siraut's avatar
christophe siraut committed
1
{% extends "base.html" %}
Christophe Siraut's avatar
Christophe Siraut committed
2
{% load url from future %}
3
{% load i18n %}
Christophe Siraut's avatar
Christophe Siraut committed
4
{% load bulletin_results %}
christophe siraut's avatar
christophe siraut committed
5

6 7
{% block menu %}
    {% if has_voted %}
Christophe Siraut's avatar
Christophe Siraut committed
8
        <a title=" {% trans 'Clear cookie, you will not be able to change your vote.' %} " href="{% url 'clearcookie' object.id %}">{% trans "Forget me" %}</a>
9
    {% endif %}
Christophe Siraut's avatar
Christophe Siraut committed
10
        <a title=" {% trans 'Export as csv spreadsheet' %} " href="{% url 'csv' object.id %}">{% trans "Export" %}</a>
11 12
{% endblock %}

13
{% block title %}nuages - {{object}}{% endblock %}
christophe siraut's avatar
christophe siraut committed
14

Christophe Siraut's avatar
Christophe Siraut committed
15 16
{% block main %}
<h1>{{object}}</h1>
christophe siraut's avatar
christophe siraut committed
17

18
<div class="row">
Christophe Siraut's avatar
Christophe Siraut committed
19 20 21 22
    <div class="span8 lead">
        {{object.description}}<br />{% trans "Posted by" %} <span class="muted"><em>{% if object.user %}{{object.user}}{% else %}{% trans 'Anonymous' %}{% endif %}</em></span> {% trans "on" %} {{object.pub_date|date:"d F"}}.<br /> {% trans "Shared address" %}: <span class="text-info">{{ object.link }}</span>
    </div>
</div>
Christophe Siraut's avatar
Christophe Siraut committed
23 24 25
<table class="bigtable">
    <tr>
        <td class='names'></td>
26
        {% for choice in object.choice_set.all %}
Christophe Siraut's avatar
Christophe Siraut committed
27 28
        <td class='cell-header'>{{ choice.choice|date:"d/m" }}<br />
        <font class="grey">{{ choice.choice|date:'H:i' }}</font><br />
Christophe Siraut's avatar
Christophe Siraut committed
29
            <span class="tip tip-header"><b> {{ choice.choice|date:'l d F'}} </b> <br />
Christophe Siraut's avatar
Christophe Siraut committed
30 31
            {{ choice.choice|date:'H:i a'}} <br />
             <font class="blue">{{ choice.details }} </font>
32 33 34
             </span>
        <div class="subl"><!-- --></div>
        </td>
Christophe Siraut's avatar
Christophe Siraut committed
35 36
        {% endfor %}    
    </tr>
christophe siraut's avatar
christophe siraut committed
37

Christophe Siraut's avatar
Christophe Siraut committed
38 39 40
    {% for bulletin in object.bulletin_set.all %}
    <tr >
        <td class='names'>{{ bulletin.voter }}</td>
Christophe Siraut's avatar
Christophe Siraut committed
41 42
        {% for vote in bulletin|bulletin_results:object.choice_set.all %}
        <td class='cell'><div class="{{ vote.voice }}">{% if vote.comment %} <div class="msg"><!-- --></div><span class="tip"><font class="white">{{ vote.comment }}</font></span>{% endif %}</div></td>
christophe siraut's avatar
christophe siraut committed
43
        {% endfor %}
Christophe Siraut's avatar
Christophe Siraut committed
44 45
    </tr>
    {% endfor %}
christophe siraut's avatar
christophe siraut committed
46

Christophe Siraut's avatar
Christophe Siraut committed
47 48
    <tr>
        <td class='names'></td>
49
        {% for choice in object.choice_set.all %}
Christophe Siraut's avatar
Christophe Siraut committed
50
        <td class='cell' title=" {{ choice }} ">{{ choice.votecount }}</td>
Christophe Siraut's avatar
Christophe Siraut committed
51 52
        {% endfor %}       
    </tr>      
christophe siraut's avatar
christophe siraut committed
53

Christophe Siraut's avatar
Christophe Siraut committed
54
    <tr>
Christophe Siraut's avatar
Christophe Siraut committed
55
        <form action="." method="post"> {% csrf_token %}
Christophe Siraut's avatar
Christophe Siraut committed
56 57 58 59
        <td class='names' title=" Fill in your name ">
            <div class="blue">{% trans "Your name:" %}</div>
            {{ form.as_p }}       
        </td>
christophe siraut's avatar
christophe siraut committed
60 61

      {% for forms in vforms %}
Christophe Siraut's avatar
Christophe Siraut committed
62
      {{ vforms.management_form }}
christophe siraut's avatar
typos  
christophe siraut committed
63
      {% for form in forms %}     
Christophe Siraut's avatar
Christophe Siraut committed
64 65 66 67 68 69 70 71 72 73 74
        <td class='cell' title='{% trans " Check the little boxes to add positive answers " %}' />
            {{ form.voice }} <br />
            {{ form.comment }}
            <div class="hide">
            {{ form.choice }}
            {% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
            </div>
            {{ field.errors }}
        </td>      
        {% endfor %}
        {% endfor %}
christophe siraut's avatar
christophe siraut committed
75 76 77
    </tr>
</table>

78
<br />
79
<h3>{% trans "Instructions" %}</h3>
80 81
<table class="instructions">
    <tr>
82
        <td>1. {% trans "Point columns to see choice details and comments" %} </td>
Christophe Siraut's avatar
Christophe Siraut committed
83
        <td>2. {% trans "Check the boxes for positive answers. " %} {%trans "You may provide a comment for each choice." %}</td>
Christophe Siraut's avatar
Christophe Siraut committed
84
        <td>3. <div style="text-align:center;"><input type="submit" value='{% trans "Vote" %}' class="btn btn-primary" /></td><td style="width:1px"></td>
85 86 87
    </tr>
</table>

Christophe Siraut's avatar
Christophe Siraut committed
88
        </form>
christophe siraut's avatar
christophe siraut committed
89

90
    <br />
91
    <h3>{% trans "Details" %}</h3>
christophe siraut's avatar
typos  
christophe siraut committed
92
    {% for choice in object.choice_set.all %} 
93
        <p class="indent" id='info-{{ choice }}'>
94
        <span class="da">{{ choice.choice|date:"l d F, H:i a"}} </span> -
95
        <span class="blue">{{ choice.details }}</span>&nbsp; ({{ choice.votecount }})<br />
christophe siraut's avatar
christophe siraut committed
96 97 98 99 100

            {% for bulletin in object.bulletin_set.all %}
                {% for vote in bulletin.vote_set.all %}
                    {% ifequal choice vote.choice %}
                        {% if vote.comment %}
Christophe Siraut's avatar
Christophe Siraut committed
101
                            <span class="text-info">{{ bulletin.voter }}</span>: {{ vote.comment }} <br />
christophe siraut's avatar
christophe siraut committed
102 103 104 105 106 107
                        {% endif %}
                    {% endifequal %}
                {% endfor %}
            {% endfor %}

        </p>
christophe siraut's avatar
typos  
christophe siraut committed
108
    {% endfor %}
Christophe Siraut's avatar
Christophe Siraut committed
109 110 111 112 113

<!--[if lt IE 8]> 
    <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script> 
<![endif]--> 

christophe siraut's avatar
christophe siraut committed
114
{% endblock %}
Christophe Siraut's avatar
Christophe Siraut committed
115