diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index 77c3dbe83..423bbbfb0 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -10,16 +10,15 @@ :license: GNU GPL, see LICENSE for more details. """ +import re + from django import forms from django.utils.translation import ugettext_lazy as _ -from django.contrib.admin.widgets import AdminTimeWidget from mptt.forms import TreeNodeChoiceField from openslides.utils.forms import CssClassMixin - from openslides.agenda.models import Item -import re class ItemForm(forms.ModelForm, CssClassMixin): """ @@ -63,6 +62,7 @@ class ItemOrderForm(forms.Form, CssClassMixin): widget=forms.HiddenInput(attrs={'class': 'menu-plid'}), ) + class ConfigForm(CssClassMixin, forms.Form): agenda_start_event_date_time = forms.CharField( widget=forms.DateTimeInput(format='%d.%m.%Y %H:%M'), diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 8f74d8339..52d2d51b1 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -37,7 +37,7 @@ class Item(MPTTModel, SlideMixin): ITEM_TYPE = ( (AGENDA_ITEM, _('Agenda item')), (ORGANIZATIONAL_ITEM, _('Organizational item')), - ) + ) title = models.CharField(null=True, max_length=255, verbose_name=_("Title")) text = models.TextField(null=True, blank=True, verbose_name=_("Text")) @@ -46,11 +46,8 @@ class Item(MPTTModel, SlideMixin): weight = models.IntegerField(default=0, verbose_name=_("Weight")) parent = TreeForeignKey('self', null=True, blank=True, related_name='children') - type = models.IntegerField(max_length=1, choices=ITEM_TYPE, - default=AGENDA_ITEM, verbose_name=_("Type")) - + type = models.IntegerField(max_length=1, choices=ITEM_TYPE, default=AGENDA_ITEM, verbose_name=_("Type")) duration = models.CharField(null=True, blank=True, max_length=5, verbose_name=_("Duration (hh:mm)")) - related_sid = models.CharField(null=True, blank=True, max_length=63) def get_related_slide(self): @@ -179,7 +176,6 @@ class Item(MPTTModel, SlideMixin): def __unicode__(self): return self.get_title() - class Meta: permissions = ( ('can_see_agenda', ugettext_noop("Can see agenda")), diff --git a/openslides/agenda/static/styles/agenda.css b/openslides/agenda/static/styles/agenda.css index 2979007c9..3c6ead5ea 100644 --- a/openslides/agenda/static/styles/agenda.css +++ b/openslides/agenda/static/styles/agenda.css @@ -10,7 +10,6 @@ tr.topline td { background-color: #CDCDCD; } - table#agendatime { float: right; width: auto; diff --git a/openslides/agenda/static/styles/timepicker.css b/openslides/agenda/static/styles/timepicker.css index c536c9738..8a2558fcd 100644 --- a/openslides/agenda/static/styles/timepicker.css +++ b/openslides/agenda/static/styles/timepicker.css @@ -1,11 +1,46 @@ -/* css for timepicker */ -.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } -.ui-timepicker-div dl { text-align: left; } -.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } -.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } -.ui-timepicker-div td { font-size: 90%; } -.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } +/** + * OpenSlides timepicker style + * + * :copyright: 2011, 2012 by OpenSlides team, see AUTHORS. + * :license: GNU GPL, see LICENSE for more details. + */ -.ui-timepicker-rtl{ direction: rtl; } -.ui-timepicker-rtl dl { text-align: right; } -.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } \ No newline at end of file +.ui-timepicker-div .ui-widget-header { + margin-bottom: 8px; +} + +.ui-timepicker-div dl { + text-align: left; +} + +.ui-timepicker-div dl dt { + height: 25px; + margin-bottom: -25px; +} + +.ui-timepicker-div dl dd { + margin: 0 10px 10px 65px; +} + +.ui-timepicker-div td { + font-size: 90%; +} + +.ui-tpicker-grid-label { + background: none; + border: none; + margin: 0; + padding: 0; +} + +.ui-timepicker-rtl{ + direction: rtl; +} + +.ui-timepicker-rtl dl { + text-align: right; +} + +.ui-timepicker-rtl dl dd { + margin: 0 65px 10px 10px; +} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index f6fc0916e..b311de352 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -108,7 +108,7 @@ {% endif %} {% if perms.agenda.can_see_orga_items %} - {{duration}}h + {{ duration }}h {% endif %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} diff --git a/openslides/agenda/urls.py b/openslides/agenda/urls.py index 392adbedf..21be990e6 100644 --- a/openslides/agenda/urls.py +++ b/openslides/agenda/urls.py @@ -11,49 +11,43 @@ """ from django.conf.urls import url, patterns -from openslides.agenda.views import (Overview, View, SetClosed, ItemUpdate, +from openslides.agenda.views import ( + Overview, View, SetClosed, ItemUpdate, ItemCreate, ItemDelete, AgendaPDF) -urlpatterns = patterns('', +urlpatterns = patterns( + '', url(r'^$', Overview.as_view(), - name='item_overview', - ), + name='item_overview', ), url(r'^(?P\d+)/$', View.as_view(), - name='item_view', - ), + name='item_view', ), url(r'^(?P\d+)/close/$', SetClosed.as_view(), {'closed': True}, - name='item_close', - ), + name='item_close', ), url(r'^(?P\d+)/open/$', SetClosed.as_view(), {'closed': False}, - name='item_open', - ), + name='item_open', ), url(r'^(?P\d+)/edit/$', ItemUpdate.as_view(), - name='item_edit', - ), + name='item_edit', ), url(r'^new/$', ItemCreate.as_view(), - name='item_new', - ), + name='item_new', ), url(r'^(?P\d+)/del/$', ItemDelete.as_view(), - name='item_delete', - ), + name='item_delete', ), url(r'^print/$', AgendaPDF.as_view(), - name='print_agenda', - ), + name='print_agenda', ), ) diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index fdbf471f2..d2da48159 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -9,6 +9,7 @@ :copyright: 2011, 2012 by the OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for more details. """ + from reportlab.platypus import Paragraph from django.core.urlresolvers import reverse @@ -40,7 +41,6 @@ class Overview(TemplateView): permission_required = 'agenda.can_see_agenda' template_name = 'agenda/overview.html' - def get_context_data(self, **kwargs): context = super(Overview, self).get_context_data(**kwargs) @@ -49,7 +49,7 @@ class Overview(TemplateView): else: items = Item.objects.filter(type__exact=Item.AGENDA_ITEM) - start = config['agenda_start_event_date_time'] + start = config['agenda_start_event_date_time'] if start is None or len(start) == 0: start = None else: @@ -68,7 +68,7 @@ class Overview(TemplateView): if start is None: end = None else: - end = start + duration + end = start + duration duration = u'%d:%02d' % ((duration.days * 24 + duration.seconds / 3600), (duration.seconds / 60 % 60)) @@ -193,12 +193,14 @@ class ItemDelete(DeleteView): if self.get_answer() == 'all': self.object.delete(with_children=True) messages.success( - request, _("Item %s and his children were successfully deleted.") + request, + _("Item %s and his children were successfully deleted.") % html_strong(self.object)) elif self.get_answer() == 'yes': self.object.delete(with_children=False) messages.success( - request, _("Item %s was successfully deleted.") + request, + _("Item %s was successfully deleted.") % html_strong(self.object)) @@ -221,6 +223,7 @@ class AgendaPDF(PDFView): else: story.append(Paragraph(item.get_title(), stylesheet['Item'])) + class Config(FormView): """ Config page for the agenda app. @@ -240,6 +243,7 @@ class Config(FormView): messages.success(self.request, _('Agenda settings successfully saved.')) return super(Config, self).form_valid(form) + def register_tab(request): """ register the agenda tab.