create_poll.tpl 13.2 KB
Newer Older
1
2
{extends file='page.tpl'}

3
4
{block name="header"}
    <script src="{"js/app/create_poll.js"|resource}" type="text/javascript"></script>
5
    <link rel="stylesheet" href="{"css/app/create_poll.css"|resource}">
6
7
{/block}

8
9
10
11
12
13
14
15
16
17
18
{block name=main}
    <div class="row" style="display:none" id="form-block">
        <div class="col-md-8 col-md-offset-2">
            <form name="formulaire" id="formulaire" action="" method="POST" class="form-horizontal" role="form">

                <div class="alert alert-info">
                    <p>
                        {__('Step 1', 'You are in the poll creation section.')}<br/>
                        {__('Step 1', 'Required fields cannot be left blank.')}
                    </p>
                </div>
19

20
21
                <div class="form-group {$errors['name']['class']}">
                    <label for="yourname" class="col-sm-4 control-label">{__('Generic', 'Your name')} *</label>
22
23

                    <div class="col-sm-8">
24
25
26
27
28
                        {if $useRemoteUser}
                            <input type="hidden" name="name" value="{$form->admin_name}" />{$form->admin_name}
                        {else}
                            <input id="yourname" type="text" name="name" class="form-control" {$errors['name']['aria']} value="{$poll_name|html}" />
                        {/if}
29
30
                    </div>
                </div>
31
                {if !empty($errors['name']['msg'])}
32
33
                    <div class="alert alert-danger">
                        <p id="poll_title_error">
34
                            {$errors['name']['msg']}
35
36
37
38
                        </p>
                    </div>
                {/if}

39
40
41
42
43
44
                {if $use_smtp}
                    <div class="form-group {$errors['email']['class']}">
                        <label for="email" class="col-sm-4 control-label">
                            {__('Generic', 'Your email address')} *<br/>
                            <span class="small">{__('Generic', '(in the format name@mail.com)')}</span>
                        </label>
45

46
47
48
49
50
51
                        <div class="col-sm-8">
                            {if $useRemoteUser}
                                <input type="hidden" name="mail" value="{$form->admin_mail}">{$form->admin_mail}
                            {else}
                                <input id="email" type="text" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" />
                            {/if}
52
                        </div>
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
                    </div>
                    {if !empty($errors['email']['msg'])}
                        <div class="alert alert-danger">
                            <p id="poll_title_error">
                                {$errors['email']['msg']}
                            </p>
                        </div>
                    {/if}

                {/if}

                <div class="form-group {$errors['title']['class']}">
                    <label for="poll_title" class="col-sm-4 control-label">{__('Step 1', 'Poll title')} *</label>

                    <div class="col-sm-8">
                        <input id="poll_title" type="text" name="title" class="form-control" {$errors['title']['aria']}
                               value="{$poll_title|html}"/>
70
71
                    </div>
                </div>
72
                {if !empty($errors['title']['msg'])}
73
74
                    <div class="alert alert-danger">
                        <p id="poll_title_error">
75
                            {$errors['title']['msg']}
76
77
78
79
                        </p>
                    </div>
                {/if}

Olivier PEREZ's avatar
Olivier PEREZ committed
80
                <div class="form-group {$errors['description']['class']}">
81
82
83
84
85
                    <label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>

                    <div class="col-sm-8">
                        <textarea id="poll_comments" name="description"
                                  class="form-control" {$errors['description']['aria']}
86
                                  rows="5">{$poll_description|html}</textarea>
87
88
89
90
91
92
93
94
95
96
                    </div>
                </div>
                {if !empty($errors['description']['msg'])}
                    <div class="alert alert-danger">
                        <p id="poll_title_error">
                            {$errors['description']['msg']}
                        </p>
                    </div>
                {/if}

97
98
99
100
101
                <div class="form-group {$errors['id']['class']}">
                    <label for="poll_id" class="col-sm-4 control-label">
                        {__('Step 1', 'Poll id')}<br/>
                        <span id="pollIdDesc" class="small">{__('Step 1', 'Poll id rules')}</span>
                    </label>
102
103

                    <div class="col-sm-8">
104
105
106
107
108
109
110
111
112
113
114
115
                        <div class="input-group">
                            <span class="input-group-addon">
                                <input id="customize_id" name="customize_id" type="checkbox"/>
                            </span>
                            <span class="input-group-addon">
                                {$SERVER_URL}
                            </span>
                            <input id="poll_id" type="text" name="id" class="form-control" {$errors['id']['aria']}
                                   value="{$poll_id|html}" aria-describedBy="pollIdDesc" disabled="disabled" maxlength="64"
                                   pattern="[A-Za-z0-9-]+"/>
                        </div>
                        <span class="help-block text-warning">{__('Step 1', 'Poll id warning')}</span>
116
117
                    </div>
                </div>
118
                {if !empty($errors['id']['msg'])}
119
120
                    <div class="alert alert-danger">
                        <p id="poll_title_error">
121
                            {$errors['id']['msg']}
122
123
124
125
                        </p>
                    </div>
                {/if}

126
                <div class="form-group">
Olivier Perez's avatar
Olivier Perez committed
127
128
129
130
131
                    <label for="poll_id" class="col-sm-4 control-label">
                        {__('Step 1', 'Poll password')}
                    </label>

                    <div class="col-sm-8">
132
133
134
135
136
137
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="use_password" {if $poll_use_password}checked{/if}
                                       id="use_password">
                                {__('Step 1', "Use a password to restrict access")}
                            </label>
138
139
                        </div>
                    </div>
Olivier Perez's avatar
Olivier Perez committed
140

141
                    <div id="password_options"{if !$poll_use_password} class="hidden"{/if}>
Olivier Perez's avatar
Olivier Perez committed
142
143
144
145
146
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="input-group">
                                <input id="poll_password" type="password" name="password" class="form-control" {$errors['password']['aria']}/>
                                <label for="poll_password" class="input-group-addon">{__('Step 1', 'Password choice')}</label>
                            </div>
147
                        </div>
148
149
150
151
152
153
154
                        {if !empty($errors['password']['msg'])}
                            <div class="alert alert-danger">
                                <p id="poll_password_error">
                                    {$errors['password']['msg']}
                                </p>
                            </div>
                        {/if}
Olivier Perez's avatar
Olivier Perez committed
155
156
157
158
159
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="input-group">
                                <input id="poll_password_repeat" type="password" name="password_repeat" class="form-control" {$errors['password_repeat']['aria']}/>
                                <label for="poll_password_repeat" class="input-group-addon">{__('Step 1', 'Password confirmation')}</label>
                            </div>
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
                        </div>
                        {if !empty($errors['password_repeat']['msg'])}
                            <div class="alert alert-danger">
                                <p id="poll_password_repeat_error">
                                    {$errors['password_repeat']['msg']}
                                </p>
                            </div>
                        {/if}
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="results_publicly_visible"
                                           {if $poll_results_publicly_visible}checked{/if} id="results_publicly_visible"/>
                                    {__('Step 1', "The results are publicly visible")}
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
179
180

                <div class="form-group">
Olivier Perez's avatar
Olivier Perez committed
181
182
183
184
                    <label for="poll_id" class="col-sm-4 control-label">
                        {__('Step 1', 'Permissions')}
                    </label>
                    <div class="col-sm-8">
185
186
                        <div class="radio">
                            <label>
187
                                <input type="radio" name="editable" id="editableByAll" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_ALL")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_ALL")}">
188
                                {__('Step 1', 'All voters can modify any vote')}
189
190
191
                            </label>
                            <label>
                                <input type="radio" name="editable" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_OWN")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_OWN")}">
192
                                {__('Step 1', 'Voters can modify their vote themselves')}
193
                            </label>
194
195
                            <label>
                                <input type="radio" name="editable" {if empty($poll_editable) or $poll_editable==constant("Framadate\Editable::NOT_EDITABLE")}checked{/if} value="{constant("Framadate\Editable::NOT_EDITABLE")}">
196
                                {__('Step 1', 'Votes cannot be modified')}
197
                            </label>
198
199
200
201
202
203
204
205
206
207
                        </div>
                    </div>
                </div>


                {if $use_smtp}
                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="checkbox">
                                <label>
208
                                    <input type="checkbox" name="receiveNewVotes" {if $poll_receiveNewVotes}checked{/if}
209
                                    id="receiveNewVotes">
210
                                    {__('Step 1', 'To receive an email for each new vote')}
211
212
213
214
215
216
217
218
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-8">
                            <div class="checkbox">
                                <label>
219
                                    <input type="checkbox" name="receiveNewComments" {if $poll_receiveNewComments}checked{/if}
220
                                    id="receiveNewComments">
221
                                    {__('Step 1', 'To receive an email for each new comment')}
222
223
224
225
                                </label>
                            </div>
                        </div>
                    </div>
Antonin's avatar
Antonin committed
226
                {/if}
227
228
229
230
231
232
233

                <div class="form-group">
                    <div class="col-sm-offset-4 col-sm-8">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="hidden" {if $poll_hidden}checked{/if}
                                id="hidden">
234
                                {__('Step 1', "Only the poll maker can see the poll's results")}
235
236
237
238
                            </label>
                        </div>
                        <div id="hiddenWithBadEditionModeError" class="alert alert-danger hidden">
                            <p>
239
                                {__('Error', "You can't create a poll with hidden results with the following edition option:")}"{__('Step 1', 'All voters can modify any vote')}"
240
                            </p>
241
242
                        </div>
                    </div>
243
244
                </div>

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
                <p class="text-right">
                    <input type="hidden" name="type" value="$poll_type"/>
                    <button name="{$goToStep2}" value="{$poll_type}" type="submit"
                            class="btn btn-success">{__('Step 1', 'Go to step 2')}</button>
                </p>

                <script type="text/javascript">document.formulaire.title.focus();</script>

            </form>
        </div>
    </div>
    <noscript>
        <div class="alert alert-danger">
            {__('Step 1', 'Javascript is disabled on your browser. Its activation is required to create a poll.')}
        </div>
    </noscript>
    <div id="cookie-warning" class="alert alert-danger" style="display:none">
        {__('Step 1', 'Cookies are disabled on your browser. Theirs activation is required to create a poll.')}
    </div>
264
{/block}