Merge lp:~ronnie.vd.c/ubuntu-elections/new-interface into lp:ubuntu-elections
- new-interface
- Merge into trunk
Proposed by
Ronnie
Status: | Merged |
---|---|
Merged at revision: | 30 |
Proposed branch: | lp:~ronnie.vd.c/ubuntu-elections/new-interface |
Merge into: | lp:ubuntu-elections |
Diff against target: |
2340 lines (+1261/-487) 29 files modified
media/css/voting.css (+363/-68) media/js/colortip-1.0-jquery.js (+8/-10) ubuntu_voting/elections/forms.py (+9/-0) ubuntu_voting/elections/migrations/0009_auto__add_office__add_field_election_slug.py (+108/-0) ubuntu_voting/elections/migrations/0010_name_to_slug.py (+100/-0) ubuntu_voting/elections/migrations/0011_auto__chg_field_election_slug__add_unique_election_slug.py (+103/-0) ubuntu_voting/elections/models.py (+17/-2) ubuntu_voting/elections/urls.py (+10/-10) ubuntu_voting/elections/views.py (+27/-24) ubuntu_voting/locale/nl/LC_MESSAGES/django.po (+236/-152) ubuntu_voting/settings.py (+4/-0) ubuntu_voting/templates/403.html (+1/-1) ubuntu_voting/templates/404.html (+1/-1) ubuntu_voting/templates/500.html (+1/-1) ubuntu_voting/templates/base.html (+70/-39) ubuntu_voting/templates/election/election_candidature.html (+14/-9) ubuntu_voting/templates/election/election_detail.html (+16/-52) ubuntu_voting/templates/election/election_edit.html (+13/-9) ubuntu_voting/templates/election/election_list.html (+10/-59) ubuntu_voting/templates/election/election_new.html (+15/-10) ubuntu_voting/templates/election/election_results.html (+19/-25) ubuntu_voting/templates/election/election_vote.html (+14/-9) ubuntu_voting/templates/election/incl_election_item_candidate.html (+18/-0) ubuntu_voting/templates/election/incl_election_item_election.html (+18/-0) ubuntu_voting/templates/election/incl_election_item_pre_candidate.html (+17/-0) ubuntu_voting/templates/election/incl_election_item_pre_election.html (+17/-0) ubuntu_voting/templates/election/incl_election_item_results.html (+22/-0) ubuntu_voting/templates/form.html (+4/-3) ubuntu_voting/urls.py (+6/-3) |
To merge this branch: | bzr merge lp:~ronnie.vd.c/ubuntu-elections/new-interface |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Elections System Developers | Pending | ||
Review via email: mp+82781@code.launchpad.net |
Commit message
Description of the change
Loads of changes:
- Url has now slugs instead of name. the pk is not included because slug is set to unique
- Page layout updated
- language is forced to the LANGUAGES list in settings.py
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'media/css/voting.css' |
2 | --- media/css/voting.css 2011-03-05 13:55:34 +0000 |
3 | +++ media/css/voting.css 2011-11-19 16:23:22 +0000 |
4 | @@ -1,13 +1,142 @@ |
5 | +body { |
6 | + font-family: 'Ubuntu','Ubuntubeta','Bitstream Vera Sans','DejaVu Sans',Tahoma,sans-serif; |
7 | + background: url("../img/dotted.png") repeat scroll 0 0 #F7F7F7; |
8 | +} |
9 | + |
10 | +a:visited { |
11 | + color: #DD4814; |
12 | +} |
13 | + |
14 | +#page-header { |
15 | + background-image: none; |
16 | + box-shadow: 0 1px 1px #C8C8C8; |
17 | + height: 65px; |
18 | +} |
19 | + |
20 | + |
21 | +#main-nav { |
22 | + width: auto; |
23 | + max-width: 770px; |
24 | + border-left: none; |
25 | + height: 65px; |
26 | +} |
27 | + |
28 | +#main-nav:before { |
29 | + content: url('../img/topnav_divider.png'); |
30 | + float: left; |
31 | +} |
32 | + |
33 | +#main-nav:after { |
34 | + content: url('../img/topnav_divider.png'); |
35 | + float: left; |
36 | +} |
37 | + |
38 | +.main-nav-item, .main-nav-item:visited { |
39 | + border-right: none; |
40 | + line-height: 65px; |
41 | + height: 65px; |
42 | +} |
43 | + |
44 | +#top-logo { |
45 | + margin-top: 0; |
46 | +} |
47 | + |
48 | +#page-related { |
49 | + width: 100%; |
50 | + margin: 2px 0 20px 0; |
51 | + padding: 0; |
52 | + background-color: #F7F7F7; |
53 | + box-shadow: 0 1px 1px #DFDFDF; |
54 | +} |
55 | + |
56 | +#sub-nav-container { |
57 | + width: 980px; |
58 | + padding: 0; |
59 | + margin: 0 auto; |
60 | + border-radius: 0; |
61 | + box-shadow: none; |
62 | +} |
63 | + |
64 | + |
65 | #page-footer { |
66 | width: 980px; |
67 | - margin: 0 auto; |
68 | + margin: 20px auto 0; |
69 | } |
70 | |
71 | #main-section .container { |
72 | - min-height: 200px; |
73 | -} |
74 | - |
75 | - |
76 | + background-color: transparent; |
77 | + padding: 0; |
78 | + width: 980px; |
79 | +} |
80 | + |
81 | +.content { |
82 | + background-color: #FFFFFF; |
83 | + border-radius: 4px; |
84 | + box-shadow: 1px 1px 2px #CCCCCC; |
85 | + margin: 10px 0; |
86 | +} |
87 | + |
88 | +.content-inner { |
89 | + padding: 10px 10px 10px 20px; |
90 | +} |
91 | + |
92 | +.content-inner h2 { |
93 | + margin-top: 0px; |
94 | +} |
95 | + |
96 | +.content-medium { |
97 | + width: 650px; |
98 | +} |
99 | + |
100 | +.content-small { |
101 | + width: 310px; |
102 | + margin-left: 20px; |
103 | +} |
104 | + |
105 | +.content-left { |
106 | + float: left; |
107 | +} |
108 | + |
109 | +.content-right { |
110 | + float: right; |
111 | +} |
112 | + |
113 | +.button { |
114 | + background-color: #DD4814; |
115 | + border: none; |
116 | + color: #FFFFFF; |
117 | + padding: 8px 10px; |
118 | + border-radius: 4px; |
119 | + text-shadow: 1px 1px 1px #333; |
120 | + font-size: 16px; |
121 | + line-height: 20px; |
122 | +} |
123 | +a.button:visited { |
124 | + color: #FFFFFF; |
125 | +} |
126 | + |
127 | +.button-right { |
128 | + float: right; |
129 | +} |
130 | + |
131 | +.button-bar { |
132 | + background-color: #F7F7F7; |
133 | + padding: 5px 5px 5px 20px; |
134 | + border-radius: 0 0 4px 4px; |
135 | +} |
136 | + |
137 | +.button-bar:after { |
138 | + content: ""; |
139 | + clear: both; |
140 | + display: block; |
141 | +} |
142 | + |
143 | +.button-bar .countdown { |
144 | + float: left; |
145 | + font-size: 24px; |
146 | + line-height:28px; |
147 | + padding: 5px 0; |
148 | +} |
149 | |
150 | ul.messages { |
151 | list-style-type: none; |
152 | @@ -20,72 +149,64 @@ |
153 | |
154 | } |
155 | |
156 | -form input[type="text"], form input[type="password"] { |
157 | - background-color: #F0F0F0; |
158 | - border: 1px solid #CCCCCC; |
159 | - height: 16px; |
160 | - padding: 3px; |
161 | - width: 180px; |
162 | - margin: 0 0 0 10px; |
163 | -} |
164 | - |
165 | -form input, form select { |
166 | - margin: 0 0 0 10px; |
167 | -} |
168 | - |
169 | -form input[type="text"].small { |
170 | - width: 80px; |
171 | -} |
172 | - |
173 | -form input.date, form input.time { |
174 | - width: 80px; |
175 | -} |
176 | - |
177 | -.ui-widget { |
178 | +form { |
179 | + width: 100%; |
180 | + position: relative; |
181 | +} |
182 | + |
183 | +form fieldset { |
184 | + background-color: transparent; |
185 | +} |
186 | +form input[type="submit"] { |
187 | + float: right; |
188 | + display: inline-block; /* for IE/Mac */ |
189 | +} |
190 | +form input[type="submit"]:after { |
191 | + content: "."; |
192 | + display: block; |
193 | + height: 0; |
194 | + clear: both; |
195 | + visibility: hidden; |
196 | +} |
197 | + |
198 | +form input[type="text"].small, |
199 | +form input.date, |
200 | +form input.time { |
201 | + width: 80px; |
202 | +} |
203 | + |
204 | +form input[type="text"].small:focus, |
205 | +form input.date:focus, |
206 | +form input.time:focus { |
207 | + width: 78px; |
208 | +} |
209 | + |
210 | +.ui-widget, |
211 | +#ui-datepicker-div.ui-widget { |
212 | font-size: 0.8em; |
213 | } |
214 | |
215 | - |
216 | -.errorlist li { |
217 | - color: #DD4814; |
218 | -} |
219 | - |
220 | -form select { |
221 | - height: 24px; |
222 | - width: 180px; |
223 | -} |
224 | - |
225 | -form ul { |
226 | - list-style: none; |
227 | -} |
228 | - |
229 | -form .form-item { |
230 | - margin: 14px 0; |
231 | -} |
232 | - |
233 | -form .required { |
234 | - margin: 0 8px; |
235 | - color: #DD4814; |
236 | -} |
237 | - |
238 | -form .help img { |
239 | - height: 16px; |
240 | - vertical-align: middle; |
241 | -} |
242 | - |
243 | -label { |
244 | - width: 180px; |
245 | - display: inline-block; |
246 | - padding-right: 10px; |
247 | -} |
248 | - |
249 | -form.small input[type="submit"] { |
250 | - margin-right: 50px; |
251 | - float: right; |
252 | -} |
253 | - |
254 | -form.small .help { |
255 | - float: right; |
256 | +.login { |
257 | + background-color: #F7F7F7; |
258 | + border-radius: 4px 4px 0 0; |
259 | + padding: 5px 10px 5px 20px; |
260 | +} |
261 | + |
262 | +.login-button, |
263 | +.logout-button { |
264 | + float: right; |
265 | +} |
266 | +.login-button:hover, |
267 | +.logout-button:hover { |
268 | + text-decoration: underline; |
269 | +} |
270 | + |
271 | + |
272 | +/* Menu right */ |
273 | + |
274 | +.content-small.content-right .sub-nav-item { |
275 | + float: none; |
276 | + padding: 0; |
277 | } |
278 | |
279 | /* Election details */ |
280 | @@ -137,3 +258,177 @@ |
281 | .graph-label-1 { |
282 | color: #DD4814; |
283 | } |
284 | + |
285 | + |
286 | +/* Form CSS */ |
287 | +form { |
288 | + margin: 20px auto 60px; |
289 | +} |
290 | + |
291 | +form ul { |
292 | + list-style-type: none; |
293 | +} |
294 | + |
295 | +form li.form-item { |
296 | + clear: both; |
297 | +} |
298 | + |
299 | +form .error { |
300 | + width: 184px; /* 224 - 30 */ |
301 | + font-size: 12px; |
302 | + height: 20px; |
303 | + display: inline-block; |
304 | + padding-left: 30px; |
305 | + background-image: url('../images/error.png'); |
306 | + background-repeat: no-repeat; |
307 | + line-height: 1.2em; |
308 | +} |
309 | + |
310 | +form .help { |
311 | + position: absolute; |
312 | + z-index: 10; |
313 | + right: 16px; |
314 | + background-image: url('../images/help.png'); |
315 | + background-repeat: no-repeat; |
316 | + width: 20px; |
317 | +} |
318 | + |
319 | +form .smalltext { |
320 | + font-size: 10px; |
321 | + line-height: 14px; |
322 | + color: #333333; |
323 | +} |
324 | + |
325 | +label { |
326 | + clear: both; |
327 | + display: block; |
328 | + font-size: 12px; |
329 | + line-height: 16px; |
330 | + color: #333333; |
331 | + margin-bottom: 4px; |
332 | +} |
333 | + |
334 | +label.required:after { |
335 | + color: #DD4814; |
336 | + content: " *"; |
337 | +} |
338 | + |
339 | +label.inline { |
340 | + display: inline-block; |
341 | + vertical-align: middle; |
342 | +} |
343 | + |
344 | +legend { |
345 | + width: 100%; |
346 | + position: relative; |
347 | + background-color: #aea79f; |
348 | + font-size: 16px; |
349 | + line-height: 16px; |
350 | + font-weight: normal; |
351 | + color: #ffffff; |
352 | + padding: 8px; |
353 | + margin: 0 -8px; |
354 | +} |
355 | + |
356 | +legend span.supporting { |
357 | + position: absolute; |
358 | + right: 8px; |
359 | + font-size: 12px; |
360 | + line-height: 16px; |
361 | + color: #ffffff; |
362 | +} |
363 | + |
364 | +legend span.supporting:before { |
365 | + color: #DD4814; |
366 | + content: "* "; |
367 | +} |
368 | + |
369 | +fieldset { |
370 | + position: relative; |
371 | + margin-bottom: 16px; |
372 | + padding: 8px; |
373 | + background-color: #dfdcd9; |
374 | +} |
375 | + |
376 | +input, select, textarea, .mceEditor { |
377 | + float: left; |
378 | + display: block; |
379 | +} |
380 | + |
381 | +input[type="text"], input[type="password"], select, .mceEditor { |
382 | + font-size: 12px; |
383 | + color: #333333; |
384 | + border: 1px solid #ccc1c1; |
385 | + background-color: white; |
386 | + width: 286px; |
387 | + height: 20px; |
388 | + margin-right: 16px; |
389 | + margin-bottom: 8px; |
390 | +} |
391 | + |
392 | +.mceEditor { |
393 | + border: 0; |
394 | + height: 255px; |
395 | + width: 400px; |
396 | +} |
397 | + |
398 | +input[type="checkbox"], input[type="radio"] { |
399 | + margin-top: 0px; |
400 | + margin-bottom: 8px; |
401 | +} |
402 | + |
403 | +input[type="text"]:focus, input[type="password"]:focus { |
404 | + border: 2px solid #dd4814; |
405 | + width: 284px; |
406 | + height: 18px; |
407 | + color: #333333; |
408 | +} |
409 | + |
410 | +select:focus { |
411 | + border: 2px solid #dd4814; |
412 | + color: #333333; |
413 | +} |
414 | + |
415 | + |
416 | +input[type="text"].small, input[type="password"].small, select.small { |
417 | + width: 134px; |
418 | +} |
419 | + |
420 | +input[type="text"].small:focus, input[type="password"].small:focus, select.small:focus { |
421 | + width: 132px; |
422 | +} |
423 | + |
424 | +input[type="text"].error, input[type="password"].error, select.error { |
425 | + border: 2px solid #dd4814; |
426 | + color: #dd4814; |
427 | +} |
428 | + |
429 | +input[type="submit"] { |
430 | + padding: 10px 8px; |
431 | + border-radius: 4px; |
432 | + background: #dd4814 url('../images/gradient.png') repeat-x; |
433 | + color: #ffffff; |
434 | + font-size: 16px; |
435 | + line-height: 20px; |
436 | + border: none; |
437 | + text-shadow: black 0px 1px 2px; |
438 | +} |
439 | + |
440 | +input[type="submit"]:hover { |
441 | + background-color: #b83a0f; |
442 | +} |
443 | + |
444 | +input[type="submit"]:active { |
445 | + background-color: #962d0c; |
446 | +} |
447 | + |
448 | +form ul.errorlist { |
449 | + display: block; |
450 | + float: left; |
451 | + line-height: 1em; |
452 | + vertical-align: top; |
453 | +} |
454 | + |
455 | +form ul.errorlist li { |
456 | + color: #DD4814; |
457 | +} |
458 | |
459 | === added file 'media/img/dotted.png' |
460 | Binary files media/img/dotted.png 1970-01-01 00:00:00 +0000 and media/img/dotted.png 2011-11-19 16:23:22 +0000 differ |
461 | === added file 'media/img/topnav_divider.png' |
462 | Binary files media/img/topnav_divider.png 1970-01-01 00:00:00 +0000 and media/img/topnav_divider.png 2011-11-19 16:23:22 +0000 differ |
463 | === modified file 'media/js/colortip-1.0-jquery.js' |
464 | --- media/js/colortip-1.0-jquery.js 2011-02-16 21:17:38 +0000 |
465 | +++ media/js/colortip-1.0-jquery.js 2011-11-19 16:23:22 +0000 |
466 | @@ -55,7 +55,7 @@ |
467 | // On mouseenter, show the tip, on mouseleave set the |
468 | // tip to be hidden in half a second. |
469 | |
470 | - elem.hover(function(){ |
471 | + elem.click(function(){ |
472 | |
473 | tip.show(); |
474 | |
475 | @@ -63,16 +63,14 @@ |
476 | // clear the previously set event: |
477 | |
478 | scheduleEvent.clear(); |
479 | - |
480 | - },function(){ |
481 | - |
482 | - // Schedule event actualy sets a timeout (as you can |
483 | - // see from the class definition below). |
484 | + elem.mouseleave(function(){ |
485 | + // Schedule event actualy sets a timeout (as you can |
486 | + // see from the class definition below). |
487 | |
488 | - scheduleEvent.set(function(){ |
489 | - tip.hide(); |
490 | - },settings.timeout); |
491 | - |
492 | + scheduleEvent.set(function(){ |
493 | + tip.hide(); |
494 | + },settings.timeout); |
495 | + }); |
496 | }); |
497 | |
498 | // Removing the title attribute, so the regular OS titles are |
499 | |
500 | === modified file 'ubuntu_voting/elections/forms.py' |
501 | --- ubuntu_voting/elections/forms.py 2011-09-21 17:18:11 +0000 |
502 | +++ ubuntu_voting/elections/forms.py 2011-11-19 16:23:22 +0000 |
503 | @@ -1,4 +1,5 @@ |
504 | from django import forms |
505 | +from django.template.defaultfilters import slugify |
506 | |
507 | from common.forms import RenderableMixin |
508 | from common.widgets import SplitDateTimeWidget |
509 | @@ -8,6 +9,7 @@ |
510 | class CreateElectionForm(forms.ModelForm, RenderableMixin): |
511 | class Meta: |
512 | model = Election |
513 | + exclude = ('slug',) |
514 | |
515 | def __init__(self, *args, **kwargs): |
516 | super(CreateElectionForm, self).__init__(*args, **kwargs) |
517 | @@ -43,6 +45,13 @@ |
518 | # Always return the full collection of cleaned data. |
519 | return cleaned_data |
520 | |
521 | + def save(self, *args, **kwargs): |
522 | + election = super(CreateElectionForm, self).save(commit=False, *args, **kwargs) |
523 | + election.slug = slugify(election.name) |
524 | + if kwargs.get('commit', True) is True: |
525 | + election.save() |
526 | + return election |
527 | + |
528 | |
529 | class ApplyForElectionForm(forms.ModelForm, RenderableMixin): |
530 | class Meta: |
531 | |
532 | === added file 'ubuntu_voting/elections/migrations/0009_auto__add_office__add_field_election_slug.py' |
533 | --- ubuntu_voting/elections/migrations/0009_auto__add_office__add_field_election_slug.py 1970-01-01 00:00:00 +0000 |
534 | +++ ubuntu_voting/elections/migrations/0009_auto__add_office__add_field_election_slug.py 2011-11-19 16:23:22 +0000 |
535 | @@ -0,0 +1,108 @@ |
536 | +# encoding: utf-8 |
537 | +import datetime |
538 | +from south.db import db |
539 | +from south.v2 import SchemaMigration |
540 | +from django.db import models |
541 | + |
542 | +class Migration(SchemaMigration): |
543 | + |
544 | + def forwards(self, orm): |
545 | + |
546 | + # Adding model 'Office' |
547 | + db.create_table('elections_office', ( |
548 | + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
549 | + ('office', self.gf('django.db.models.fields.CharField')(max_length=128)), |
550 | + ('description', self.gf('tinymce.models.HTMLField')()), |
551 | + )) |
552 | + db.send_create_signal('elections', ['Office']) |
553 | + |
554 | + # Adding field 'Election.slug' |
555 | + db.add_column('elections_election', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=128, unique=True, null=True, db_index=True), keep_default=False) |
556 | + |
557 | + |
558 | + def backwards(self, orm): |
559 | + |
560 | + # Deleting model 'Office' |
561 | + db.delete_table('elections_office') |
562 | + |
563 | + # Deleting field 'Election.slug' |
564 | + db.delete_column('elections_election', 'slug') |
565 | + |
566 | + |
567 | + models = { |
568 | + 'auth.group': { |
569 | + 'Meta': {'object_name': 'Group'}, |
570 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
571 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), |
572 | + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) |
573 | + }, |
574 | + 'auth.permission': { |
575 | + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, |
576 | + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
577 | + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), |
578 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
579 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
580 | + }, |
581 | + 'auth.user': { |
582 | + 'Meta': {'object_name': 'User'}, |
583 | + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
584 | + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), |
585 | + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
586 | + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), |
587 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
588 | + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), |
589 | + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
590 | + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
591 | + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
592 | + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
593 | + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), |
594 | + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), |
595 | + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) |
596 | + }, |
597 | + 'contenttypes.contenttype': { |
598 | + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, |
599 | + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
600 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
601 | + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
602 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
603 | + }, |
604 | + 'elections.candidate': { |
605 | + 'Meta': {'ordering': "['display_name']", 'unique_together': "(('user', 'election'),)", 'object_name': 'Candidate'}, |
606 | + 'chair_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
607 | + 'chair_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
608 | + 'council_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
609 | + 'council_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
610 | + 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), |
611 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
612 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
613 | + 'lp_profile': ('django.db.models.fields.URLField', [], {'max_length': '200'}), |
614 | + 'motivation': ('tinymce.models.HTMLField', [], {}), |
615 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) |
616 | + }, |
617 | + 'elections.election': { |
618 | + 'Meta': {'ordering': "['candidature_start', 'election_start', 'election_end', 'name']", 'object_name': 'Election'}, |
619 | + 'candidature_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 38, 41, 658622)'}), |
620 | + 'candidature_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 11, 18, 20, 38, 41, 658576)'}), |
621 | + 'description': ('tinymce.models.HTMLField', [], {}), |
622 | + 'election_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 23, 20, 38, 41, 658706)'}), |
623 | + 'election_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 38, 41, 658671)'}), |
624 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
625 | + 'live_results': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
626 | + 'name': ('django.db.models.fields.CharField', [], {'default': "u'Election'", 'max_length': '128'}), |
627 | + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'unique': 'True', 'null': 'True', 'db_index': 'True'}) |
628 | + }, |
629 | + 'elections.office': { |
630 | + 'Meta': {'object_name': 'Office'}, |
631 | + 'description': ('tinymce.models.HTMLField', [], {}), |
632 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
633 | + 'office': ('django.db.models.fields.CharField', [], {'max_length': '128'}) |
634 | + }, |
635 | + 'elections.voter': { |
636 | + 'Meta': {'unique_together': "(('voter', 'election'),)", 'object_name': 'Voter'}, |
637 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
638 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
639 | + 'voter': ('django.db.models.fields.CharField', [], {'max_length': '250'}) |
640 | + } |
641 | + } |
642 | + |
643 | + complete_apps = ['elections'] |
644 | |
645 | === added file 'ubuntu_voting/elections/migrations/0010_name_to_slug.py' |
646 | --- ubuntu_voting/elections/migrations/0010_name_to_slug.py 1970-01-01 00:00:00 +0000 |
647 | +++ ubuntu_voting/elections/migrations/0010_name_to_slug.py 2011-11-19 16:23:22 +0000 |
648 | @@ -0,0 +1,100 @@ |
649 | +# encoding: utf-8 |
650 | +import datetime |
651 | +from south.db import db |
652 | +from south.v2 import DataMigration |
653 | +from django.db import models |
654 | +from django.template.defaultfilters import slugify |
655 | + |
656 | +class Migration(DataMigration): |
657 | + |
658 | + def forwards(self, orm): |
659 | + "Write your forwards methods here." |
660 | + for election in orm.election.objects.all(): |
661 | + election.slug = slugify(election.name) |
662 | + election.save() |
663 | + |
664 | + |
665 | + def backwards(self, orm): |
666 | + "Write your backwards methods here." |
667 | + for election in orm.election.objects.all(): |
668 | + election.slug = "" |
669 | + election.save() |
670 | + |
671 | + |
672 | + models = { |
673 | + 'auth.group': { |
674 | + 'Meta': {'object_name': 'Group'}, |
675 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
676 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), |
677 | + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) |
678 | + }, |
679 | + 'auth.permission': { |
680 | + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, |
681 | + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
682 | + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), |
683 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
684 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
685 | + }, |
686 | + 'auth.user': { |
687 | + 'Meta': {'object_name': 'User'}, |
688 | + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
689 | + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), |
690 | + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
691 | + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), |
692 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
693 | + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), |
694 | + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
695 | + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
696 | + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
697 | + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
698 | + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), |
699 | + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), |
700 | + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) |
701 | + }, |
702 | + 'contenttypes.contenttype': { |
703 | + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, |
704 | + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
705 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
706 | + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
707 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
708 | + }, |
709 | + 'elections.candidate': { |
710 | + 'Meta': {'ordering': "['display_name']", 'unique_together': "(('user', 'election'),)", 'object_name': 'Candidate'}, |
711 | + 'chair_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
712 | + 'chair_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
713 | + 'council_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
714 | + 'council_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
715 | + 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), |
716 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
717 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
718 | + 'lp_profile': ('django.db.models.fields.URLField', [], {'max_length': '200'}), |
719 | + 'motivation': ('tinymce.models.HTMLField', [], {}), |
720 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) |
721 | + }, |
722 | + 'elections.election': { |
723 | + 'Meta': {'ordering': "['candidature_start', 'election_start', 'election_end', 'name']", 'object_name': 'Election'}, |
724 | + 'candidature_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 31, 22, 541910)'}), |
725 | + 'candidature_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 11, 18, 20, 31, 22, 541866)'}), |
726 | + 'description': ('tinymce.models.HTMLField', [], {}), |
727 | + 'election_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 23, 20, 31, 22, 541995)'}), |
728 | + 'election_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 31, 22, 541958)'}), |
729 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
730 | + 'live_results': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
731 | + 'name': ('django.db.models.fields.CharField', [], {'default': "u'Election'", 'max_length': '128'}), |
732 | + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'}) |
733 | + }, |
734 | + 'elections.office': { |
735 | + 'Meta': {'object_name': 'Office'}, |
736 | + 'description': ('tinymce.models.HTMLField', [], {}), |
737 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
738 | + 'office': ('django.db.models.fields.CharField', [], {'max_length': '128'}) |
739 | + }, |
740 | + 'elections.voter': { |
741 | + 'Meta': {'unique_together': "(('voter', 'election'),)", 'object_name': 'Voter'}, |
742 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
743 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
744 | + 'voter': ('django.db.models.fields.CharField', [], {'max_length': '250'}) |
745 | + } |
746 | + } |
747 | + |
748 | + complete_apps = ['elections'] |
749 | |
750 | === added file 'ubuntu_voting/elections/migrations/0011_auto__chg_field_election_slug__add_unique_election_slug.py' |
751 | --- ubuntu_voting/elections/migrations/0011_auto__chg_field_election_slug__add_unique_election_slug.py 1970-01-01 00:00:00 +0000 |
752 | +++ ubuntu_voting/elections/migrations/0011_auto__chg_field_election_slug__add_unique_election_slug.py 2011-11-19 16:23:22 +0000 |
753 | @@ -0,0 +1,103 @@ |
754 | +# encoding: utf-8 |
755 | +import datetime |
756 | +from south.db import db |
757 | +from south.v2 import SchemaMigration |
758 | +from django.db import models |
759 | + |
760 | +class Migration(SchemaMigration): |
761 | + |
762 | + def forwards(self, orm): |
763 | + |
764 | + # Changing field 'Election.slug' |
765 | + db.alter_column('elections_election', 'slug', self.gf('django.db.models.fields.SlugField')(default='Datamigration has failed', unique=True, max_length=128)) |
766 | + |
767 | + # Adding unique constraint on 'Election', fields ['slug'] |
768 | + db.create_unique('elections_election', ['slug']) |
769 | + |
770 | + |
771 | + def backwards(self, orm): |
772 | + |
773 | + # Removing unique constraint on 'Election', fields ['slug'] |
774 | + db.delete_unique('elections_election', ['slug']) |
775 | + |
776 | + # Changing field 'Election.slug' |
777 | + db.alter_column('elections_election', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=128, null=True)) |
778 | + |
779 | + |
780 | + models = { |
781 | + 'auth.group': { |
782 | + 'Meta': {'object_name': 'Group'}, |
783 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
784 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), |
785 | + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) |
786 | + }, |
787 | + 'auth.permission': { |
788 | + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, |
789 | + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
790 | + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), |
791 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
792 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
793 | + }, |
794 | + 'auth.user': { |
795 | + 'Meta': {'object_name': 'User'}, |
796 | + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
797 | + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), |
798 | + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
799 | + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), |
800 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
801 | + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), |
802 | + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
803 | + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
804 | + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
805 | + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
806 | + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), |
807 | + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), |
808 | + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) |
809 | + }, |
810 | + 'contenttypes.contenttype': { |
811 | + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, |
812 | + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
813 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
814 | + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
815 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
816 | + }, |
817 | + 'elections.candidate': { |
818 | + 'Meta': {'ordering': "['display_name']", 'unique_together': "(('user', 'election'),)", 'object_name': 'Candidate'}, |
819 | + 'chair_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
820 | + 'chair_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
821 | + 'council_desired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
822 | + 'council_votes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
823 | + 'display_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}), |
824 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
825 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
826 | + 'lp_profile': ('django.db.models.fields.URLField', [], {'max_length': '200'}), |
827 | + 'motivation': ('tinymce.models.HTMLField', [], {}), |
828 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) |
829 | + }, |
830 | + 'elections.election': { |
831 | + 'Meta': {'ordering': "['candidature_start', 'election_start', 'election_end', 'name']", 'object_name': 'Election'}, |
832 | + 'candidature_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 39, 10, 295257)'}), |
833 | + 'candidature_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 11, 18, 20, 39, 10, 295211)'}), |
834 | + 'description': ('tinymce.models.HTMLField', [], {}), |
835 | + 'election_end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 23, 20, 39, 10, 295344)'}), |
836 | + 'election_start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 12, 16, 20, 39, 10, 295308)'}), |
837 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
838 | + 'live_results': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
839 | + 'name': ('django.db.models.fields.CharField', [], {'default': "u'Election'", 'max_length': '128'}), |
840 | + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}) |
841 | + }, |
842 | + 'elections.office': { |
843 | + 'Meta': {'object_name': 'Office'}, |
844 | + 'description': ('tinymce.models.HTMLField', [], {}), |
845 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
846 | + 'office': ('django.db.models.fields.CharField', [], {'max_length': '128'}) |
847 | + }, |
848 | + 'elections.voter': { |
849 | + 'Meta': {'unique_together': "(('voter', 'election'),)", 'object_name': 'Voter'}, |
850 | + 'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['elections.Election']"}), |
851 | + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
852 | + 'voter': ('django.db.models.fields.CharField', [], {'max_length': '250'}) |
853 | + } |
854 | + } |
855 | + |
856 | + complete_apps = ['elections'] |
857 | |
858 | === modified file 'ubuntu_voting/elections/models.py' |
859 | --- ubuntu_voting/elections/models.py 2011-09-21 17:18:11 +0000 |
860 | +++ ubuntu_voting/elections/models.py 2011-11-19 16:23:22 +0000 |
861 | @@ -14,6 +14,7 @@ |
862 | |
863 | class Election(models.Model): |
864 | name = models.CharField(verbose_name=_('Title of the election'), max_length=128, default=_('Election'), help_text=_('The title of the election')) |
865 | + slug = models.SlugField(verbose_name=_('Slug'), max_length=128, unique=True, help_text=_('Slug is a newspaper term. A slug is a short label for something, containing only letters, numbers, underscores or hyphens')) |
866 | description = HTMLField(verbose_name=_('Description of the election'), help_text=_('Describe the election')) |
867 | candidature_start = models.DateTimeField(verbose_name=_('Start candidature'), default=datetime.datetime.now(), help_text=_('On this date the candidature starts')) |
868 | candidature_end = models.DateTimeField(verbose_name=_('End candidature'), default=datetime.datetime.now()+datetime.timedelta(days=28), help_text=_('On this date the candidature ends')) |
869 | @@ -24,8 +25,19 @@ |
870 | def __unicode__(self): |
871 | return self.name |
872 | |
873 | - def name_safe(self): |
874 | - return iri_to_uri(self.name).replace('#', '%23').replace('/', '').replace('?', '%3F') |
875 | + def template(self, base_template='election/incl_election_item_'): |
876 | + now = datetime.datetime.now() |
877 | + if self.election_end < now: |
878 | + template = 'results' |
879 | + elif self.election_start < now: |
880 | + template = 'election' |
881 | + elif self.candidature_end < now: |
882 | + template = 'pre_election' |
883 | + elif self.candidature_start < now: |
884 | + template = 'candidate' |
885 | + else: |
886 | + template = 'pre_candidate' |
887 | + return base_template + template + '.html' |
888 | |
889 | def now(self): |
890 | return datetime.datetime.now() |
891 | @@ -63,6 +75,9 @@ |
892 | def total_council_votes(self): |
893 | return self.get_council_candidates().aggregate(models.Sum('council_votes'))['council_votes__sum'] |
894 | |
895 | + def top_council(self): |
896 | + return Candidate.objects.filter(election=self, council_desired=True).order_by('-council_votes')[:10] |
897 | + |
898 | class Meta: |
899 | verbose_name = 'election' |
900 | verbose_name_plural = 'elections' |
901 | |
902 | === modified file 'ubuntu_voting/elections/urls.py' |
903 | --- ubuntu_voting/elections/urls.py 2011-04-02 15:41:46 +0000 |
904 | +++ ubuntu_voting/elections/urls.py 2011-11-19 16:23:22 +0000 |
905 | @@ -1,15 +1,15 @@ |
906 | from django.conf.urls.defaults import * |
907 | - |
908 | +from django.utils.translation import ugettext_lazy as _ |
909 | |
910 | urlpatterns = patterns('', |
911 | url(r'^$', 'elections.views.election_active', name='election-list'), |
912 | - url(r'^new/$', 'elections.views.election_new', name='election-new'), # Create a new election (check permissions trough admin group) |
913 | - url(r'^upcoming/$', 'elections.views.election_queue', name='election-queue'), |
914 | - url(r'^active/$', 'elections.views.election_active', name='election-active'), |
915 | - url(r'^ended/$', 'elections.views.election_past', name='election-past'), |
916 | - url(r'^(?P<electionId>\d+)/(?P<electionName>[^/]+)/$', 'elections.views.election_detail', name='election-detail'), |
917 | - url(r'^(?P<electionId>\d+)/(?P<electionName>[^/]+)/edit$', 'elections.views.election_edit', name='election-edit'), |
918 | - url(r'^(?P<electionId>\d+)/(?P<electionName>[^/]+)/run$', 'elections.views.election_run', name='election-run'), # Check/Uncheck (before election starts) if you apply for this |
919 | - url(r'^(?P<electionId>\d+)/(?P<electionName>[^/]+)/vote$', 'elections.views.election_vote', name='election-vote'), # Voting happens here (or view / edit? your vote, if already voted) |
920 | - url(r'^(?P<electionId>\d+)/(?P<electionName>[^/]+)/results/$', 'elections.views.election_results', name='election-results'), # The link where the results are shown (maybe with some nice effects) |
921 | + url(_(r'^new/$'), 'elections.views.election_new', name='election-new'), # Create a new election (check permissions trough admin group) |
922 | + url(_(r'^upcoming/$'), 'elections.views.election_queue', name='election-queue'), |
923 | + url(_(r'^active/$'), 'elections.views.election_active', name='election-active'), |
924 | + url(_(r'^ended/$'), 'elections.views.election_past', name='election-past'), |
925 | + url(r'^(?P<slug>[\w-]+)/$', 'elections.views.election_detail', name='election-detail'), |
926 | + url(_(r'^(?P<slug>[\w-]+)/edit$'), 'elections.views.election_edit', name='election-edit'), |
927 | + url(_(r'^(?P<slug>[\w-]+)/run$'), 'elections.views.election_run', name='election-run'), # Check/Uncheck (before election starts) if you apply for this |
928 | + url(_(r'^(?P<slug>[\w-]+)/vote$'), 'elections.views.election_vote', name='election-vote'), # Voting happens here (or view / edit? your vote, if already voted) |
929 | + url(_(r'^(?P<slug>[\w-]+)/results/$'), 'elections.views.election_results', name='election-results'), # The link where the results are shown (maybe with some nice effects) |
930 | ) |
931 | |
932 | === modified file 'ubuntu_voting/elections/views.py' |
933 | --- ubuntu_voting/elections/views.py 2011-09-21 17:18:11 +0000 |
934 | +++ ubuntu_voting/elections/views.py 2011-11-19 16:23:22 +0000 |
935 | @@ -27,15 +27,18 @@ |
936 | return direct_to_template(request, 'election/election_list.html', {'elections': elections}) |
937 | |
938 | def election_active(request): |
939 | - elections = Election.objects.filter(candidature_start__lt=datetime.datetime.now(), election_end__gt=datetime.datetime.now()) |
940 | + final_active_date = datetime.datetime.now() - datetime.timedelta(days=30) |
941 | + elections = Election.objects.filter(candidature_start__lt=datetime.datetime.now(), election_end__gt=final_active_date) |
942 | return direct_to_template(request, 'election/election_list.html', {'elections': elections}) |
943 | |
944 | def election_past(request): |
945 | elections = Election.objects.filter(election_end__lt=datetime.datetime.now()) |
946 | return direct_to_template(request, 'election/election_list.html', {'elections': elections}) |
947 | |
948 | -def election_detail(request, electionId, electionName): |
949 | - election = Election.objects.get(pk=electionId) |
950 | +def election_detail(request, slug): |
951 | + election = Election.objects.get(slug=slug) |
952 | + if election.is_election_end(): |
953 | + return election_results(request, slug) |
954 | return direct_to_template(request, 'election/election_detail.html', {'election': election}) |
955 | |
956 | @custom_permission_required('elections.add_election') |
957 | @@ -45,32 +48,32 @@ |
958 | if request.POST and form.is_valid(): |
959 | election = form.save() |
960 | messages.success(request, _('The election has been saved')) |
961 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
962 | + return redirect(election_detail, slug=election.slug) |
963 | |
964 | return direct_to_template(request, 'election/election_new.html', {'form': form}) |
965 | |
966 | @custom_permission_required('elections.change_election') |
967 | -def election_edit(request, electionId, electionName): |
968 | - election = Election.objects.get(pk=electionId) |
969 | +def election_edit(request, slug): |
970 | + election = Election.objects.get(slug=slug) |
971 | |
972 | form = CreateElectionForm(data=request.POST or None, instance=election) |
973 | |
974 | if request.POST and form.is_valid(): |
975 | election = form.save() |
976 | messages.success(request, _('The election has been edited')) |
977 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
978 | + return redirect(election_detail, slug=election.slug) |
979 | |
980 | return direct_to_template(request, 'election/election_edit.html', {'form': form, 'election': election}) |
981 | |
982 | @custom_permission_required('elections.can_becandidate') |
983 | -def election_run(request, electionId, electionName): |
984 | - election = Election.objects.get(pk=electionId) |
985 | +def election_run(request, slug): |
986 | + election = Election.objects.get(slug=slug) |
987 | if datetime.datetime.now() < election.candidature_start: |
988 | messages.error(request, _('The candidature period hasn\'t started yet')) |
989 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
990 | + return redirect(election_detail, slug=election.slug) |
991 | if datetime.datetime.now() > election.candidature_end: |
992 | messages.error(request, _('The candidature period has ended already')) |
993 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
994 | + return redirect(election_detail, slug=election.slug) |
995 | |
996 | candidate, created = Candidate.objects.get_or_create(election=election, user=request.user) |
997 | form = ApplyForElectionForm(data=request.POST or None, instance=candidate) |
998 | @@ -81,25 +84,25 @@ |
999 | candidate.lp_profile = u"https://launchpad.net/~" + lp.people[candidate.user.username].name |
1000 | candidate.save() |
1001 | messages.success(request, _('Your candidature has been edited successfully')) |
1002 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1003 | + return redirect(election_detail, slug=election.slug) |
1004 | |
1005 | return direct_to_template(request, 'election/election_candidature.html', {'form': form, 'election': election}) |
1006 | |
1007 | @custom_permission_required('elections.can_vote') |
1008 | -def election_vote(request, electionId, electionName): |
1009 | - election = Election.objects.get(pk=electionId) |
1010 | +def election_vote(request, slug): |
1011 | + election = Election.objects.get(slug=slug) |
1012 | if datetime.datetime.now() < election.election_start: |
1013 | messages.error(request, _('The election hasn\'t started yet')) |
1014 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1015 | + return redirect(election_detail, slug=election.slug) |
1016 | if datetime.datetime.now() > election.election_end: |
1017 | messages.error(request, _('The election has ended already')) |
1018 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1019 | + return redirect(election_detail, slug=election.slug) |
1020 | #if len(Candidate.objects.filter(election=election, chair_desired=True)) < 1: |
1021 | # messages.error(request, _('There aren\'t enough candidates running for Chair to let the elections begin')) |
1022 | # return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1023 | if len(Candidate.objects.filter(election=election, council_desired=True)) < 2: |
1024 | messages.error(request, _('There aren\'t enough candidates running for the Community Council to let the elections begin')) |
1025 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1026 | + return redirect(election_detail, slug=election.slug) |
1027 | |
1028 | # Do some extensive hashing of the voter's OpenID to prevent easy decryption |
1029 | openid = UserOpenID.objects.get(user=request.user) |
1030 | @@ -116,7 +119,7 @@ |
1031 | pass |
1032 | else: |
1033 | messages.error(request, _('You\'ve already voted')) |
1034 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1035 | + return redirect(election_detail, slug=election.slug) |
1036 | |
1037 | form = VoteForm(data=request.POST or None, election=election) |
1038 | |
1039 | @@ -124,24 +127,24 @@ |
1040 | form.save() |
1041 | Voter.objects.create(election=election, voter=user_hash.hexdigest()) |
1042 | messages.success(request, _('You\'ve voted successfully')) |
1043 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1044 | + return redirect(election_detail, slug=election.slug) |
1045 | |
1046 | return direct_to_template(request, 'election/election_vote.html', {'form': form, |
1047 | 'election': election}) |
1048 | |
1049 | |
1050 | -def election_results(request, electionId, electionName): |
1051 | - election = Election.objects.get(pk=electionId) |
1052 | +def election_results(request, slug): |
1053 | + election = Election.objects.get(slug=slug) |
1054 | if datetime.datetime.now() < election.election_start: |
1055 | if election.live_results: |
1056 | messages.error(request, _('The voting hasn\'t begun yet, the first results will be visible on %(date)s.') % election.election_start) |
1057 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1058 | + return redirect(election_detail, slug=election.slug) |
1059 | else: |
1060 | messages.error(request, _('The voting hasn\'t begun yet, the first results will be visible on %(date)s.') % election.election_end) |
1061 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1062 | + return redirect(election_detail, slug=election.slug) |
1063 | if datetime.datetime.now() < election.election_end and not election.live_results: |
1064 | messages.error(request, _('The results will be visible after the vote has finished, on %(date)s.') % election.election_end) |
1065 | - return redirect(election_detail, electionId=election.pk, electionName=election.name) |
1066 | + return redirect(election_detail, slug=election.slug) |
1067 | |
1068 | #top_chairs = Candidate.objects.filter(election=election, chair_desired=True).order_by('-chair_votes')[:5] |
1069 | top_council = Candidate.objects.filter(election=election, council_desired=True).order_by('-council_votes')[:10] |
1070 | |
1071 | === modified file 'ubuntu_voting/locale/nl/LC_MESSAGES/django.po' |
1072 | --- ubuntu_voting/locale/nl/LC_MESSAGES/django.po 2011-04-02 16:34:04 +0000 |
1073 | +++ ubuntu_voting/locale/nl/LC_MESSAGES/django.po 2011-11-19 16:23:22 +0000 |
1074 | @@ -7,7 +7,7 @@ |
1075 | msgstr "" |
1076 | "Project-Id-Version: PACKAGE VERSION\n" |
1077 | "Report-Msgid-Bugs-To: \n" |
1078 | -"POT-Creation-Date: 2011-04-02 18:10+0200\n" |
1079 | +"POT-Creation-Date: 2011-11-19 00:25+0000\n" |
1080 | "PO-Revision-Date: 2011-04-02 18:27+0200\n" |
1081 | "Last-Translator: Sense Hofstede <sense@ubuntu.com>\n" |
1082 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1083 | @@ -17,6 +17,18 @@ |
1084 | "Content-Transfer-Encoding: 8bit\n" |
1085 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
1086 | |
1087 | +#: urls.py:15 |
1088 | +msgid "^login/$" |
1089 | +msgstr "^inloggen/$" |
1090 | + |
1091 | +#: urls.py:16 |
1092 | +msgid "^logout/$" |
1093 | +msgstr "^uitloggen/$" |
1094 | + |
1095 | +#: urls.py:17 |
1096 | +msgid "^election/" |
1097 | +msgstr "^verkiezing/" |
1098 | + |
1099 | #: elections/models.py:16 |
1100 | msgid "Title of the election" |
1101 | msgstr "Naam van de verkiezing" |
1102 | @@ -30,276 +42,272 @@ |
1103 | msgstr "De naam van de verkiezing" |
1104 | |
1105 | #: elections/models.py:17 |
1106 | +msgid "Slug" |
1107 | +msgstr "Slug" |
1108 | + |
1109 | +#: elections/models.py:17 |
1110 | +msgid "" |
1111 | +"Slug is a newspaper term. A slug is a short label for something, containing " |
1112 | +"only letters, numbers, underscores or hyphens" |
1113 | +msgstr "" |
1114 | + |
1115 | +#: elections/models.py:18 |
1116 | msgid "Description of the election" |
1117 | msgstr "Beschrijving van de verkiezing" |
1118 | |
1119 | -#: elections/models.py:17 |
1120 | +#: elections/models.py:18 |
1121 | msgid "Describe the election" |
1122 | msgstr "Beschrijf de verkiezing" |
1123 | |
1124 | -#: elections/models.py:18 |
1125 | +#: elections/models.py:19 |
1126 | msgid "Start candidature" |
1127 | msgstr "Begin kandidaatstelling" |
1128 | |
1129 | -#: elections/models.py:18 |
1130 | +#: elections/models.py:19 |
1131 | msgid "On this date the candidature starts" |
1132 | msgstr "Op deze datum begint de kandidaatstelling" |
1133 | |
1134 | -#: elections/models.py:19 |
1135 | +#: elections/models.py:20 |
1136 | msgid "End candidature" |
1137 | msgstr "Einde kandidaatstelling" |
1138 | |
1139 | -#: elections/models.py:19 |
1140 | +#: elections/models.py:20 |
1141 | msgid "On this date the candidature ends" |
1142 | msgstr "Op deze datum eindigt de kandidaatstelling" |
1143 | |
1144 | -#: elections/models.py:20 |
1145 | +#: elections/models.py:21 |
1146 | msgid "Start election" |
1147 | msgstr "Begin verkiezing" |
1148 | |
1149 | -#: elections/models.py:20 |
1150 | +#: elections/models.py:21 |
1151 | msgid "On this date the election starts" |
1152 | msgstr "Op deze datum begint de verkiezing" |
1153 | |
1154 | -#: elections/models.py:21 |
1155 | +#: elections/models.py:22 |
1156 | msgid "End election" |
1157 | msgstr "Einde verkiezing" |
1158 | |
1159 | -#: elections/models.py:21 |
1160 | +#: elections/models.py:22 |
1161 | msgid "On this date the election ends" |
1162 | msgstr "Op deze datum eindigt de verkiezing" |
1163 | |
1164 | -#: elections/models.py:22 |
1165 | +#: elections/models.py:23 |
1166 | msgid "Live results" |
1167 | msgstr "Live-resultaten" |
1168 | |
1169 | -#: elections/models.py:22 |
1170 | +#: elections/models.py:23 |
1171 | msgid "Show results before the election has ended" |
1172 | msgstr "Laat resultaten zien voordat de verkiezing geëindigd is" |
1173 | |
1174 | -#: elections/models.py:79 |
1175 | +#: elections/models.py:94 |
1176 | msgid "Name of the candidate" |
1177 | msgstr "Naam van de kandidaat" |
1178 | |
1179 | -#: elections/models.py:80 |
1180 | +#: elections/models.py:95 |
1181 | msgid "The Launchpad profile of the candidate" |
1182 | msgstr "Het Launchpad-profiel van de kandidaat" |
1183 | |
1184 | -#: elections/models.py:81 |
1185 | +#: elections/models.py:96 |
1186 | msgid "Motivation of the candidate" |
1187 | msgstr "Motivatie van de kandidaat" |
1188 | |
1189 | -#: elections/models.py:81 |
1190 | +#: elections/models.py:96 |
1191 | msgid "Give a motivation why people should vote on you" |
1192 | msgstr "Geef een motivatie waarom mensen op u moeten stemmen" |
1193 | |
1194 | -#: elections/models.py:82 |
1195 | +#: elections/models.py:97 |
1196 | msgid "Run for Chair" |
1197 | msgstr "Kandidaatstellen voor voorzitter" |
1198 | |
1199 | -#: elections/models.py:83 |
1200 | +#: elections/models.py:98 |
1201 | msgid "Run for the Community Council" |
1202 | msgstr "Kandidaatstellen voor de gemeenschapsraad" |
1203 | |
1204 | -#: elections/models.py:130 |
1205 | +#: elections/models.py:145 |
1206 | msgid "Title of office" |
1207 | msgstr "Naam van functie" |
1208 | |
1209 | -#: elections/models.py:130 |
1210 | +#: elections/models.py:145 |
1211 | msgid "The title of an office people can run for" |
1212 | msgstr "De naam van een functie waar men zich kandidaat voor kan stellen" |
1213 | |
1214 | -#: elections/models.py:131 |
1215 | +#: elections/models.py:146 |
1216 | msgid "Description of office" |
1217 | msgstr "Beschrijving van functie" |
1218 | |
1219 | -#: elections/models.py:131 |
1220 | +#: elections/models.py:146 |
1221 | msgid "A description explaining an office people can run for" |
1222 | -msgstr "Een beschrijving van een functie waar men zich kandidaat voor kan stellen" |
1223 | - |
1224 | -#: elections/views.py:47 |
1225 | +msgstr "" |
1226 | +"Een beschrijving van een functie waar men zich kandidaat voor kan stellen" |
1227 | + |
1228 | +#: elections/urls.py:6 |
1229 | +msgid "^new/$" |
1230 | +msgstr "nieuw" |
1231 | + |
1232 | +#: elections/urls.py:7 |
1233 | +msgid "^upcoming/$" |
1234 | +msgstr "komend" |
1235 | + |
1236 | +#: elections/urls.py:8 |
1237 | +msgid "^active/$" |
1238 | +msgstr "actief" |
1239 | + |
1240 | +#: elections/urls.py:9 |
1241 | +msgid "^ended/$" |
1242 | +msgstr "geeindigd" |
1243 | + |
1244 | +#: elections/urls.py:11 |
1245 | +msgid "^(?P<slug>[\\w-]+)/edit$" |
1246 | +msgstr "^(?P<slug>[\\w-]+)/wijzigen$" |
1247 | + |
1248 | +#: elections/urls.py:12 |
1249 | +msgid "^(?P<slug>[\\w-]+)/run$" |
1250 | +msgstr "^(?P<slug>[\\w-]+)/stel-verkiesbaar$" |
1251 | + |
1252 | +#: elections/urls.py:13 |
1253 | +msgid "^(?P<slug>[\\w-]+)/vote$" |
1254 | +msgstr "^(?P<slug>[\\w-]+)/stem$" |
1255 | + |
1256 | +#: elections/urls.py:14 |
1257 | +msgid "^(?P<slug>[\\w-]+)/results/$" |
1258 | +msgstr "^(?P<slug>[\\w-]+)/uitslag/$" |
1259 | + |
1260 | +#: elections/views.py:50 |
1261 | msgid "The election has been saved" |
1262 | msgstr "De verkiezing is bewaard" |
1263 | |
1264 | -#: elections/views.py:60 |
1265 | +#: elections/views.py:63 |
1266 | msgid "The election has been edited" |
1267 | msgstr "De verkiezing is aangepast" |
1268 | |
1269 | -#: elections/views.py:69 |
1270 | +#: elections/views.py:72 |
1271 | msgid "The candidature period hasn't started yet" |
1272 | msgstr "De kandidaatstelling is nog niet begonnen" |
1273 | |
1274 | -#: elections/views.py:72 |
1275 | +#: elections/views.py:75 |
1276 | msgid "The candidature period has ended already" |
1277 | msgstr "De kandidaatstelling is al afgelopen" |
1278 | |
1279 | -#: elections/views.py:83 |
1280 | +#: elections/views.py:86 |
1281 | msgid "Your candidature has been edited successfully" |
1282 | msgstr "Uw kandidaatstelling is succesvol aangepast" |
1283 | |
1284 | -#: elections/views.py:92 |
1285 | +#: elections/views.py:95 |
1286 | msgid "The election hasn't started yet" |
1287 | msgstr "De verkiezing is nog niet begonnen" |
1288 | |
1289 | -#: elections/views.py:95 |
1290 | +#: elections/views.py:98 |
1291 | msgid "The election has ended already" |
1292 | msgstr "De verkiezing is al afgelopen" |
1293 | |
1294 | -#: elections/views.py:98 |
1295 | -msgid "" |
1296 | -"There aren't enough candidates running for Chair to let the elections begin" |
1297 | -msgstr "Er zijn niet genoeg kandidaten voor voorzitter om de verkiezingen te laten beginnen" |
1298 | - |
1299 | -#: elections/views.py:101 |
1300 | +#: elections/views.py:104 |
1301 | msgid "" |
1302 | "There aren't enough candidates running for the Community Council to let the " |
1303 | "elections begin" |
1304 | -msgstr "Er zijn niet genoeg kandidaten voor de gemeenschapsraad om de verkiezingen te laten beginnen" |
1305 | +msgstr "" |
1306 | +"Er zijn niet genoeg kandidaten voor de gemeenschapsraad om de verkiezingen " |
1307 | +"te laten beginnen" |
1308 | |
1309 | -#: elections/views.py:118 |
1310 | +#: elections/views.py:121 |
1311 | msgid "You've already voted" |
1312 | msgstr "U heeft al gestemd" |
1313 | |
1314 | -#: elections/views.py:126 |
1315 | +#: elections/views.py:129 |
1316 | msgid "You've voted successfully" |
1317 | msgstr "U heeft succesvol gestemd" |
1318 | |
1319 | -#: elections/views.py:137 elections/views.py:140 |
1320 | +#: elections/views.py:140 elections/views.py:143 |
1321 | #, python-format |
1322 | msgid "" |
1323 | "The voting hasn't begun yet, the first results will be visible on %(date)s." |
1324 | -msgstr "Het stemmen is nog niet begonnen, de eerste uitslagen zullen zichtbaar zijn op %(date)s" |
1325 | +msgstr "" |
1326 | +"Het stemmen is nog niet begonnen, de eerste uitslagen zullen zichtbaar zijn " |
1327 | +"op %(date)s" |
1328 | |
1329 | -#: elections/views.py:143 |
1330 | +#: elections/views.py:146 |
1331 | #, python-format |
1332 | msgid "The results will be visible after the vote has finished, on %(date)s." |
1333 | -msgstr "De uitslagen zullen zichtbaar zijn nadat het stemmen afgelopen is, op %(date)s" |
1334 | - |
1335 | -#: templates/base.html:17 |
1336 | -msgid "All elections" |
1337 | -msgstr "Alle verkiezingen" |
1338 | - |
1339 | -#: templates/base.html:17 |
1340 | -msgid "Elections" |
1341 | -msgstr "Verkiezingen" |
1342 | - |
1343 | -#: templates/base.html:20 |
1344 | +msgstr "" |
1345 | +"De uitslagen zullen zichtbaar zijn nadat het stemmen afgelopen is, op " |
1346 | +"%(date)s" |
1347 | + |
1348 | +#: templates/403.html:5 |
1349 | +msgid "You have no rights to view this page" |
1350 | +msgstr "Je hebt geen rechten om deze pagina te bekijken" |
1351 | + |
1352 | +#: templates/404.html:5 |
1353 | +msgid "the requested page cannot be found" |
1354 | +msgstr "De gevraagde pagina kan niet worden gevonden" |
1355 | + |
1356 | +#: templates/500.html:5 |
1357 | +msgid "A server error occured, try again in a few minutes" |
1358 | +msgstr "" |
1359 | +"Oops, er is wat mis gegaan op de server. Probeer over een aantal minuten nog " |
1360 | +"eens" |
1361 | + |
1362 | +#: templates/base.html:59 |
1363 | msgid "Log out" |
1364 | msgstr "Afmelden" |
1365 | |
1366 | -#: templates/base.html:22 |
1367 | +#: templates/base.html:61 |
1368 | +msgid "Guest" |
1369 | +msgstr "Gast" |
1370 | + |
1371 | +#: templates/base.html:61 |
1372 | msgid "Log in" |
1373 | msgstr "Aanmelden" |
1374 | |
1375 | -#: templates/base.html:28 |
1376 | +#: templates/base.html:66 |
1377 | +msgid "Home" |
1378 | +msgstr "Voorpagina" |
1379 | + |
1380 | +#: templates/base.html:69 |
1381 | msgid "Overview" |
1382 | msgstr "Overzicht" |
1383 | |
1384 | -#: templates/base.html:29 |
1385 | +#: templates/base.html:70 |
1386 | msgid "Edit" |
1387 | msgstr "Aanpassen" |
1388 | |
1389 | -#: templates/base.html:34 |
1390 | -msgid "Run for this election" |
1391 | -msgstr "Kandidaatstellen voor deze verkiezing" |
1392 | - |
1393 | -#: templates/base.html:39 templates/election/election_vote.html:16 |
1394 | -msgid "Vote" |
1395 | -msgstr "Stemmen" |
1396 | - |
1397 | -#: templates/base.html:43 |
1398 | -msgid "Results" |
1399 | -msgstr "Resultaten" |
1400 | - |
1401 | -#: templates/base.html:76 |
1402 | -msgid "Ubuntu Website Template developed by Michael Hall" |
1403 | -msgstr "Ubuntu Website Template ontwikkeld door Michael Hall" |
1404 | - |
1405 | -#: templates/form.html:6 |
1406 | -msgid "Verplicht" |
1407 | +#: templates/base.html:109 |
1408 | +msgid "Ubuntu Elections - By Ronnie van den Crommenacker and Sense Hofstede" |
1409 | +msgstr "" |
1410 | +"Ubuntu Verkiezingen - Door Ronnie van den Crommenacker en Sense Hofstede" |
1411 | + |
1412 | +#: templates/form.html:6 ubuntu_light_theme/templates/form.html:6 |
1413 | +msgid "Required" |
1414 | msgstr "Verplicht" |
1415 | |
1416 | -#: templates/election/election_candidature.html:16 |
1417 | -#: templates/election/election_edit.html:16 |
1418 | -#: templates/election/election_new.html:25 |
1419 | +#: templates/election/election_candidature.html:12 |
1420 | +#: templates/election/incl_election_item_candidate.html:16 |
1421 | +msgid "edit your candidature" |
1422 | +msgstr "stel je kandidaat" |
1423 | + |
1424 | +#: templates/election/election_candidature.html:20 |
1425 | +#: templates/election/election_edit.html:19 |
1426 | +#: templates/election/election_new.html:29 |
1427 | msgid "Save" |
1428 | msgstr "Opslaan" |
1429 | |
1430 | -#: templates/election/election_detail.html:12 |
1431 | -#: templates/election/election_detail.html:14 |
1432 | -#: templates/election/election_detail.html:17 |
1433 | -#: templates/election/election_list.html:24 |
1434 | -#: templates/election/election_list.html:26 |
1435 | -#: templates/election/election_list.html:29 |
1436 | -msgid "candidature:" |
1437 | -msgstr "kandidaatstelling:" |
1438 | - |
1439 | -#: templates/election/election_detail.html:12 |
1440 | -#: templates/election/election_list.html:24 |
1441 | -msgid "not possible anymore" |
1442 | -msgstr "niet meer mogelijk" |
1443 | - |
1444 | -#: templates/election/election_detail.html:14 |
1445 | -#: templates/election/election_list.html:26 |
1446 | -msgid "edit your candidature" |
1447 | -msgstr "" |
1448 | - |
1449 | -#: templates/election/election_detail.html:14 |
1450 | -#: templates/election/election_detail.html:24 |
1451 | -#: templates/election/election_list.html:26 |
1452 | -#: templates/election/election_list.html:36 |
1453 | -#, python-format |
1454 | -msgid "(%(time_left)s remaining)" |
1455 | -msgstr "(nog %(time_left)s)" |
1456 | - |
1457 | -#: templates/election/election_detail.html:17 |
1458 | -#: templates/election/election_list.html:29 |
1459 | -#, python-format |
1460 | -msgid "possible in %(time_left)s" |
1461 | -msgstr "mogelijk over %(time_left)s" |
1462 | - |
1463 | -#: templates/election/election_detail.html:22 |
1464 | -#: templates/election/election_detail.html:24 |
1465 | -#: templates/election/election_detail.html:27 |
1466 | -#: templates/election/election_list.html:34 |
1467 | -#: templates/election/election_list.html:36 |
1468 | -#: templates/election/election_list.html:39 |
1469 | -msgid "voting:" |
1470 | -msgstr "stemmen:" |
1471 | - |
1472 | -#: templates/election/election_detail.html:22 |
1473 | -#: templates/election/election_list.html:34 |
1474 | -msgid "ended" |
1475 | -msgstr "geëindigd" |
1476 | - |
1477 | -#: templates/election/election_detail.html:24 |
1478 | -#: templates/election/election_list.html:36 |
1479 | -msgid "cast your vote" |
1480 | -msgstr "breng uw stem uit" |
1481 | - |
1482 | -#: templates/election/election_detail.html:27 |
1483 | -#: templates/election/election_list.html:39 |
1484 | -#, python-format |
1485 | -msgid "starts in %(time_left)s" |
1486 | -msgstr "begint over %(time_left)s" |
1487 | - |
1488 | -#: templates/election/election_detail.html:36 |
1489 | -#: templates/election/election_detail.html:48 |
1490 | -#: templates/election/election_list.html:48 |
1491 | -#: templates/election/election_list.html:60 |
1492 | +#: templates/election/election_detail.html:9 |
1493 | +#: templates/election/election_results.html:14 |
1494 | +msgid "Candidates" |
1495 | +msgstr "Kandidaten" |
1496 | + |
1497 | +#: templates/election/election_detail.html:13 |
1498 | +#: templates/election/election_results.html:18 |
1499 | #, python-format |
1500 | msgid "%(candidate_name)s in Launchpad" |
1501 | msgstr "%(candidate_name)s op Launchpad" |
1502 | |
1503 | -#: templates/election/election_detail.html:40 |
1504 | -#: templates/election/election_detail.html:52 |
1505 | -#: templates/election/election_list.html:51 |
1506 | -#: templates/election/election_list.html:63 |
1507 | +#: templates/election/election_detail.html:17 |
1508 | +#: templates/election/election_results.html:22 |
1509 | msgid "There are no candidates yet" |
1510 | msgstr "Er zijn nog geen kandidaten" |
1511 | |
1512 | #: templates/election/election_list.html:6 |
1513 | #: templates/election/election_new.html:11 |
1514 | +#: templates/election/election_new.html:21 |
1515 | msgid "New election" |
1516 | msgstr "Nieuwe verkiezing" |
1517 | |
1518 | @@ -318,14 +326,90 @@ |
1519 | msgid "Ended elections" |
1520 | msgstr "Geëindigde verkiezingen" |
1521 | |
1522 | -#: templates/election/election_list.html:71 |
1523 | +#: templates/election/election_list.html:22 |
1524 | msgid "No elections could be found" |
1525 | msgstr "Er konden geen verkiezingen gevonden worden" |
1526 | |
1527 | -#: templates/election/election_results.html:10 |
1528 | -msgid "Results Chair" |
1529 | -msgstr "Uitslagen voorzitter" |
1530 | - |
1531 | -#: templates/election/election_results.html:21 |
1532 | -msgid "Results Community Council" |
1533 | -msgstr "Uitslagen gemeenschapsraad" |
1534 | +#: templates/election/election_vote.html:12 |
1535 | +#: templates/election/incl_election_item_election.html:16 |
1536 | +msgid "cast your vote" |
1537 | +msgstr "breng uw stem uit" |
1538 | + |
1539 | +#: templates/election/election_vote.html:20 |
1540 | +msgid "Vote" |
1541 | +msgstr "Stemmen" |
1542 | + |
1543 | +#: templates/election/incl_election_item_candidate.html:15 |
1544 | +#: templates/election/incl_election_item_election.html:15 |
1545 | +#, python-format |
1546 | +msgid "%(timeleft)s left" |
1547 | +msgstr "nog %(timeleft)s" |
1548 | + |
1549 | +#: templates/election/incl_election_item_pre_candidate.html:15 |
1550 | +#, python-format |
1551 | +msgid "candidature starts in%(timeleft)s" |
1552 | +msgstr "kandidaatstelleing begin over %(timeleft)s" |
1553 | + |
1554 | +#: templates/election/incl_election_item_pre_election.html:15 |
1555 | +#, python-format |
1556 | +msgid "election starts in%(timeleft)s" |
1557 | +msgstr "verkiezing begint over %(timeleft)s" |
1558 | + |
1559 | +#: templates/election/incl_election_item_results.html:10 |
1560 | +#, python-format |
1561 | +msgid "Results: %(election_name)s" |
1562 | +msgstr "Uitslag: %(election_name)s" |
1563 | + |
1564 | +#~ msgid "Results Community Council" |
1565 | +#~ msgstr "Uitslagen gemeenschapsraad" |
1566 | + |
1567 | +#~ msgid "Run for this election" |
1568 | +#~ msgstr "Kandidaatstellen voor deze verkiezing" |
1569 | + |
1570 | +#~ msgid "Results" |
1571 | +#~ msgstr "Resultaten" |
1572 | + |
1573 | +#~ msgid "not possible anymore" |
1574 | +#~ msgstr "niet meer mogelijk" |
1575 | + |
1576 | +#~ msgid "possible in %(time_left)s" |
1577 | +#~ msgstr "mogelijk over %(time_left)s" |
1578 | + |
1579 | +#~ msgid "voting:" |
1580 | +#~ msgstr "stemmen:" |
1581 | + |
1582 | +#~ msgid "ended" |
1583 | +#~ msgstr "geëindigd" |
1584 | + |
1585 | +#, fuzzy |
1586 | +#~ msgid "Council Candidates" |
1587 | +#~ msgstr "Uitslagen gemeenschapsraad" |
1588 | + |
1589 | +#~ msgid "^account/$" |
1590 | +#~ msgstr "^account/$" |
1591 | + |
1592 | +#~ msgid "All elections" |
1593 | +#~ msgstr "Alle verkiezingen" |
1594 | + |
1595 | +#~ msgid "Elections" |
1596 | +#~ msgstr "Verkiezingen" |
1597 | + |
1598 | +#~ msgid "Ubuntu Website Template developed by Michael Hall" |
1599 | +#~ msgstr "Ubuntu Website Template ontwikkeld door Michael Hall" |
1600 | + |
1601 | +#, fuzzy |
1602 | +#~ msgid "Community Council candidates:" |
1603 | +#~ msgstr "Uitslagen gemeenschapsraad" |
1604 | + |
1605 | +#~ msgid "" |
1606 | +#~ "There aren't enough candidates running for Chair to let the elections " |
1607 | +#~ "begin" |
1608 | +#~ msgstr "" |
1609 | +#~ "Er zijn niet genoeg kandidaten voor voorzitter om de verkiezingen te " |
1610 | +#~ "laten beginnen" |
1611 | + |
1612 | +#~ msgid "Verplicht" |
1613 | +#~ msgstr "Verplicht" |
1614 | + |
1615 | +#~ msgid "Results Chair" |
1616 | +#~ msgstr "Uitslagen voorzitter" |
1617 | |
1618 | === modified file 'ubuntu_voting/settings.py' |
1619 | --- ubuntu_voting/settings.py 2011-09-21 17:18:11 +0000 |
1620 | +++ ubuntu_voting/settings.py 2011-11-19 16:23:22 +0000 |
1621 | @@ -95,7 +95,9 @@ |
1622 | 'django.core.context_processors.i18n', |
1623 | 'django.core.context_processors.media', |
1624 | 'django.core.context_processors.request', |
1625 | + 'django.contrib.messages.context_processors.messages', |
1626 | 'ubuntu_voting.common.template.context_processor', |
1627 | + |
1628 | ) |
1629 | |
1630 | INSTALLED_APPS = ( |
1631 | @@ -146,6 +148,8 @@ |
1632 | 'theme_advanced_toolbar_location' : "top", |
1633 | 'theme_advanced_toolbar_align' : "left", |
1634 | 'theme_advanced_resizing' : True, |
1635 | + 'width': '400px', |
1636 | + 'height': '250px', |
1637 | } |
1638 | TINYMCE_COMPRESSOR = False |
1639 | TINYMCE_FILEBROWSER = False |
1640 | |
1641 | === modified file 'ubuntu_voting/templates/403.html' |
1642 | --- ubuntu_voting/templates/403.html 2011-02-24 13:01:40 +0000 |
1643 | +++ ubuntu_voting/templates/403.html 2011-11-19 16:23:22 +0000 |
1644 | @@ -2,6 +2,6 @@ |
1645 | |
1646 | {% block messages %} |
1647 | <ul class="messages main-content"> |
1648 | - <li>Je hebt geen rechten om deze pagina te bekijken</li> |
1649 | + <li>{% trans "You have no rights to view this page" %}</li> |
1650 | </ul> |
1651 | {% endblock %} |
1652 | |
1653 | === modified file 'ubuntu_voting/templates/404.html' |
1654 | --- ubuntu_voting/templates/404.html 2011-02-24 13:01:40 +0000 |
1655 | +++ ubuntu_voting/templates/404.html 2011-11-19 16:23:22 +0000 |
1656 | @@ -2,6 +2,6 @@ |
1657 | |
1658 | {% block messages %} |
1659 | <ul class="messages main-content"> |
1660 | - <li>De opgevraagde pagina kan niet worden gevonden</li> |
1661 | + <li>{% trans "the requested page cannot be found" %}</li> |
1662 | </ul> |
1663 | {% endblock %} |
1664 | |
1665 | === modified file 'ubuntu_voting/templates/500.html' |
1666 | --- ubuntu_voting/templates/500.html 2011-02-24 13:01:40 +0000 |
1667 | +++ ubuntu_voting/templates/500.html 2011-11-19 16:23:22 +0000 |
1668 | @@ -2,6 +2,6 @@ |
1669 | |
1670 | {% block messages %} |
1671 | <ul class="messages main-content"> |
1672 | - <li>Er is een server fout opgetreden, probeer over enkele minuten opnieuw</li> |
1673 | + <li>{% trans "A server error occured, try again in a few minutes" %}</li> |
1674 | </ul> |
1675 | {% endblock %} |
1676 | |
1677 | === modified file 'ubuntu_voting/templates/base.html' |
1678 | --- ubuntu_voting/templates/base.html 2011-04-02 16:34:04 +0000 |
1679 | +++ ubuntu_voting/templates/base.html 2011-11-19 16:23:22 +0000 |
1680 | @@ -14,34 +14,27 @@ |
1681 | {% endblock %} |
1682 | |
1683 | {% block main_nav_links %} |
1684 | - <a href="/election/" title="{% trans 'All elections' %}" class="main-nav-item ">{% trans 'Elections' %}</a> |
1685 | - {% if user.is_authenticated %} |
1686 | - <!-- Logout url --> |
1687 | - <a href="{% url logout %}" title="{% trans 'Log out' %}" class="main-nav-item ">{% trans 'Log out' %}</a> |
1688 | - {% else %} |
1689 | - <a href="{% url login %}?next={{ request.path }}" title="{% trans 'Log in' %}" class="main-nav-item ">{% trans 'Log in' %}</a> |
1690 | - {% endif %} |
1691 | + <a class="main-nav-item" href="/test/?q=node/1">Ubuntu</a> |
1692 | + <a class="main-nav-item" href="/test/?q=node/4">Ondersteuning</a> |
1693 | + <a class="main-nav-item current" href="/test/?q=node/5">Gemeenschap</a> |
1694 | + <a class="main-nav-item" href="/test/?q=node/24">Agenda</a> |
1695 | + <a class="main-nav-item" href="/test/?q=node/19">Nieuws</a> |
1696 | + <a class="main-nav-item" href="/test/?q=node/36">Partners</a> |
1697 | {% endblock %} |
1698 | |
1699 | -{% block sub_nav_links %} |
1700 | - {% if election %} |
1701 | - <a href="{% url election-detail electionId=election.pk, electionName=election.name_safe %}" class="sub-nav-item">{% trans "Overview" %}</a> |
1702 | - <a href="{% url election-edit electionId=election.pk, electionName=election.name_safe %}" class="sub-nav-item">{% trans "Edit" %}</a> |
1703 | - {% endif %} |
1704 | - |
1705 | - <!-- TODO: Only if allowed --> |
1706 | - {% if election.is_candidature %} |
1707 | - <a href="{% url election-run electionId=election.pk, electionName=election.name_safe %}" class="sub-nav-item">{% trans "Run for this election" %}</a> |
1708 | - {% endif %} |
1709 | - |
1710 | - <!-- TODO: Only if allowed --> |
1711 | - {% if election.is_election %} |
1712 | - <a href="{% url election-vote electionId=election.pk, electionName=election.name_safe %}" class="sub-nav-item">{% trans "Vote" %}</a> |
1713 | - {% endif %} |
1714 | - |
1715 | - {% if election.is_results %} |
1716 | - <a href="{% url election-results electionId=election.pk, electionName=election.name_safe %}" class="sub-nav-item">{% trans "Results" %}</a> |
1717 | - {% endif %} |
1718 | +{% block sub_nav %} |
1719 | + <div class="container" id="sub-nav-container" > |
1720 | + <nav id="sub-nav"> |
1721 | + <a class="sub-nav-item" href="/test/?q=node/5">Introductie</a> |
1722 | + <a class="sub-nav-item" href="/test/?q=node/14">Meedoen</a> |
1723 | + <a class="sub-nav-item" href="/test/?q=node/26">Foto's</a> |
1724 | + <a class="sub-nav-item" href="/test/?q=node/52">Organisatie</a> |
1725 | + <a class="sub-nav-item" href="/test/?q=node/7">Teams</a> |
1726 | + <a class="sub-nav-item" href="/test/?q=node/102">Teamleden</a> |
1727 | + <a class="sub-nav-item" href="/test/?q=node/49">Contact</a> |
1728 | + <a class="sub-nav-item current" href="{% url home %}">Verkiezingen</a> |
1729 | + </nav> |
1730 | + </div> |
1731 | {% endblock %} |
1732 | |
1733 | {% block search %} |
1734 | @@ -58,22 +51,60 @@ |
1735 | {% endblock %} |
1736 | |
1737 | {% block content %} |
1738 | + <aside class="content content-small content-right"> |
1739 | + {% block login %} |
1740 | + <div class="login"> |
1741 | + {% if user.is_authenticated %} |
1742 | + <!-- Logout url --> |
1743 | + {{ request.user.username }}<a href="{% url logout %}" title="{% trans 'Log out' %}" class="login-button">{% trans 'Log out' %}</a> |
1744 | + {% else %} |
1745 | + {% trans "Guest" %}<a href="{% url login %}?next={{ request.path }}" title="{% trans 'Log in' %}" class="logout-button">{% trans 'Log in' %}</a> |
1746 | + {% endif %} |
1747 | + </div> |
1748 | + {% endblock %} |
1749 | + <div class="content-inner"> |
1750 | + <a href="{% url home %}" class="sub-nav-item">{% trans "Home" %}</a> |
1751 | + {% block election_sub_nav %} |
1752 | + {% if election %} |
1753 | + <a href="{% url election-detail slug=election.slug %}" class="sub-nav-item">{% trans "Overview" %}</a> |
1754 | + <a href="{% url election-edit slug=election.slug %}" class="sub-nav-item">{% trans "Edit" %}</a> |
1755 | + {% endif %} |
1756 | + {% endblock %} |
1757 | + </div> |
1758 | + </aside> |
1759 | + |
1760 | + {% block election_content %} |
1761 | + {% endblock %} |
1762 | {% endblock %} |
1763 | |
1764 | {% block general %} |
1765 | {% endblock %} |
1766 | |
1767 | -{% block footer_list_1 %} |
1768 | -{% endblock %} |
1769 | - |
1770 | -{% block footer_list_2 %} |
1771 | -{% endblock %} |
1772 | - |
1773 | -{% block footer_list_3 %} |
1774 | -{% endblock %} |
1775 | - |
1776 | -{% block footer_note %} |
1777 | -<p>{% trans "Ubuntu Website Template developed by Michael Hall" %} |
1778 | -<a href="https://launchpad.net/django-ubuntu-template" target="_blank">https://launchpad.net/django-ubuntu-template</a> |
1779 | -</p> |
1780 | + |
1781 | +{% block footer %} |
1782 | + <dl class="footer-content"> |
1783 | + <dt>Legal Disclaimer</dt> |
1784 | + <dd><p>© 2010 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</p></dd> |
1785 | + </dl> |
1786 | + <dl class="footer-content"> |
1787 | + <dt>Content license</dt> |
1788 | + <dd> |
1789 | + <ul class="footer-links" > |
1790 | + <li class="footer-item"><a class="footer-link" href="/test/?q=/node/100">Images</a></li> |
1791 | + <li class="footer-item"><a class="footer-link" href="/test/?q=/node/101">texts</a></li> |
1792 | + </ul> |
1793 | + </dd> |
1794 | + </dl> |
1795 | + <dl class="footer-content"> |
1796 | + <dt>More Ubuntu</dt> |
1797 | + <dd> |
1798 | + <ul class="footer-links" > |
1799 | + <li class="footer-item"><a class="footer-link" href="http://ubuntu.com/getubuntu/download/">Get Ubuntu</a></li> |
1800 | + <li class="footer-item"><a class="footer-link" href="http://brainstorm.ubuntu.com/">Ubuntu Brainstorm</a></li> |
1801 | + <li class="footer-item"><a class="footer-link" href="http://ubuntuforums.org/">Ubuntu Forums</a></li> |
1802 | + <li class="footer-item"><a class="footer-link" href="http://spreadubuntu.neomenlo.org/">Spread Ubuntu</a></li> |
1803 | + </ul> |
1804 | + </dd> |
1805 | + </dl> |
1806 | + <details class="foot-note"><p>{% trans "Ubuntu Elections - By Ronnie van den Crommenacker and Sense Hofstede" %}</p></details> |
1807 | {% endblock %} |
1808 | |
1809 | === modified file 'ubuntu_voting/templates/election/election_candidature.html' |
1810 | --- ubuntu_voting/templates/election/election_candidature.html 2011-04-02 15:41:46 +0000 |
1811 | +++ ubuntu_voting/templates/election/election_candidature.html 2011-11-19 16:23:22 +0000 |
1812 | @@ -6,15 +6,20 @@ |
1813 | {{ form.media }} |
1814 | {% endblock %} |
1815 | |
1816 | -{% block content %} |
1817 | - <section class="minor-content"> |
1818 | - <form method="POST" class="small"> |
1819 | - {% csrf_token %} |
1820 | - <ul> |
1821 | - {{ form.as_template }} |
1822 | - </ul> |
1823 | - <input type="submit" value="{% trans "Save" %}" /> |
1824 | - </form> |
1825 | +{% block election_content %} |
1826 | + <section class="content content-medium content-left"> |
1827 | + <div class="content-inner"> |
1828 | + <h2>{% trans "edit your candidature" %}</h2> |
1829 | + <form method="POST" class="small"> |
1830 | + <fieldset> |
1831 | + {% csrf_token %} |
1832 | + <ul> |
1833 | + {{ form.as_template }} |
1834 | + </ul> |
1835 | + </fieldset> |
1836 | + <input type="submit" value="{% trans "Save" %}" /> |
1837 | + </form> |
1838 | + </div> |
1839 | </section> |
1840 | {% endblock %} |
1841 | |
1842 | |
1843 | === modified file 'ubuntu_voting/templates/election/election_detail.html' |
1844 | --- ubuntu_voting/templates/election/election_detail.html 2011-09-21 17:18:11 +0000 |
1845 | +++ ubuntu_voting/templates/election/election_detail.html 2011-11-19 16:23:22 +0000 |
1846 | @@ -1,58 +1,22 @@ |
1847 | {% extends 'base.html' %} |
1848 | {% load i18n %} |
1849 | |
1850 | -{% block content %} |
1851 | - <div class="main-content"> |
1852 | - <h1><a href="{% url election-detail electionId=election.pk electionName=election.name_safe %}">{{ election.name }}</a></h1> |
1853 | - {% autoescape off %} |
1854 | - {{ election.description }} |
1855 | - {% endautoescape %} |
1856 | - {% if election.is_candidature_start %} |
1857 | - {% if election.is_candidature_end %} |
1858 | - <p><strong>{% trans 'candidature:' %}</strong> <em>{% trans 'not possible anymore' %}</em></p> |
1859 | - {% else %} |
1860 | - <p><strong>{% trans 'candidature:' %}</strong> <em><a href="{% url election-run electionId=election.pk electionName=election.name_safe %}">{% trans "edit your candidature" %}</a> {% blocktrans with election.candidature_end|timeuntil:election.now as time_left %}({{ time_left }} remaining){% endblocktrans %}</em></p> |
1861 | - {% endif %} |
1862 | - {% else %} |
1863 | - <p><strong>{% trans 'candidature:' %}</strong> <em>{% blocktrans with election.candidature_start|timeuntil:election.now as time_left %}possible in {{ time_left }}{% endblocktrans %}</em></p> |
1864 | - {% endif %} |
1865 | - |
1866 | - {% if election.is_election_start %} |
1867 | - {% if election.is_election_end %} |
1868 | - <p><strong>{% trans 'voting:' %}</strong> <em>{% trans 'ended' %}</em></p> |
1869 | - {% else %} |
1870 | - <p><strong>{% trans 'voting:' %}</strong> <em><a href="{% url election-vote electionId=election.pk electionName=election.name_safe %}">{% trans 'cast your vote' %}</a> {% blocktrans with election.election_end|timeuntil:election.now as time_left %}({{ time_left }} remaining){% endblocktrans %}</em></p> |
1871 | - {% endif %} |
1872 | - {% else %} |
1873 | - <p><strong>{% trans 'voting:' %}</strong> <em>{% blocktrans with election.election_start|timeuntil:election.now as time_left %}starts in {{ time_left }}{% endblocktrans %}</em></p> |
1874 | - {% endif %} |
1875 | - </div> |
1876 | +{% block election_content %} |
1877 | + {% include election.template %} |
1878 | {% if election.is_candidature_start %} |
1879 | - {% comment %} |
1880 | - <div class="minor-content alone"> |
1881 | - <h3>Voorzitterskandidaten</h3> |
1882 | - {% if election.get_chair_candidates %} |
1883 | - <ul id="chaircandidateslist"> |
1884 | - {% for candidate in election.get_chair_candidates %} |
1885 | - <li><a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}" style="font-size:1.3em;">{{ candidate.display_name }}</a><br/>{% autoescape off %}{{ candidate.motivation }}{% endautoescape %}</li> |
1886 | - {% endfor %} |
1887 | - </ul> |
1888 | - {% else %} |
1889 | - <strong>{% trans 'There are no candidates yet' %}</strong> |
1890 | - {% endif %} |
1891 | - </div> |
1892 | - {% endcomment %} |
1893 | - <div class="minor-content alone"> |
1894 | - <h3>Gemeenschapsraadskandidaten</h3> |
1895 | - {% if election.get_council_candidates %} |
1896 | - <ul id="councilcandidateslist"> |
1897 | - {% for candidate in election.get_council_candidates %} |
1898 | - <li><a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}" style="font-size:1.3em;">{{ candidate.display_name }}</a><br/>{% autoescape off %}{{ candidate.motivation }}{% endautoescape %}</li> |
1899 | - {% endfor %} |
1900 | - </ul> |
1901 | - {% else %} |
1902 | - <strong>{% trans 'There are no candidates yet' %}</strong> |
1903 | - {% endif %} |
1904 | - </div> |
1905 | + <article class="content content-medium content-left"> |
1906 | + <div class="content-inner"> |
1907 | + <h3>{% trans 'Candidates' %}</h3> |
1908 | + {% if election.get_council_candidates %} |
1909 | + <ul id="councilcandidateslist"> |
1910 | + {% for candidate in election.get_council_candidates %} |
1911 | + <li><a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}" style="font-size:1.3em;">{{ candidate.display_name }}</a><br/>{% autoescape off %}{{ candidate.motivation }}{% endautoescape %}</li> |
1912 | + {% endfor %} |
1913 | + </ul> |
1914 | + {% else %} |
1915 | + <strong>{% trans 'There are no candidates yet' %}</strong> |
1916 | + {% endif %} |
1917 | + </div> |
1918 | + </article> |
1919 | {% endif %} |
1920 | {% endblock %} |
1921 | |
1922 | === modified file 'ubuntu_voting/templates/election/election_edit.html' |
1923 | --- ubuntu_voting/templates/election/election_edit.html 2011-04-02 15:41:46 +0000 |
1924 | +++ ubuntu_voting/templates/election/election_edit.html 2011-11-19 16:23:22 +0000 |
1925 | @@ -6,15 +6,19 @@ |
1926 | {{ form.media }} |
1927 | {% endblock %} |
1928 | |
1929 | -{% block content %} |
1930 | - <section class="minor-content"> |
1931 | - <form method="POST" class="small"> |
1932 | - {% csrf_token %} |
1933 | - <ul> |
1934 | - {{ form.as_template }} |
1935 | - </ul> |
1936 | - <input type="submit" value="{% trans 'Save' %}" /> |
1937 | - </form> |
1938 | +{% block election_content %} |
1939 | + <section class="content content-medium content-left"> |
1940 | + <div class="content-inner"> |
1941 | + <form method="POST" class="small"> |
1942 | + <fieldset> |
1943 | + {% csrf_token %} |
1944 | + <ul> |
1945 | + {{ form.as_template }} |
1946 | + </ul> |
1947 | + </fieldset> |
1948 | + <input type="submit" value="{% trans 'Save' %}" /> |
1949 | + </form> |
1950 | + </div> |
1951 | </section> |
1952 | {% endblock %} |
1953 | |
1954 | |
1955 | === modified file 'ubuntu_voting/templates/election/election_list.html' |
1956 | --- ubuntu_voting/templates/election/election_list.html 2011-09-21 17:18:11 +0000 |
1957 | +++ ubuntu_voting/templates/election/election_list.html 2011-11-19 16:23:22 +0000 |
1958 | @@ -1,7 +1,7 @@ |
1959 | {% extends 'base.html' %} |
1960 | {% load i18n %} |
1961 | |
1962 | -{% block sub_nav_links %} |
1963 | +{% block election_sub_nav %} |
1964 | {% if perms.elections.add_election %} |
1965 | <a href="{% url election-new %}" class="sub-nav-item">{% trans 'New election' %}</a> |
1966 | {% endif %} |
1967 | @@ -11,66 +11,17 @@ |
1968 | {% endblock %} |
1969 | |
1970 | |
1971 | -{% block content %} |
1972 | +{% block election_content %} |
1973 | {% if elections|length %} |
1974 | - {% for election in elections %} |
1975 | - <div class="minor-content alone"> |
1976 | - <h3><a href="{% url election-detail electionId=election.pk electionName=election.name_safe %}">{{ election.name }}</a></h3> |
1977 | - {% autoescape off %} |
1978 | - {{ election.description }} |
1979 | - {% endautoescape %} |
1980 | - {% if election.is_candidature_start %} |
1981 | - {% if election.is_candidature_end %} |
1982 | - <p><strong>k{% trans 'candidature:' %}</strong> <em>{% trans 'not possible anymore' %}</em></p> |
1983 | - {% else %} |
1984 | - <p><strong>{% trans 'candidature:' %}</strong> <em><a href="{% url election-run electionId=election.pk electionName=election.name_safe %}">{% trans "edit your candidature" %}</a> {% blocktrans with election.candidature_end|timeuntil:election.now as time_left %}({{ time_left }} remaining){% endblocktrans %}</em></p> |
1985 | - {% endif %} |
1986 | - {% else %} |
1987 | - <p><strong>{% trans 'candidature:' %}</strong> <em>{% blocktrans with election.candidature_start|timeuntil:election.now as time_left %}possible in {{ time_left }}{% endblocktrans %}</em></p> |
1988 | - {% endif %} |
1989 | - |
1990 | - {% if election.is_election_start %} |
1991 | - {% if election.is_election_end %} |
1992 | - <p><strong>{% trans 'voting:' %}</strong> <em>{% trans 'ended' %}</em></p> |
1993 | - {% else %} |
1994 | - <p><strong>{% trans 'voting:' %}</strong> <em><a href="{% url election-vote electionId=election.pk electionName=election.name_safe %}">{% trans 'cast your vote' %}</a> {% blocktrans with election.election_end|timeuntil:election.now as time_left %}({{ time_left }} remaining){% endblocktrans %}</em></p> |
1995 | - {% endif %} |
1996 | - {% else %} |
1997 | - <p><strong>{% trans 'voting:' %}</strong> <em>{% blocktrans with election.election_start|timeuntil:election.now as time_left %}starts in {{ time_left }}{% endblocktrans %}</em></p> |
1998 | - {% endif %} |
1999 | - |
2000 | - {% if election.is_candidature_start %} |
2001 | - {% comment %} |
2002 | - <div class="sub-content"> |
2003 | - <p> |
2004 | - Voorzitterskandidaten: |
2005 | - {% if election.get_chair_candidates %} |
2006 | - {% for candidate in election.get_chair_candidates %} |
2007 | - <a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}">{{ candidate.display_name }}</a><br/> |
2008 | - {% endfor %} |
2009 | - {% else %} |
2010 | - <em>{% trans 'There are no candidates yet' %}</em> |
2011 | - {% endif %} |
2012 | - </p> |
2013 | - </div> |
2014 | - {% endcomment %} |
2015 | - <div class="sub-content"> |
2016 | - <p> |
2017 | - {% trans 'Community Council candidates:' %} |
2018 | - {% if election.get_council_candidates %} |
2019 | - {% for candidate in election.get_council_candidates %} |
2020 | - <a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}">{{ candidate.display_name }}</a><br/> |
2021 | - {% endfor %} |
2022 | - {% else %} |
2023 | - <em>{% trans 'There are no candidates yet' %}/em> |
2024 | - {% endif %} |
2025 | - </p> |
2026 | - </div> |
2027 | - {% endif %} |
2028 | - </div> |
2029 | - {% endfor %} |
2030 | + {% for election in elections %} |
2031 | + {% include election.template %} |
2032 | + {% endfor %} |
2033 | {% else %} |
2034 | - <section class="minor-content"><p>{% trans 'No elections could be found' %} </p></section> |
2035 | + <article class="content content-medium content-left"> |
2036 | + <div class="content-inner"> |
2037 | + <p>{% trans 'No elections could be found' %}</p> |
2038 | + </div> |
2039 | + </article> |
2040 | {% endif %} |
2041 | {% endblock %} |
2042 | |
2043 | |
2044 | === modified file 'ubuntu_voting/templates/election/election_new.html' |
2045 | --- ubuntu_voting/templates/election/election_new.html 2011-04-02 15:41:46 +0000 |
2046 | +++ ubuntu_voting/templates/election/election_new.html 2011-11-19 16:23:22 +0000 |
2047 | @@ -6,7 +6,7 @@ |
2048 | {{ form.media }} |
2049 | {% endblock %} |
2050 | |
2051 | -{% block sub_nav_links %} |
2052 | +{% block election_sub_nav %} |
2053 | {% if perms.elections.add_election %} |
2054 | <a href="{% url election-new %}" class="sub-nav-item">{% trans 'New election' %}</a> |
2055 | {% endif %} |
2056 | @@ -15,15 +15,20 @@ |
2057 | <a href="{% url election-past %}" class="sub-nav-item">{% trans 'Ended elections' %}</a> |
2058 | {% endblock %} |
2059 | |
2060 | -{% block content %} |
2061 | - <section class="minor-content"> |
2062 | - <form method="POST" class="small"> |
2063 | - {% csrf_token %} |
2064 | - <ul> |
2065 | - {{ form.as_template }} |
2066 | - </ul> |
2067 | - <input type="submit" value="{% trans 'Save' %}" /> |
2068 | - </form> |
2069 | +{% block election_content %} |
2070 | + <section class="content content-medium content-left"> |
2071 | + <div class="content-inner"> |
2072 | + <h2>{% trans 'New election' %}</h2> |
2073 | + <form method="post"> |
2074 | + <fieldset> |
2075 | + {% csrf_token %} |
2076 | + <ul> |
2077 | + {{ form.as_template }} |
2078 | + </ul> |
2079 | + </fieldset> |
2080 | + <input type="submit" value="{% trans 'Save' %}" /> |
2081 | + </form> |
2082 | + </div> |
2083 | </section> |
2084 | {% endblock %} |
2085 | |
2086 | |
2087 | === modified file 'ubuntu_voting/templates/election/election_results.html' |
2088 | --- ubuntu_voting/templates/election/election_results.html 2011-09-21 17:18:11 +0000 |
2089 | +++ ubuntu_voting/templates/election/election_results.html 2011-11-19 16:23:22 +0000 |
2090 | @@ -5,30 +5,24 @@ |
2091 | <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery/jquery-1.4.2.min.js"></script> |
2092 | {% endblock %} |
2093 | |
2094 | -{% block content %} |
2095 | - {% comment %} |
2096 | - <section class="minor-content alone"> |
2097 | - <h3>{% trans 'Results Chair' %}</h3> |
2098 | - <div id="council-results"> |
2099 | - {% for candidate in chairs %} |
2100 | - <div class="graph-item"> |
2101 | - <hr class="graph-bar graph-bar-{{ candidate.is_chair }}" style="width:{{ candidate.relative_chair_percentage }}%;" /> |
2102 | - <div class="graph-label graph-label-{{ candidate.is_chair }}">{{ candidate }}<span class="result"> ({{ candidate.chair_percentage }}%)</span></div> |
2103 | - </div> |
2104 | - {% endfor %} |
2105 | - </div> |
2106 | - </section> |
2107 | - {% endcomment %} |
2108 | - <section class="minor-content alone"> |
2109 | - <h3>{% trans 'Results Community Council' %}</h3> |
2110 | - <div id="council-results"> |
2111 | - {% for candidate in council %} |
2112 | - <div class="graph-item"> |
2113 | - <hr class="graph-bar graph-bar-{{ candidate.is_council }}" style="width:{{ candidate.relative_council_percentage }}%;" /> |
2114 | - <div class="graph-label graph-label-{{ candidate.is_council }}">{{ candidate }}<span class="result"> ({{ candidate.council_percentage }}%)</span></div> |
2115 | - </div> |
2116 | - {% endfor %} |
2117 | - </div> |
2118 | - </section> |
2119 | +{% block election_content %} |
2120 | + {% include election.template %} |
2121 | + |
2122 | + {% if election.is_candidature_start %} |
2123 | + <article class="content content-medium content-left"> |
2124 | + <div class="content-inner"> |
2125 | + <h3>{% trans 'Candidates' %}</h3> |
2126 | + {% if election.get_council_candidates %} |
2127 | + <ul id="councilcandidateslist"> |
2128 | + {% for candidate in election.get_council_candidates %} |
2129 | + <li><a rel="external" title="{% blocktrans with candidate.display_name as candidate_name %}{{ candidate_name }} in Launchpad{% endblocktrans %}" href="{{ candidate.lp_profile }}" style="font-size:1.3em;">{{ candidate.display_name }}</a><br/>{% autoescape off %}{{ candidate.motivation }}{% endautoescape %}</li> |
2130 | + {% endfor %} |
2131 | + </ul> |
2132 | + {% else %} |
2133 | + <strong>{% trans 'There are no candidates yet' %}</strong> |
2134 | + {% endif %} |
2135 | + </div> |
2136 | + </article> |
2137 | + {% endif %} |
2138 | {% endblock %} |
2139 | |
2140 | |
2141 | === modified file 'ubuntu_voting/templates/election/election_vote.html' |
2142 | --- ubuntu_voting/templates/election/election_vote.html 2011-04-02 15:41:46 +0000 |
2143 | +++ ubuntu_voting/templates/election/election_vote.html 2011-11-19 16:23:22 +0000 |
2144 | @@ -6,15 +6,20 @@ |
2145 | {{ form.media }} |
2146 | {% endblock %} |
2147 | |
2148 | -{% block content %} |
2149 | - <section class="minor-content"> |
2150 | - <form method="POST" class="small"> |
2151 | - {% csrf_token %} |
2152 | - <ul> |
2153 | - {{ form.as_template }} |
2154 | - </ul> |
2155 | - <input type="submit" value="{% trans 'Vote' %}" /> |
2156 | - </form> |
2157 | +{% block election_content %} |
2158 | + <section class="content content-medium content-left"> |
2159 | + <div class="content-inner"> |
2160 | + <h2>{% trans 'cast your vote' %}</h2> |
2161 | + <form method="POST" class="small"> |
2162 | + <fieldset> |
2163 | + {% csrf_token %} |
2164 | + <ul> |
2165 | + {{ form.as_template }} |
2166 | + </ul> |
2167 | + </fieldset> |
2168 | + <input type="submit" value="{% trans 'Vote' %}" /> |
2169 | + </form> |
2170 | + </div> |
2171 | </section> |
2172 | {% endblock %} |
2173 | |
2174 | |
2175 | === added file 'ubuntu_voting/templates/election/incl_election_item_candidate.html' |
2176 | --- ubuntu_voting/templates/election/incl_election_item_candidate.html 1970-01-01 00:00:00 +0000 |
2177 | +++ ubuntu_voting/templates/election/incl_election_item_candidate.html 2011-11-19 16:23:22 +0000 |
2178 | @@ -0,0 +1,18 @@ |
2179 | +{% load i18n %} |
2180 | + |
2181 | +<article class="content content-medium content-left"> |
2182 | + <div class="content-inner"> |
2183 | + <h2><a href="{% url election-detail slug=election.slug %}">{{ election.name }}</a></h2> |
2184 | + {% autoescape off %} |
2185 | + {{ election.description }} |
2186 | + {% endautoescape %} |
2187 | + |
2188 | + {% for candidate in election.candidates.all %} |
2189 | + {{ candidate.display_name }} |
2190 | + {% endfor %} |
2191 | + </div> |
2192 | + <div class="button-bar"> |
2193 | + <div class="countdown">{% blocktrans with election.candidature_end|timeuntil:election.now as timeleft %}{{ timeleft }} left{% endblocktrans %}</div> |
2194 | + <a href="{% url election-run slug=election.slug %}" class="button button-right">{% trans "edit your candidature" %}</a> |
2195 | + </div> |
2196 | +</article> |
2197 | |
2198 | === added file 'ubuntu_voting/templates/election/incl_election_item_election.html' |
2199 | --- ubuntu_voting/templates/election/incl_election_item_election.html 1970-01-01 00:00:00 +0000 |
2200 | +++ ubuntu_voting/templates/election/incl_election_item_election.html 2011-11-19 16:23:22 +0000 |
2201 | @@ -0,0 +1,18 @@ |
2202 | +{% load i18n %} |
2203 | + |
2204 | +<article class="content content-medium content-left"> |
2205 | + <div class="content-inner"> |
2206 | + <h2><a href="{% url election-detail slug=election.slug %}">{{ election.name }}</a></h2> |
2207 | + {% autoescape off %} |
2208 | + {{ election.description }} |
2209 | + {% endautoescape %} |
2210 | + |
2211 | + {% for candidate in election.candidates.all %} |
2212 | + {{ candidate.display_name }} |
2213 | + {% endfor %} |
2214 | + </div> |
2215 | + <div class="button-bar"> |
2216 | + <div class="countdown">{% blocktrans with election.election_end|timeuntil:election.now as timeleft %}{{ timeleft }} left{% endblocktrans %}</div> |
2217 | + <a href="{% url election-vote slug=election.slug %}" class="button button-right">{% trans 'cast your vote' %}</a> |
2218 | + </div> |
2219 | +</article> |
2220 | |
2221 | === added file 'ubuntu_voting/templates/election/incl_election_item_pre_candidate.html' |
2222 | --- ubuntu_voting/templates/election/incl_election_item_pre_candidate.html 1970-01-01 00:00:00 +0000 |
2223 | +++ ubuntu_voting/templates/election/incl_election_item_pre_candidate.html 2011-11-19 16:23:22 +0000 |
2224 | @@ -0,0 +1,17 @@ |
2225 | +{% load i18n %} |
2226 | + |
2227 | +<article class="content content-medium content-left"> |
2228 | + <div class="content-inner"> |
2229 | + <h2><a href="{% url election-detail slug=election.slug %}">{{ election.name }}</a></h2> |
2230 | + {% autoescape off %} |
2231 | + {{ election.description }} |
2232 | + {% endautoescape %} |
2233 | + |
2234 | + {% for candidate in election.candidates.all %} |
2235 | + {{ candidate.display_name }} |
2236 | + {% endfor %} |
2237 | + </div> |
2238 | + <div class="button-bar"> |
2239 | + <div class="countdown">{% blocktrans with election.candidature_start|timeuntil:election.now as timeleft %}candidature starts in{{ timeleft }}{% endblocktrans %}</div> |
2240 | + </div> |
2241 | +</article> |
2242 | |
2243 | === added file 'ubuntu_voting/templates/election/incl_election_item_pre_election.html' |
2244 | --- ubuntu_voting/templates/election/incl_election_item_pre_election.html 1970-01-01 00:00:00 +0000 |
2245 | +++ ubuntu_voting/templates/election/incl_election_item_pre_election.html 2011-11-19 16:23:22 +0000 |
2246 | @@ -0,0 +1,17 @@ |
2247 | +{% load i18n %} |
2248 | + |
2249 | +<article class="content content-medium content-left"> |
2250 | + <div class="content-inner"> |
2251 | + <h2><a href="{% url election-detail slug=election.slug %}">{{ election.name }}</a></h2> |
2252 | + {% autoescape off %} |
2253 | + {{ election.description }} |
2254 | + {% endautoescape %} |
2255 | + |
2256 | + {% for candidate in election.candidates.all %} |
2257 | + {{ candidate.display_name }} |
2258 | + {% endfor %} |
2259 | + </div> |
2260 | + <div class="button-bar"> |
2261 | + <div class="countdown">{% blocktrans with election.election_start|timeuntil:election.now as timeleft %}election starts in{{ timeleft }}{% endblocktrans %}</div> |
2262 | + </div> |
2263 | +</article> |
2264 | |
2265 | === added file 'ubuntu_voting/templates/election/incl_election_item_results.html' |
2266 | --- ubuntu_voting/templates/election/incl_election_item_results.html 1970-01-01 00:00:00 +0000 |
2267 | +++ ubuntu_voting/templates/election/incl_election_item_results.html 2011-11-19 16:23:22 +0000 |
2268 | @@ -0,0 +1,22 @@ |
2269 | +{% load i18n %} |
2270 | + |
2271 | +{% block extrahead %} |
2272 | + <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery/jquery-1.4.2.min.js"></script> |
2273 | +{% endblock %} |
2274 | + |
2275 | +{% block election_content %} |
2276 | + <section class="content content-medium content-left"> |
2277 | + <div class="content-inner"> |
2278 | + <h2><a href="{% url election-detail slug=election.slug %}">{% blocktrans with election.name as election_name %}Results: {{ election_name }}{% endblocktrans %}<a></h2> |
2279 | + <div id="council-results"> |
2280 | + {% for candidate in election.top_council %} |
2281 | + <div class="graph-item"> |
2282 | + <hr class="graph-bar graph-bar-{{ candidate.is_council }}" style="width:{{ candidate.relative_council_percentage }}%;" /> |
2283 | + <div class="graph-label graph-label-{{ candidate.is_council }}">{{ candidate }}<span class="result"> ({{ candidate.council_percentage }}%)</span></div> |
2284 | + </div> |
2285 | + {% endfor %} |
2286 | + </div> |
2287 | + </div> |
2288 | + </section> |
2289 | +{% endblock %} |
2290 | + |
2291 | |
2292 | === modified file 'ubuntu_voting/templates/form.html' |
2293 | --- ubuntu_voting/templates/form.html 2011-02-16 21:17:38 +0000 |
2294 | +++ ubuntu_voting/templates/form.html 2011-11-19 16:23:22 +0000 |
2295 | @@ -1,9 +1,10 @@ |
2296 | {% load i18n %} |
2297 | {% for field in form.visible_fields %} |
2298 | <li class="form-item"> |
2299 | - {% if field.field.label %}<label for="id_{{ field.name }}">{{ field.label }}{% if field.field.required %}{% endif %} :</label>{% endif %} |
2300 | - {{ field }}{% if field.field.required %}<span class="required">*</span>{% endif %} |
2301 | - {% if field.help_text %}<span class="help" rel="help" title="{{ field.help_text }} {% if field.field.required %}({% trans "Verplicht" %}){% endif %}"><img src="/media/img/question.png" alt="?" /></span>{% endif %} |
2302 | + {% if field.field.label %}<label for="id_{{ field.name }}"{% if field.field.required %} class="required"{% endif %}>{{ field.label }}</label>{% endif %} |
2303 | + |
2304 | + {% if field.help_text %}<span class="help" rel="help" title="{{ field.help_text }}{% if field.field.required %} ({% trans "Required" %}){% endif %}"><img src="/media/img/question.png" width="16" height="16" alt="?" /></span>{% endif %} |
2305 | + {{ field }} |
2306 | {{ field.errors }} |
2307 | </li> |
2308 | {% endfor %} |
2309 | |
2310 | === modified file 'ubuntu_voting/urls.py' |
2311 | --- ubuntu_voting/urls.py 2011-04-02 15:41:46 +0000 |
2312 | +++ ubuntu_voting/urls.py 2011-11-19 16:23:22 +0000 |
2313 | @@ -1,4 +1,5 @@ |
2314 | from django.conf.urls.defaults import * |
2315 | +from django.utils.translation import ugettext_lazy as _ |
2316 | from django.conf import settings |
2317 | from django.contrib import admin |
2318 | import ubuntu_light_theme |
2319 | @@ -10,9 +11,10 @@ |
2320 | urlpatterns = patterns('', |
2321 | url(r'^$', 'elections.views.election_active', name='home'), |
2322 | url(r'^account/$', 'elections.views.account', name='account'), # to fill in your Full name, because the LP name is not always the right |
2323 | - url(r'^login/$', 'django_openid_auth.views.login_begin', name='login'), |
2324 | - url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout', kwargs={'next_page': '/'}), |
2325 | - url(r'^election/', include('ubuntu_voting.elections.urls')), |
2326 | + |
2327 | + url(_(r'^login/$'), 'django_openid_auth.views.login_begin', name='login'), |
2328 | + url(_(r'^logout/$'), 'django.contrib.auth.views.logout', name='logout', kwargs={'next_page': '/'}), |
2329 | + url(_(r'^election/'), include('ubuntu_voting.elections.urls')), |
2330 | |
2331 | # Uncomment the admin/doc line below to enable admin documentation: |
2332 | # (r'^admin/doc/', include('django.contrib.admindocs.urls')), |
2333 | @@ -27,6 +29,7 @@ |
2334 | (r'^tinymce/', include('tinymce.urls')), |
2335 | ) |
2336 | |
2337 | + |
2338 | if settings.STATIC_SERVE: |
2339 | urlpatterns += patterns('', |
2340 | (r'^media/(?P<path>.*)$', 'django.views.static.serve', |