~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
101
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
<html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:tal="http://xml.zope.org/namespaces/tal"
  xmlns:metal="http://xml.zope.org/namespaces/metal"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  metal:use-macro="view/macro:page/main_only"
  i18n:domain="launchpad"
>
<body>

  <tal:heading metal:fill-slot="heading">
    <h1 tal:content="context/title">Mozilla</h1>
  </tal:heading>

  <div metal:fill-slot="main">

    <tal:open-poll condition="context/isOpen">
    <tal:can-vote condition="view/userCanVote">
    <p
      tal:condition="view/feedback"
      tal:content="view/feedback"
      class="informational message"
    />

    <div class="highlighted" style="font-size: 80%;">
      <tal:proposition replace="structure context/proposition/fmt:text-to-html">
         The proposition goes here.
      </tal:proposition>
    </div>

    <form action="" method="POST">

    <tal:block condition="view/userVoted">
      <tal:block condition="view/isSecret">
        <h2>You must enter your vote key</h2>

        <p>This is a secret poll &mdash;
        your vote is identified only by the key you
        were given when you voted. To view or change your vote you must enter
        your key:</p>

        <input type="text" name="token" 
               tal:attributes="value view/token|nothing" />
        <br />
        <br />
      </tal:block>
    </tal:block>

    <table cols="2" id="your-vote">
      <tr>
        <td>
          <h2>Your current vote</h2>
          <tal:block condition="not: view/userVoted">
            <p>You have not yet voted in this poll.</p>
          </tal:block>

          <tal:block condition="view/userVoted">
            <tal:block condition="view/gotTokenAndVotes">
              <tal:block condition="view/currentVotes">
                <p>Your current vote is as follows:</p>
                <p tal:repeat="vote view/currentVotes">
                  <tal:block tal:condition="vote/preference">
                    <b tal:content="vote/preference" />. 
                    <span tal:replace="vote/option/name" />
                  </tal:block>
                </p>
              </tal:block>

              <tal:block condition="not: view/currentVotes">
                <p>You haven't manifested preference for any of the existing
                options.</p> 
              </tal:block>
            </tal:block>

            <tal:block condition="not: view/gotTokenAndVotes">
              <p>You have voted in this poll. Launchpad can display your vote
              once you have entered your vote key.</p>

              <input type="submit" value="Show My Vote" name="showvote" />
            </tal:block>
          </tal:block>
        </td>
        <td>
          <tal:block condition="not: view/userVoted">
            <h2>Rank options in order of preference</h2>
          </tal:block>

          <tal:block condition="view/userVoted">
            <h2>Change your vote</h2>
          </tal:block>

          <p>Enter 1 next to your most preferred option, 2 next to your second
          preference, and so on. You may mark two or more options equally, or
          leave some options unmarked, if desired.</p>

          <tal:block repeat="option context/getActiveOptions">
            <input type="text" size="2" 
                   tal:attributes="name string:option_${option/id}" />
            <span tal:replace="option/name" />
            <br />
          </tal:block>
          <br />

          <tal:block condition="view/userVoted">
            <input type="submit" value="Change Vote" name="changevote" />
          </tal:block>

          <tal:block condition="not: view/userVoted">
            <input type="submit" value="Vote" name="vote" />
          </tal:block>
          or <a tal:attributes="href context/team/fmt:url/+polls">Cancel</a>
        </td>
      </tr>
    </table>
    </form>
    </tal:can-vote>

    <p tal:condition="not: view/userCanVote" class="informational message">
      You can&#8217;t vote in this poll because you&#8217;re not
      a member of <span tal:replace="context/team/displayname" />.
    </p>
    </tal:open-poll> 

    <p tal:condition="not: context/isOpen" class="informational message">
      This poll is already closed.
    </p>

  </div>
</body>
</html>