poll_detail.html 4.4 KB
Newer Older
christophe siraut's avatar
christophe siraut committed
1
{% extends "base.html" %}
2
{% load i18n %}
christophe siraut's avatar
christophe siraut committed
3

4
5
{% block menu %}
    {% if has_voted %}
christophe siraut's avatar
christophe siraut committed
6
        <a title="{% trans "Clear cookie, you will not be able to change your vote." %}" href="/{{object.id}}/clear/">{% trans "Forget me" %}</a>
7
8
9
    {% endif %}
{% endblock %}

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

{% block chapeau %}
    <h3>{{object}}</h3>
christophe siraut's avatar
typos    
christophe siraut committed
14
    <p class="info">
christophe siraut's avatar
christophe siraut committed
15
         {{object.description}} <br /> {% trans "Posted by" %} <code> {{object.author}} </code> {% trans "on" %} <code> {{object.pub_date|date:"d F"}} </code><br /> {% trans "Shared address" %} <input type="text" name="link" value="{{ current_site }}" readonly="readonly" class='adresse' style="border: 1px solid #efefff;" />
christophe siraut's avatar
typos    
christophe siraut committed
16
    </p>
christophe siraut's avatar
christophe siraut committed
17
18
19
20
21
22
23
24
25
26
27

{% endblock %}

{% block content %}
{% if object %}
<table class="bigtable"><tr><td>

    <table>
        <tr><td class='names'></td>

        {% for choice in object.choice_set.all %}
28
            <td class='cell' title="{{ choice.choice|date:"l d F"}}{{ choice.details }}" onmouseover="toggle_visibility('info-{{ choice }}');" onmouseout="toggle_visibility('info-{{ choice }}');"> {{ choice.choice|date:"d-m" }} </td>
christophe siraut's avatar
christophe siraut committed
29
30
31
32
33
34
35
36
37
38
        {% endfor %}
            <td></td>
        </tr>


        {% for bulletin in object.bulletin_set.all %}
        <tr ><td class='names'>{{ bulletin.voter }}</td>
            {% for vote in bulletin.vote_set.all %}
            <td class='cell' title="{{ vote.comment }}" onmouseover="toggle_visibility('info-{{ vote.choice }}');" onmouseout="toggle_visibility('info-{{ vote.choice }}');"><div class="{{ vote.voice }}">{% if vote.comment %} ° {% endif %}</div></td>
            {% endfor %}
39

christophe siraut's avatar
christophe siraut committed
40
41
42
43
44
45
46
47
48
49
        </tr>
        {% endfor %}


        <tr><td class='names'></td>

        {% for choice in object.choice_set.all %}
            <td class='cell' title="{{ choice }}"> {{ choice.votecount }} </td>
        {% endfor %}

christophe siraut's avatar
typos    
christophe siraut committed
50
        </tr>      
christophe siraut's avatar
christophe siraut committed
51
52
53
54
55
56
57
58
59
60
    </table>
</td></tr>

<tr><td>

    <form action="/{{ object.id }}/vote/" method="post">

    <table>

            <tr><td class='names' title="Fill in your name">
61
62
<div class="blue">{% trans "Your name" %}</div>
     {{ form.as_p }}       
christophe siraut's avatar
christophe siraut committed
63
64
65
66
            </td>

      {% for forms in vforms %}
        {{ vforms.management_form }}
christophe siraut's avatar
typos    
christophe siraut committed
67
      {% for form in forms %}     
68
            <td class='cell' title='{% trans "Check the boxes to add a positive answer, you may provide a comment for each choice." %}' />
christophe siraut's avatar
christophe siraut committed
69
70
71
72
73
74
75
76
77
78
79
80
81

                {{ form.voice }}
                {{ form.comment }}
                <div class="hide">
                {{ form.choice }}
                {% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
                </div>
                {{ field.errors }}

            </td>
      {% endfor %}
      {% endfor %}

82
    <td></td>
christophe siraut's avatar
christophe siraut committed
83
    </tr>
84

christophe siraut's avatar
christophe siraut committed
85
86
87
88
89
    </table>

</td></tr>
</table>

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
</td></tr></table>

<br />

<h4>Instructions</h4>
<table class="instructions">
    <tr>
        <td>1. {% trans "Point colums to see choice details and comments" %} </td>
        <td style="border-left: 1px solid #fff;">2. {% trans "Check the boxes for positive answers. " %} {%trans "You may provide a comment for each choice." %}</td>
        <td style="background-color:#fff;"><div style="text-align:center;"><input type="submit" value="Vote" style="padding:5px;margin-right: 5px;width: 70px" /></td><td style="width:1px"></td>
    </tr>
</table>

                 

    </form>

christophe siraut's avatar
christophe siraut committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    <script type="text/javascript">
        <!--
            function toggle_visibility(id) {
               var e = document.getElementById(id);
               if(e.style.display == 'block')
                  e.style.display = 'none';
               else
                  e.style.display = 'block';
            }
        //-->
    </script>

{% else %}

        <p>Poll not available.</p>

{% endif %}

{% endblock %}

{% block helper %}
christophe siraut's avatar
typos    
christophe siraut committed
128
    {% for choice in object.choice_set.all %} 
christophe siraut's avatar
christophe siraut committed
129
        <p class='helper' id='info-{{ choice }}'>
130
        <b> {{ choice.choice|date:"l d F"}} </b> <br /> <span class="blue">{{ choice.details }} </span> <br />
christophe siraut's avatar
christophe siraut committed
131
132
133
134
135

            {% for bulletin in object.bulletin_set.all %}
                {% for vote in bulletin.vote_set.all %}
                    {% ifequal choice vote.choice %}
                        {% if vote.comment %}
136
                            <br /><span><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span>
christophe siraut's avatar
christophe siraut committed
137
138
139
140
141
142
                        {% endif %}
                    {% endifequal %}
                {% endfor %}
            {% endfor %}

        </p>
christophe siraut's avatar
typos    
christophe siraut committed
143
    {% endfor %}
christophe siraut's avatar
christophe siraut committed
144
{% endblock %}