poll_detail.html 4.18 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
{% block title %}nuages - {{object}}{% endblock %}
christophe siraut's avatar
christophe siraut committed
5
6
7

{% block chapeau %}
    <h3>{{object}}</h3>
8
    <p class="info">{{object.description}} <br />{% trans "Posted by" %} <code>{{object.author}}</code> on <code>{{object.pub_date}}</code>. {% trans "Shared address" %}: <input type="text" name="link" value="{{ current_site }}" readonly="readonly" /> </p>
christophe siraut's avatar
christophe siraut committed
9
10
11
12
13
14
15
16
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 %}

            <td class='cell' title="{{ choice.details }}" onmouseover="toggle_visibility('info-{{ choice }}');" onmouseout="toggle_visibility('info-{{ choice }}');"> {{ choice.choice }} </td>

        {% endfor %}
            <td></td>
            <td></td>
            <td>
                <div class="blue" style="text-align:left">
28
                    <small>{% trans "Point colums to see choice details and comments" %}</small><br/>
christophe siraut's avatar
christophe siraut committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
                </div>      
            </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 %}

        </tr>

        {% endfor %}


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

        {% for choice in object.choice_set.all %}

            <td class='cell' title="{{ choice }}"> {{ choice.votecount }} </td>

        {% endfor %}

        </tr>
      
    </table>

</td></tr>

<tr><td>

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

    <table>

            <tr><td class='names' title="Fill in your name">

                {{ form.management_form }}
                {{ form.voter }}
                {% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}

            </td>

      {% for forms in vforms %}
        {{ vforms.management_form }}
      {% for form in forms %}
     
            <td class='cell' title='Check the boxes to add a positive answer, you may provide a comment for each choice.' />

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

            </td>

      {% endfor %}
      {% endfor %}

            <td></td>
            <td></td>
            <td>
                <div class="blue" style="text-align:left">
101
                    <small>{% trans "Check the boxes for positive answers, you may provide a comment for each choice" %}</small><br/>
christophe siraut's avatar
christophe siraut committed
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
                    <input type="submit" value="vote" />
                </div>
        
            </td>
    </tr>
    </table>
    </form>

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


    <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 %}

        {% for choice in object.choice_set.all %}
        
        <p class='helper' id='info-{{ choice }}'>
        <b> {{ choice }} </b> <br /> <span class="blue">{{ choice.details }} </span> <br />

            {% for bulletin in object.bulletin_set.all %}
                {% for vote in bulletin.vote_set.all %}
                    {% ifequal choice vote.choice %}
                        {% if vote.comment %}
                            <br /><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span>
                        {% endif %}
                    {% endifequal %}
                {% endfor %}
            {% endfor %}

        </p>
        {% endfor %}

{% endblock %}