Merge lp:~daker/loco-team-portal/fix.forms into lp:loco-team-portal
- fix.forms
- Merge into 0.2
Proposed by
Adnane Belmadiaf
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Adnane Belmadiaf | ||||
Approved revision: | 613 | ||||
Merged at revision: | 613 | ||||
Proposed branch: | lp:~daker/loco-team-portal/fix.forms | ||||
Merge into: | lp:loco-team-portal | ||||
Diff against target: |
994 lines (+437/-308) 14 files modified
loco_directory/events/forms.py (+4/-18) loco_directory/events/models.py (+0/-1) loco_directory/events/widgets.py (+90/-0) loco_directory/media/css/styles.css (+208/-109) loco_directory/media/js/events-ui.js (+1/-5) loco_directory/meetings/forms.py (+4/-9) loco_directory/templates/events/global_event_new.html (+13/-22) loco_directory/templates/events/global_event_update.html (+13/-20) loco_directory/templates/events/team_event_new.html (+19/-26) loco_directory/templates/events/team_event_update.html (+13/-20) loco_directory/templates/form.html (+18/-0) loco_directory/templates/meetings/team_meeting_new.html (+11/-18) loco_directory/templates/meetings/team_meeting_update.html (+11/-18) loco_directory/templates/teams/team_update.html (+32/-42) |
||||
To merge this branch: | bzr merge lp:~daker/loco-team-portal/fix.forms | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
LoCo Team Portal Developers | Pending | ||
Review via email: mp+148917@code.launchpad.net |
Commit message
Fixed the forms style
Description of the change
To post a comment you must log in.
Revision history for this message
Tarmac WebDev (tarmac-webdev) wrote : | # |
- 613. By Adnane Belmadiaf
-
Merged trunk
Fixed #797992
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'loco_directory/events/forms.py' |
2 | --- loco_directory/events/forms.py 2013-02-16 00:29:22 +0000 |
3 | +++ loco_directory/events/forms.py 2013-02-18 21:30:29 +0000 |
4 | @@ -8,6 +8,7 @@ |
5 | from venues.models import Venue |
6 | from common.forms import RenderableMixin |
7 | from userprofiles.models import UserProfile |
8 | +from .widgets import DateTimeWidget |
9 | |
10 | import itertools |
11 | |
12 | @@ -43,23 +44,17 @@ |
13 | |
14 | class Media: |
15 | css = {'all': ( |
16 | - settings.MEDIA_URL + 'jquery-ui/css/css/smoothness/jquery-ui.css', |
17 | - settings.MEDIA_URL + 'jquery-ui-timepicker/css/ui-lightness/ui.timepickr.css', |
18 | - settings.MEDIA_URL + 'css/colortip-1.0-jquery.css', |
19 | + settings.MEDIA_URL + 'jquery-ui/css/smoothness/jquery-ui.css', |
20 | )} |
21 | js = ( |
22 | - settings.MEDIA_URL + 'jquery/jquery.js', |
23 | settings.MEDIA_URL + 'jquery-ui/jquery-ui.js', |
24 | - settings.MEDIA_URL + 'jquery-ui-timepicker/js/jquery.timepickr.min.js', |
25 | - settings.MEDIA_URL + 'jquery-ui-timepicker/js/ui.timepickr.min.js', |
26 | - settings.MEDIA_URL + 'js/colortip-1.0-jquery.js', |
27 | settings.MEDIA_URL + 'js/events-ui.js', |
28 | ) |
29 | |
30 | def __init__(self, *args, **kargs): |
31 | super(BaseEventForm, self).__init__(*args, **kargs) |
32 | - self.fields['date_begin'].widget = forms.SplitDateTimeWidget() |
33 | - self.fields['date_end'].widget = forms.SplitDateTimeWidget() |
34 | + self.fields['date_begin'].widget = DateTimeWidget() |
35 | + self.fields['date_end'].widget = DateTimeWidget() |
36 | |
37 | def clean(self): |
38 | begin = self.cleaned_data.get('date_begin') |
39 | @@ -184,12 +179,3 @@ |
40 | class Meta: |
41 | model = TeamEventComment |
42 | exclude = ('team_event', 'date_created', 'commenter_profile') |
43 | - |
44 | - class Media: |
45 | - css = {'all': ( |
46 | - settings.MEDIA_URL + 'css/colortip-1.0-jquery.css', |
47 | - )} |
48 | - js = ( |
49 | - settings.MEDIA_URL + 'jquery/jquery.js', |
50 | - settings.MEDIA_URL + 'js/colortip-1.0-jquery.js', |
51 | - ) |
52 | |
53 | === modified file 'loco_directory/events/models.py' |
54 | --- loco_directory/events/models.py 2013-02-16 00:29:22 +0000 |
55 | +++ loco_directory/events/models.py 2013-02-18 21:30:29 +0000 |
56 | @@ -93,7 +93,6 @@ |
57 | venue = models.ForeignKey(Venue, help_text=_('Venue for the Event'), verbose_name=_('Event Venue'), blank=True, null=True) |
58 | channel = models.CharField(help_text=_('Channel for the Event hosted on the freenode IRC network. Ex. #ubuntu-us-fl'), max_length=25, verbose_name=_('Event Channel'), blank=True, null=True) |
59 | registration = models.URLField(verbose_name=_('Registration URL'), help_text=_('URL to register attendance (leave blank to use the built-in registration system)'), max_length=200, verify_exists=False, blank=True, null=True) |
60 | - template = 'events/team_event_li.inc.html' |
61 | |
62 | objects = TeamEventManager() |
63 | |
64 | |
65 | === added file 'loco_directory/events/widgets.py' |
66 | --- loco_directory/events/widgets.py 1970-01-01 00:00:00 +0000 |
67 | +++ loco_directory/events/widgets.py 2013-02-18 21:30:29 +0000 |
68 | @@ -0,0 +1,90 @@ |
69 | +# -*- coding: utf-8 -*- |
70 | +from datetime import time |
71 | +from time import strptime, strftime |
72 | + |
73 | +from django import forms |
74 | +from django.utils.translation import ugettext as _ |
75 | + |
76 | + |
77 | +class DateWidget(forms.DateInput): |
78 | + """A more-friendly date widget with a pop-up calendar. |
79 | + """ |
80 | + def __init__(self, attrs=None): |
81 | + self.date_class = 'datepicker' |
82 | + if not attrs: |
83 | + attrs = {} |
84 | + if 'date_class' in attrs: |
85 | + self.date_class = attrs.pop('date_class') |
86 | + if 'class' not in attrs: |
87 | + attrs['class'] = 'date' |
88 | + |
89 | + super(DateWidget, self).__init__(attrs=attrs) |
90 | + |
91 | + def render(self, name, value, attrs=None): |
92 | + return '<span class="%s">%s</span>' % (self.date_class, super(DateWidget, self).render(name, value, attrs)) |
93 | + |
94 | + |
95 | +class TimeWidget(forms.MultiWidget): |
96 | + """A more-friendly time widget. |
97 | + """ |
98 | + def __init__(self, attrs=None): |
99 | + self.time_class = 'timepicker' |
100 | + if not attrs: |
101 | + attrs = {} |
102 | + if 'time_class' in attrs: |
103 | + self.time_class = attrs.pop('time_class') |
104 | + if 'class' not in attrs: |
105 | + attrs['class'] = 'time' |
106 | + |
107 | + widgets = ( |
108 | + forms.Select(attrs=attrs, choices=[(i + 1, "%02d" % (i + 1)) for i in range(0, 12)]), |
109 | + forms.Select(attrs=attrs, choices=[(i, "%02d" % i) for i in range(00, 60, 15)]), |
110 | + forms.Select(attrs=attrs, choices=[('AM', _('AM')), ('PM', _('PM'))]) |
111 | + ) |
112 | + |
113 | + super(TimeWidget, self).__init__(widgets, attrs) |
114 | + |
115 | + def decompress(self, value): |
116 | + if isinstance(value, time): |
117 | + hour = int(value.strftime("%I")) |
118 | + minute = int(value.strftime("%M")) |
119 | + meridian = value.strftime("%p") |
120 | + return (hour, minute, meridian) |
121 | + return (None, None, None) |
122 | + |
123 | + def value_from_datadict(self, data, files, name): |
124 | + value = super(TimeWidget, self).value_from_datadict(data, files, name) |
125 | + t = strptime("%02d:%02d %s" % (int(value[0]), int(value[1]), value[2]), "%I:%M %p") |
126 | + return strftime("%H:%M:%S", t) |
127 | + |
128 | + def format_output(self, rendered_widgets): |
129 | + return '<span class="%s">%s%s%s</span>' % ( |
130 | + self.time_class, |
131 | + rendered_widgets[0], rendered_widgets[1], rendered_widgets[2] |
132 | + ) |
133 | + |
134 | + |
135 | +class DateTimeWidget(forms.SplitDateTimeWidget): |
136 | + """A more-friendly date/time widget. |
137 | + |
138 | + Inspired by: |
139 | + |
140 | + http://copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for-django/ |
141 | + """ |
142 | + def __init__(self, attrs=None, date_format=None, time_format=None): |
143 | + super(DateTimeWidget, self).__init__(attrs, date_format, time_format) |
144 | + self.widgets = ( |
145 | + DateWidget(attrs=attrs), |
146 | + TimeWidget(attrs=attrs), |
147 | + ) |
148 | + |
149 | + def decompress(self, value): |
150 | + if value: |
151 | + d = strftime("%Y-%m-%d", value.timetuple()) |
152 | + t = strftime("%I:%M %p", value.timetuple()) |
153 | + return (d, t) |
154 | + else: |
155 | + return (None, None) |
156 | + |
157 | + def format_output(self, rendered_widgets): |
158 | + return '%s%s' % (rendered_widgets[0], rendered_widgets[1]) |
159 | |
160 | === modified file 'loco_directory/media/css/styles.css' |
161 | --- loco_directory/media/css/styles.css 2013-02-16 18:50:41 +0000 |
162 | +++ loco_directory/media/css/styles.css 2013-02-18 21:30:29 +0000 |
163 | @@ -352,113 +352,133 @@ |
164 | margin: 0; |
165 | } |
166 | |
167 | -/* TODO: date_begin and date_end should have class .small */ |
168 | -#id_date_begin_0, #id_date_begin_1, #id_date_end_0, #id_date_end_1 { |
169 | - width: 134px; |
170 | -} |
171 | -#id_date_begin_0:focus, #id_date_begin_1:focus, #id_date_end_0:focus, #id_date_end_1:focus { |
172 | - width: 132px; |
173 | -} |
174 | -/* |
175 | -.form { |
176 | - width: 500px; |
177 | - float:left; |
178 | -} |
179 | - |
180 | -.form div{ |
181 | - padding-top:2px; |
182 | - padding-bottom:2px; |
183 | -} |
184 | - |
185 | -.form div span.help{ |
186 | - font-size:20px; |
187 | - color: #DD4814; |
188 | - cursor:pointer; |
189 | - vertical-align: top; |
190 | - display:inline; |
191 | - |
192 | -} |
193 | - |
194 | -.form input[type="text"], .form textarea, .form select { |
195 | - padding: 5px; |
196 | - width: 200px; |
197 | - margin: 0px 0px 5px 0px; |
198 | - border: 1px solid #ccc; |
199 | -} |
200 | - |
201 | -.form input[type="text"] { |
202 | - margin-right: 10px; |
203 | -} |
204 | - |
205 | -.form input[type="checkbox"] { |
206 | - width: 200px; |
207 | - height:35px; |
208 | - margin: 0px 0px 5px 0px; |
209 | -} |
210 | - |
211 | -.form div div.field { |
212 | - float: left; |
213 | - padding-top: 5px; |
214 | -} |
215 | - |
216 | -.form div.approved, .form div.approved_date, .form div.expires_date { |
217 | - height:30px; |
218 | -} |
219 | - |
220 | -.form span.extra { |
221 | - float: left; |
222 | - padding-top: 5px; |
223 | - font-size:0.8em; |
224 | -} |
225 | - |
226 | -.form div div.field label{ |
227 | - float: left; |
228 | - padding-right: 10px; |
229 | - width: 170px; |
230 | - font-size: 0.8em; |
231 | - text-align: right; |
232 | - font-weight:normal; |
233 | -} |
234 | - |
235 | -.form div span.required { |
236 | - font-size:20px; |
237 | - color: red; |
238 | - margin-left:5px; |
239 | - vertical-align: top; |
240 | - display:inline; |
241 | -} |
242 | - |
243 | -.form textarea { |
244 | - height: 90px; |
245 | - width: 270px; |
246 | -} |
247 | - |
248 | - |
249 | -.form select:focus, .form textarea:focus, .form input:focus { |
250 | - border: 1px solid #900; |
251 | -} |
252 | - |
253 | -.form input.submit-button { |
254 | - padding-left: 20px; |
255 | - padding-right: 20px; |
256 | - float: right; |
257 | - margin-right: 50px; |
258 | -} |
259 | - |
260 | -.form ul.errorlist { |
261 | - margin: 0px; |
262 | - padding: 0px; |
263 | -} |
264 | - |
265 | -.form .errorlist li { |
266 | - color: red; |
267 | - font-weight: bold; |
268 | - display: block; |
269 | - font-size: 0.8em; |
270 | - margin: 0px 130px 3px; |
271 | - padding: 4px 5px; |
272 | -} |
273 | -*/ |
274 | +#id_date_begin_0, #id_date_begin_1, |
275 | +#id_date_end_0, #id_date_end_1, |
276 | +#id_date_begin_1_0, #id_date_begin_1_1, #id_date_begin_1_2, |
277 | +#id_date_end_1_0, #id_date_end_1_1, #id_date_end_1_2 { |
278 | + width: 100px; |
279 | + display: inline; |
280 | +} |
281 | + |
282 | +#id_date_begin_1_0, #id_date_begin_1_1, #id_date_begin_1_2, |
283 | +#id_date_end_1_0, #id_date_end_1_1, #id_date_end_1_2 { |
284 | + width: 60px; |
285 | +} |
286 | + |
287 | +#id_name, #id_announce, #id_registration { |
288 | + width: 350px; |
289 | +} |
290 | + |
291 | +form.form { |
292 | + margin-bottom: 10px; |
293 | +} |
294 | + |
295 | +form.form div{ |
296 | + margin-top: 10px; |
297 | + margin-bottom: 10px; |
298 | +} |
299 | + |
300 | +form.form div ul.errorlist + input, |
301 | +form.form div ul.errorlist + select, |
302 | +form.form div ul.errorlist + textarea { |
303 | + background-color: #fff6f6; |
304 | + border-color: #eec3c7; |
305 | +} |
306 | + |
307 | +form.form div label{ |
308 | + font-size: 14px; |
309 | + margin-bottom: 5px; |
310 | + cursor:default; |
311 | +} |
312 | + |
313 | +form.form div span.h{ |
314 | + color: #a1a1a1; |
315 | + font-size: 12px; |
316 | + font-style: italic; |
317 | + display: block; |
318 | + margin-bottom: 15px; |
319 | +} |
320 | + |
321 | +form.form input[type="text"], form.form textarea, form.form select { |
322 | + height: auto; |
323 | + box-sizing: border-box; |
324 | + -moz-box-sizing: border-box; |
325 | + border: 1px solid #ddd; |
326 | + padding: 8px; |
327 | + border-radius: 3px; |
328 | + -moz-border-radius: 3px; |
329 | + -webkit-border-radius: 3px; |
330 | + font-size: 13px; |
331 | + margin-right: 10px; |
332 | +} |
333 | + |
334 | +form.form input[type="text"] { |
335 | + margin-right: 10px; |
336 | +} |
337 | + |
338 | +form.form input[type="checkbox"] { |
339 | + margin: 0px 0px 5px 0px; |
340 | +} |
341 | + |
342 | +form.form div span.required { |
343 | + font-size:20px; |
344 | + color: #b94a5c; |
345 | + margin-left: 5px; |
346 | + vertical-align: top; |
347 | + display: inline; |
348 | +} |
349 | + |
350 | +form.form textarea { |
351 | + height: 180px; |
352 | + width: 520px!important; |
353 | + max-width: 500px!important; |
354 | + min-width: auto!important; |
355 | +} |
356 | + |
357 | +form.form select:focus, form.form textarea:focus, form.form input:focus { |
358 | + border: 1px solid #900; |
359 | +} |
360 | + |
361 | +form.form input.btn { |
362 | + background: transparent url(../images/bg_btn.png) repeat-x top left; |
363 | + -webkit-border-radius: 4px; |
364 | + -moz-border-radius: 4px; |
365 | + border-radius: 4px; |
366 | + font-size: 13px; |
367 | + font-weight: bold; |
368 | + text-align: center; |
369 | + white-space: nowrap; |
370 | + margin: 0; |
371 | + outline: 0; |
372 | + padding: 7px 25px; |
373 | + color: white; |
374 | + text-shadow: 0 1px rgba(0, 0, 0, 0.1); |
375 | + position: relative; |
376 | + display: inline-block; |
377 | + text-transform: uppercase; |
378 | +} |
379 | + |
380 | +form.form input.btn:active { |
381 | + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); |
382 | + -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.3); |
383 | + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); |
384 | +} |
385 | + |
386 | +form.form ul.errorlist { |
387 | + margin: 0px; |
388 | + padding: 0px; |
389 | + color: #b94a5c; |
390 | + display: block; |
391 | +} |
392 | + |
393 | +form.form ul.errorlist li { |
394 | + font-weight: bold; |
395 | + display: block; |
396 | + font-size: 0.9em; |
397 | + margin: 0; |
398 | + padding: 0; |
399 | + background: transparent; |
400 | +} |
401 | |
402 | h3.attendees-title { |
403 | display: inline-block; |
404 | @@ -473,6 +493,11 @@ |
405 | text-transform: uppercase; |
406 | margin-top: 10px; |
407 | } |
408 | + |
409 | +form fieldset { |
410 | + padding: 15px 20px 15px 20px !important; |
411 | +} |
412 | + |
413 | ul.attendees { |
414 | margin: 0; |
415 | padding: 0; |
416 | @@ -487,7 +512,7 @@ |
417 | } |
418 | |
419 | .attendee-mugshot { |
420 | - cursor: pointer; |
421 | + cursor: pointer; |
422 | float: left; |
423 | height: 32px; |
424 | margin-right: 10px; |
425 | @@ -1600,6 +1625,80 @@ |
426 | font-size: 0.8em; |
427 | } |
428 | |
429 | + |
430 | +/* CALENDAR STYLES */ |
431 | +.ui-datepicker-calendar thead{ |
432 | + display:none; |
433 | +} |
434 | + |
435 | +#ui-datepicker-div{ |
436 | + font-size:13px; |
437 | + line-height:1.8em; |
438 | + z-index:10000 !important; |
439 | + border:5px solid #455868; |
440 | + -webkit-border-radius: 4px; |
441 | + -moz-border-radius: 4px; |
442 | + border-radius: 4px; |
443 | + margin-top:6px; |
444 | + margin-left:-60px; |
445 | + padding-bottom:10px; |
446 | +} |
447 | + |
448 | +.ui-datepicker{ |
449 | + padding:0 !important; |
450 | + padding-bottom: 3px !important; |
451 | + width:auto !important; |
452 | +} |
453 | + |
454 | +.ui-datepicker table{ |
455 | + margin:0 !important; |
456 | + width:auto !important; |
457 | +} |
458 | + |
459 | +.ui-datepicker td{ |
460 | + padding:0 !important; |
461 | + border:1px solid #ECECEC !important; |
462 | + width:29px; |
463 | + height:29px; |
464 | +} |
465 | + |
466 | +.ui-datepicker td a { |
467 | + text-align: center!important; |
468 | +} |
469 | + |
470 | +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{ |
471 | + border: 0 none !important; |
472 | + background:none !important; |
473 | +} |
474 | + |
475 | +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, |
476 | +.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus{ |
477 | + border: 0 none !important; |
478 | + background: #909DA7 !important; |
479 | + color:#FFFFFF !important; |
480 | +} |
481 | + |
482 | +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active{ |
483 | + color:#FFFFFF !important; |
484 | + background: #909DA7 !important; |
485 | +} |
486 | + |
487 | +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight{ |
488 | + border: 0 none !important; |
489 | +} |
490 | + |
491 | +.ui-datepicker-prev.ui-state-hover, .ui-datepicker-next.ui-state-hover { |
492 | + background:none !important; |
493 | +} |
494 | + |
495 | +.ui-widget-header { |
496 | + background: #dd4814 !important; |
497 | + -moz-border-radius: 0 !important; |
498 | + -webkit-border-radius: 0 !important; |
499 | + border-radius: 0 !important; |
500 | + color: #fff !important; |
501 | +} |
502 | + |
503 | #lc { |
504 | padding: 15px; |
505 | border-top: 1px solid #E6E6E6; |
506 | @@ -1616,4 +1715,4 @@ |
507 | |
508 | #lc ul li:last-child { |
509 | margin-bottom: 0; |
510 | -} |
511 | \ No newline at end of file |
512 | +} |
513 | |
514 | === modified file 'loco_directory/media/js/events-ui.js' |
515 | --- loco_directory/media/js/events-ui.js 2012-03-22 21:57:48 +0000 |
516 | +++ loco_directory/media/js/events-ui.js 2013-02-18 21:30:29 +0000 |
517 | @@ -6,12 +6,8 @@ |
518 | }); |
519 | |
520 | $("#id_date_begin_0").datepicker({altField: "#id_date_end_0", altFormat: "yy-mm-dd"}); |
521 | - $('#id_date_begin_1').timepickr({ trigger: 'focus', convention: 24 }); |
522 | |
523 | $("#id_date_end_0").datepicker(); |
524 | - $('#id_date_end_1').timepickr({ trigger: 'focus', convention: 24 }); |
525 | - |
526 | - $('span[rel*=help]').colorTip({color:'orange'}); |
527 | |
528 | $('#id_filtering').datepicker( { |
529 | changeYear: true, |
530 | @@ -19,7 +15,7 @@ |
531 | showButtonPanel: true, |
532 | dateFormat: 'yy-m', |
533 | onClose: function(dateText, inst) { |
534 | - |
535 | + |
536 | var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); |
537 | var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); |
538 | $(this).datepicker('setDate', new Date(year, month, 1)); |
539 | |
540 | === modified file 'loco_directory/meetings/forms.py' |
541 | --- loco_directory/meetings/forms.py 2013-02-05 23:23:30 +0000 |
542 | +++ loco_directory/meetings/forms.py 2013-02-18 21:30:29 +0000 |
543 | @@ -6,6 +6,7 @@ |
544 | from models import BaseMeeting, TeamMeeting, AgendaItem |
545 | from common.forms import RenderableMixin |
546 | from userprofiles.models import UserProfile |
547 | +from events.widgets import DateTimeWidget |
548 | |
549 | import urllib |
550 | |
551 | @@ -32,23 +33,17 @@ |
552 | |
553 | class Media: |
554 | css = {'all': ( |
555 | - settings.MEDIA_URL + 'jquery-ui/css/css/smoothness/jquery-ui.css', |
556 | - settings.MEDIA_URL + 'jquery-ui-timepicker/css/ui-lightness/ui.timepickr.css', |
557 | - settings.MEDIA_URL + 'css/colortip-1.0-jquery.css', |
558 | + settings.MEDIA_URL + 'jquery-ui/css/smoothness/jquery-ui.css', |
559 | )} |
560 | js = ( |
561 | - settings.MEDIA_URL + 'jquery/jquery.js', |
562 | settings.MEDIA_URL + 'jquery-ui/jquery-ui.js', |
563 | - settings.MEDIA_URL + 'jquery-ui-timepicker/js/jquery.timepickr.min.js', |
564 | - settings.MEDIA_URL + 'jquery-ui-timepicker/js/ui.timepickr.min.js', |
565 | settings.MEDIA_URL + 'js/events-ui.js', |
566 | - settings.MEDIA_URL + 'js/colortip-1.0-jquery.js', |
567 | ) |
568 | |
569 | def __init__(self, *args, **kargs): |
570 | super(BaseMeetingForm, self).__init__(*args, **kargs) |
571 | - self.fields['date_begin'].widget = forms.SplitDateTimeWidget() |
572 | - self.fields['date_end'].widget = forms.SplitDateTimeWidget() |
573 | + self.fields['date_begin'].widget = DateTimeWidget() |
574 | + self.fields['date_end'].widget = DateTimeWidget() |
575 | |
576 | def clean(self): |
577 | begin = self.cleaned_data.get('date_begin') |
578 | |
579 | === modified file 'loco_directory/templates/events/global_event_new.html' |
580 | --- loco_directory/templates/events/global_event_new.html 2012-12-26 17:23:50 +0000 |
581 | +++ loco_directory/templates/events/global_event_new.html 2013-02-18 21:30:29 +0000 |
582 | @@ -4,31 +4,22 @@ |
583 | {% block page_name %}{% trans "New Global Event" %}{% endblock %} |
584 | |
585 | {% block extrahead %}{{ block.super }} |
586 | -{{form.media}} |
587 | -<script type="text/javascript" src="{{MEDIA_URL}}js/colortip-1.0-jquery.js"></script> |
588 | -<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/colortip-1.0-jquery.css"/> |
589 | -{% endblock %} |
590 | - |
591 | -{% block extrafooter %} |
592 | -<script type="text/javascript"><!-- |
593 | -$(document).ready(function(){ |
594 | - $('span[rel*=help]').colorTip({color:'orange'}); |
595 | -}); |
596 | ---></script> |
597 | +{{ form.media }} |
598 | {% endblock %} |
599 | |
600 | {% block content %} |
601 | <div class="row"> |
602 | -<section class="span-9"> |
603 | - <form action="." method="post">{% csrf_token %} |
604 | - <fieldset> |
605 | - <h3>{% trans "Add new Global Event" %}</h3> |
606 | - {{ form.as_template }} |
607 | - </fieldset> |
608 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
609 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
610 | - </form> |
611 | -</section> |
612 | + <section class="span-9"> |
613 | + <div class="box_content"> |
614 | + <div class="pagelet"> |
615 | + <form action="." method="post" class="form">{% csrf_token %} |
616 | + <h2>{% trans "Add new Global Event" %}</h2> |
617 | + {{ form.as_template }} |
618 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
619 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
620 | + </form> |
621 | + </div> |
622 | + </div> |
623 | + </section> |
624 | </div> |
625 | - |
626 | {% endblock %} |
627 | |
628 | === modified file 'loco_directory/templates/events/global_event_update.html' |
629 | --- loco_directory/templates/events/global_event_update.html 2012-12-26 17:23:50 +0000 |
630 | +++ loco_directory/templates/events/global_event_update.html 2013-02-18 21:30:29 +0000 |
631 | @@ -4,29 +4,22 @@ |
632 | {% block page_name %}{% trans "Update Global Event" %}{% endblock %} |
633 | |
634 | {% block extrahead %}{{ block.super }} |
635 | -{{form.media}} |
636 | -{% endblock %} |
637 | - |
638 | -{% block extrafooter %} |
639 | -<script type="text/javascript"><!-- |
640 | -$(document).ready(function(){ |
641 | - $('span[rel*=help]').colorTip({color:'orange'}); |
642 | -}); |
643 | ---></script> |
644 | +{{ form.media }} |
645 | {% endblock %} |
646 | |
647 | {% block content %} |
648 | <div class="row"> |
649 | -<section class="span-9"> |
650 | - <form action="." method="post">{% csrf_token %} |
651 | - <fieldset> |
652 | - <h3>{% trans "Update Global Event" %}</h3> |
653 | - {{ form.as_template }} |
654 | - </fieldset> |
655 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
656 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
657 | - </form> |
658 | -</section> |
659 | + <section class="span-9"> |
660 | + <div class="box_content"> |
661 | + <div class="pagelet"> |
662 | + <form action="." method="post" class="form">{% csrf_token %} |
663 | + <h2>{% trans "Update Global Event" %}</h2> |
664 | + {{ form.as_template }} |
665 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
666 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
667 | + </form> |
668 | + </div> |
669 | + </div> |
670 | + </section> |
671 | </div> |
672 | - |
673 | {% endblock %} |
674 | |
675 | === modified file 'loco_directory/templates/events/team_event_new.html' |
676 | --- loco_directory/templates/events/team_event_new.html 2012-12-26 17:23:50 +0000 |
677 | +++ loco_directory/templates/events/team_event_new.html 2013-02-18 21:30:29 +0000 |
678 | @@ -4,37 +4,30 @@ |
679 | {% block page_name %}{% trans "New Team Event" %}{% endblock %} |
680 | |
681 | {% block extrahead %}{{ block.super }} |
682 | -{{form.media}} |
683 | +{{ form.media }} |
684 | {% if global_event %} |
685 | -<script> |
686 | - $.datepicker.setDefaults({ |
687 | - minDate: new Date({{global_event.date_begin.year}}, {{global_event.date_begin.month}}-1, {{global_event.date_begin.day}} ), |
688 | - maxDate: new Date({{global_event.date_end.year}}, {{global_event.date_end.month}}-1, {{global_event.date_end.day}} ) |
689 | - }); |
690 | +<script type="text/javascript"> |
691 | + $.datepicker.setDefaults({ |
692 | + minDate: new Date({{ global_event.date_begin.year }}, {{ global_event.date_begin.month }}-1, {{ global_event.date_begin.day }} ), |
693 | + maxDate: new Date({{ global_event.date_end.year }}, {{ global_event.date_end.month }}-1, {{ global_event.date_end.day }} ) |
694 | + }); |
695 | </script> |
696 | {% endif %} |
697 | {% endblock %} |
698 | |
699 | -{% block extrafooter %} |
700 | -<script type="text/javascript"><!-- |
701 | -$(document).ready(function(){ |
702 | - $('span[rel*=help]').colorTip({color:'orange'}); |
703 | -}); |
704 | ---></script> |
705 | -{% endblock %} |
706 | - |
707 | {% block content %} |
708 | <div class="row"> |
709 | -<section class="span-9"> |
710 | - <form action="." method="post">{% csrf_token %} |
711 | - <fieldset> |
712 | - <h3>{% trans "Add new Team Event for " %}{{ team_object.name}}<span class="supporting">{% trans 'is required' %}</span></h3> |
713 | - {{ form.as_template }} |
714 | - </fieldset> |
715 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
716 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
717 | - </form> |
718 | -</section> |
719 | + <section class="span-9"> |
720 | + <div class="box_content"> |
721 | + <div class="pagelet"> |
722 | + <form action="." method="post" class="form">{% csrf_token %} |
723 | + <h2>{% trans "Add new Team Event for " %}{{ team_object.name}}</h2> |
724 | + {{ form.as_template }} |
725 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
726 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
727 | + </form> |
728 | + </div> |
729 | + </div> |
730 | + </section> |
731 | </div> |
732 | - |
733 | -{% endblock %} |
734 | +{% endblock %} |
735 | \ No newline at end of file |
736 | |
737 | === modified file 'loco_directory/templates/events/team_event_update.html' |
738 | --- loco_directory/templates/events/team_event_update.html 2012-12-26 17:23:50 +0000 |
739 | +++ loco_directory/templates/events/team_event_update.html 2013-02-18 21:30:29 +0000 |
740 | @@ -4,29 +4,22 @@ |
741 | {% block page_name %}{% trans "Update Team Event" %}{% endblock %} |
742 | |
743 | {% block extrahead %}{{ block.super }} |
744 | -{{form.media}} |
745 | -{% endblock %} |
746 | - |
747 | -{% block extrafooter %} |
748 | -<script type="text/javascript"><!-- |
749 | -$(document).ready(function(){ |
750 | - $('span[rel*=help]').colorTip({color:'orange'}); |
751 | -}); |
752 | ---></script> |
753 | +{{ form.media }} |
754 | {% endblock %} |
755 | |
756 | {% block content %} |
757 | <div class="row"> |
758 | -<section class="span-9"> |
759 | - <form action="." method="post">{% csrf_token %} |
760 | - <fieldset> |
761 | - <h3>{% trans "Update Team Event" %}</h3> |
762 | - {{ form.as_template }} |
763 | - </fieldset> |
764 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
765 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
766 | - </form> |
767 | -</section> |
768 | + <section class="span-9"> |
769 | + <div class="box_content"> |
770 | + <div class="pagelet"> |
771 | + <form action="." method="post" class="form">{% csrf_token %} |
772 | + <h2>{% trans "Update Team Event" %}</h2> |
773 | + {{ form.as_template }} |
774 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
775 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
776 | + </form> |
777 | + </div> |
778 | + </div> |
779 | + </section> |
780 | </div> |
781 | - |
782 | {% endblock %} |
783 | |
784 | === added file 'loco_directory/templates/form.html' |
785 | --- loco_directory/templates/form.html 1970-01-01 00:00:00 +0000 |
786 | +++ loco_directory/templates/form.html 2013-02-18 21:30:29 +0000 |
787 | @@ -0,0 +1,18 @@ |
788 | +{% load i18n %} |
789 | +{% for field in form.visible_fields %} |
790 | + <div> |
791 | + {% if field.field.label %}<label for="id_{{ field.name }}"{% if field.field.required %} class="required"{% endif %}>{{ field.label }}</label>{% endif %} |
792 | + {% if field.errors %} |
793 | + <ul class="errorlist"> |
794 | + {% for error in field.errors %} |
795 | + <li class="error">{{ error }}</li> |
796 | + {% endfor %} |
797 | + </ul> |
798 | + {% endif %} |
799 | + {{ field }} |
800 | + {% if field.help_text %}<span class="h">{{ field.help_text }}</span>{% endif %} |
801 | + </div> |
802 | +{% endfor %} |
803 | +{% for field in form.hidden_fields %} |
804 | + <div class="hidden">{{ field }}</div> |
805 | +{% endfor %} |
806 | |
807 | === modified file 'loco_directory/templates/meetings/team_meeting_new.html' |
808 | --- loco_directory/templates/meetings/team_meeting_new.html 2012-12-26 17:23:50 +0000 |
809 | +++ loco_directory/templates/meetings/team_meeting_new.html 2013-02-18 21:30:29 +0000 |
810 | @@ -4,29 +4,22 @@ |
811 | {% block page_name %}{% trans "New Team Meeting" %}{% endblock %} |
812 | |
813 | {% block extrahead %}{{ block.super }} |
814 | -{{form.media}} |
815 | -{% endblock %} |
816 | - |
817 | -{% block extrafooter %} |
818 | -<script type="text/javascript"><!-- |
819 | -$(document).ready(function(){ |
820 | - $('span[rel*=help]').colorTip({color:'orange'}); |
821 | -}); |
822 | ---></script> |
823 | +{{ form.media }} |
824 | {% endblock %} |
825 | |
826 | {% block content %} |
827 | <div class="row"> |
828 | <section class="span-9"> |
829 | - <form action="." method="post">{% csrf_token %} |
830 | - <fieldset> |
831 | - <h3>{% trans "Add new Team Meeting for " %}{{ team_object.name}}</h3> |
832 | - {{ form.as_template }} |
833 | - </fieldset> |
834 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
835 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
836 | - </form> |
837 | + <div class="box_content"> |
838 | + <div class="pagelet"> |
839 | + <form action="." method="post" class="form">{% csrf_token %} |
840 | + <h2>{% trans "Add new Team Meeting for " %}{{ team_object.name}}</h2> |
841 | + {{ form.as_template }} |
842 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
843 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
844 | + </form> |
845 | + </div> |
846 | + </div> |
847 | </section> |
848 | </div> |
849 | - |
850 | {% endblock %} |
851 | |
852 | === modified file 'loco_directory/templates/meetings/team_meeting_update.html' |
853 | --- loco_directory/templates/meetings/team_meeting_update.html 2012-12-26 17:23:50 +0000 |
854 | +++ loco_directory/templates/meetings/team_meeting_update.html 2013-02-18 21:30:29 +0000 |
855 | @@ -4,29 +4,22 @@ |
856 | {% block page_name %}{% trans "Update Team Meeting" %}{% endblock %} |
857 | |
858 | {% block extrahead %}{{ block.super }} |
859 | -{{form.media}} |
860 | -{% endblock %} |
861 | - |
862 | -{% block extrafooter %} |
863 | -<script type="text/javascript"><!-- |
864 | -$(document).ready(function(){ |
865 | - $('span[rel*=help]').colorTip({color:'orange'}); |
866 | -}); |
867 | ---></script> |
868 | +{{ form.media }} |
869 | {% endblock %} |
870 | |
871 | {% block content %} |
872 | <div class="row"> |
873 | <section class="span-9"> |
874 | - <form action="." method="post">{% csrf_token %} |
875 | - <fieldset> |
876 | - <h3>{% trans "Update Team Meeting" %}</h3> |
877 | - {{ form.as_template }} |
878 | - </fieldset> |
879 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
880 | - <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" /> |
881 | - </form> |
882 | + <div class="box_content"> |
883 | + <div class="pagelet"> |
884 | + <form action="." method="post" class="form">{% csrf_token %} |
885 | + <h2>{% trans "Update Team Meeting" %}</h2> |
886 | + {{ form.as_template }} |
887 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
888 | + <input type="submit" name="submit" value="{% trans "Submit" %}" class="btn" /> |
889 | + </form> |
890 | + </div> |
891 | + </div> |
892 | </section> |
893 | </div> |
894 | - |
895 | {% endblock %} |
896 | |
897 | === modified file 'loco_directory/templates/teams/team_update.html' |
898 | --- loco_directory/templates/teams/team_update.html 2012-12-26 17:23:50 +0000 |
899 | +++ loco_directory/templates/teams/team_update.html 2013-02-18 21:30:29 +0000 |
900 | @@ -1,62 +1,52 @@ |
901 | {% extends "base.html" %} |
902 | {% load i18n %} |
903 | |
904 | -{% block page_name %}{% blocktrans with team.name as teamname %}Update {{teamname}}{% endblocktrans %}{% endblock %} |
905 | +{% block page_name %}{% blocktrans with team.name as teamname %}Update {{ teamname }}{% endblocktrans %}{% endblock %} |
906 | |
907 | -{% block extrahead %}{{block.super}} |
908 | +{% block extrahead %}{{ block.super }} |
909 | {{ form.media }} |
910 | {% endblock %} |
911 | |
912 | -{% block extrafooter %} |
913 | -<script type="text/javascript"><!-- |
914 | -$(document).ready(function(){ |
915 | - $('span[rel*=help]').colorTip({color:'orange'}); |
916 | -}); |
917 | ---></script> |
918 | -{% endblock %} |
919 | - |
920 | {% block sub_nav_links %} |
921 | - <li><a class="sub-nav-item" href="/teams">{% trans "Back to Teams List" %}</a></li> |
922 | - <li><a class="sub-nav-item" href="/teams/{{ team.lp_name }}">{% trans "Back to Team Details" %}</a></li> |
923 | + <li><a class="sub-nav-item" href="/teams/">{% trans "Back to Teams List" %}</a></li> |
924 | + <li><a class="sub-nav-item" href="/teams/{{ team.lp_name }}/">{% trans "Back to Team Details" %}</a></li> |
925 | {% endblock %} |
926 | |
927 | {% block content %} |
928 | - |
929 | <div class="row"> |
930 | -<section class="span-9"> |
931 | - <article id="form"> |
932 | + <section class="span-9"> |
933 | {% if form.errors %} |
934 | <p style="color: red;"> |
935 | {% trans "Please correct the error" %}{{ form.errors|pluralize }} below. |
936 | </p> |
937 | {% endif %} |
938 | - |
939 | - <form action="{{ request.path_info }}" method="POST">{% csrf_token %} |
940 | - <fieldset> |
941 | - <h3>{% trans "Update the information below" %}</h3> |
942 | - {{ form.as_template }} |
943 | - </fieldset> |
944 | - <fieldset> |
945 | - <h3>{% trans "Static information" %}</h3> |
946 | - <div class="approved"> |
947 | - <div class="field"><label for="approved">Approved :</label></div> |
948 | - <span class="extra">{% if team.approved %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</span> |
949 | - </div> |
950 | - {% if team.approved %} |
951 | - <div class="approved_date"> |
952 | - <div class="field"><label for="approved_date">Date Approved :</label></div> |
953 | - <span class="extra">{{ team.approved_date }}</span> |
954 | - </div> |
955 | - <div class="expires_date"> |
956 | - <div class="field"><label for="expires_date">Reapproval Date :</label></div> |
957 | - <span class="extra">{{ team.expires_date }}</span> |
958 | - </div> |
959 | - {% endif %} |
960 | - </fieldset> |
961 | - {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
962 | - <input type="submit" name="submit" value="{% trans "Update Information Now!" %}" class="submit-button" /> |
963 | - </form> |
964 | + <div class="box_content"> |
965 | + <div class="pagelet"> |
966 | + <form action="." method="post" class="form">{% csrf_token %} |
967 | + <h2>{% trans "Update the information below" %}</h2> |
968 | + {{ form.as_template }} |
969 | + <fieldset> |
970 | + <h3>{% trans "Static information" %}</h3> |
971 | + <div class="approved"> |
972 | + <span>Approved :</span> |
973 | + <span>{% if team.approved %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</span> |
974 | + </div> |
975 | + {% if team.approved %} |
976 | + <div class="approved_date"> |
977 | + <span>Date Approved :</span> |
978 | + <span>{{ team.approved_date }}</span> |
979 | + </div> |
980 | + <div class="expires_date"> |
981 | + <span>Reapproval Date :</span> |
982 | + <span>{{ team.expires_date }}</span> |
983 | + </div> |
984 | + {% endif %} |
985 | + </fieldset> |
986 | + {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
987 | + <input type="submit" name="submit" value="{% trans "Update" %}" class="btn" /> |
988 | + </form> |
989 | + </div> |
990 | + </div> |
991 | </section> |
992 | </div> |
993 | - |
994 | {% endblock %} |
Attempt to merge into lp:loco-team-portal failed due to conflicts:
text conflict in loco_directory/ media/css/ styles. css