diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index f0768f656..68983a09f 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -27,7 +27,12 @@ class ItemForm(forms.ModelForm, CssClassMixin): parent = TreeNodeChoiceField( queryset=Item.objects.all(), label=_("Parent item"), required=False) - duration = forms.TimeField(widget=forms.TimeInput(format='%H:%M') , input_formats=('%H:%M', '%H %M', '%M'), required=False) + duration = forms.TimeField( + widget=forms.TimeInput(format='%H:%M') , + input_formats=('%H:%M', '%H %M'), + required=False, + label=_("Duration (hh:mm)") + ) class Meta: model = Item @@ -55,3 +60,11 @@ class ItemOrderForm(forms.Form, CssClassMixin): parent = forms.IntegerField( widget=forms.HiddenInput(attrs={'class': 'menu-plid'}), ) + +class ConfigForm(forms.Form, CssClassMixin): + agenda_start_event_time = forms.TimeField( + widget=forms.TimeInput(format='%H:%M') , + input_formats=('%H:%M', '%H:%M:%S'), + required=False, + label=_("Begin of event (hh:mm)"), + ) diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index a4c46671d..288bf1676 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -46,7 +46,7 @@ class Item(MPTTModel, SlideMixin): type = models.CharField(max_length=3, choices=ITEM_TYPE, default='agd', verbose_name=_("Type")) - duration = models.TimeField(blank=True, null=True, verbose_name=_('Duration')); + duration = models.TimeField(blank=True, null=True, verbose_name=_("Duration (hh:mm)")); related_sid = models.CharField(null=True, blank=True, max_length=63) diff --git a/openslides/agenda/static/styles/agenda.css b/openslides/agenda/static/styles/agenda.css index 611d19646..e6f75636b 100644 --- a/openslides/agenda/static/styles/agenda.css +++ b/openslides/agenda/static/styles/agenda.css @@ -22,3 +22,9 @@ table#menu-overview { white-space: nowrap; } + +table#agendatime { + float: right; + width: 15%; + margin-bottom: 1em; +} \ No newline at end of file diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 8db571b3f..110f0e1f7 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -50,7 +50,16 @@ {% endif %}

{% trans "Agenda" %}

- + + + + + + + + + +
{% trans "Start of event" %}{{ start|time:"H:i" }}
{% trans "Estimated end" %}{{ end|time:"H:i" }}

{% trans "Filter" %}: {% trans "Hide closed items" %} diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index d968527d7..dada8c65e 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -18,10 +18,12 @@ from django.db.models import Model from django.utils.translation import ugettext as _, ugettext_lazy from django.views.generic.detail import SingleObjectMixin +from openslides.config.models import config +from openslides.agenda.forms import ConfigForm from openslides.utils.pdf import stylesheet from openslides.utils.views import ( TemplateView, RedirectView, UpdateView, CreateView, DeleteView, PDFView, - DetailView) + DetailView, FormView) from openslides.utils.template import Tab from openslides.utils.utils import html_strong from openslides.projector.api import get_active_slide @@ -53,10 +55,20 @@ class Overview(TemplateView): if agenda_item.duration is not None: duration += timedelta(hours=agenda_item.duration.hour, minutes=agenda_item.duration.minute) + start = config['agenda_start_event_time'] + if start is None: + start = u'0:00:00' + + start = datetime.strptime(start, '%H:%M:%S') + end = start + duration + duration = datetime.strptime(str(duration), '%H:%M:%S') + context.update({ 'items': items, 'active_sid': get_active_slide(only_sid=True), - 'duration': datetime.strptime(str(duration), '%H:%M:%S'), + 'duration': duration, + 'start': start, + 'end': end, }) return context @@ -218,6 +230,23 @@ class AgendaPDF(PDFView): else: story.append(Paragraph(item.get_title(), stylesheet['Item'])) +class Config(FormView): + """ + Config page for the agenda app. + """ + permission_required = 'config.can_manage_config' + form_class = ConfigForm + template_name = 'agenda/config.html' + + def get_initial(self): + return { + 'agenda_start_event_time': config['agenda_start_event_time'], + } + + def form_valid(self, form): + config['agenda_start_event_time'] = form.cleaned_data['agenda_start_event_time'] + messages.success(self.request, _('Agenda settings successfully saved.')) + return super(Config, self).form_valid(form) def register_tab(request): """ diff --git a/openslides/locale/de/LC_MESSAGES/django.mo b/openslides/locale/de/LC_MESSAGES/django.mo index f9ea13c14..55f3077b4 100644 Binary files a/openslides/locale/de/LC_MESSAGES/django.mo and b/openslides/locale/de/LC_MESSAGES/django.mo differ diff --git a/openslides/locale/de/LC_MESSAGES/django.po b/openslides/locale/de/LC_MESSAGES/django.po index 389f332e1..5377c58f9 100644 --- a/openslides/locale/de/LC_MESSAGES/django.po +++ b/openslides/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: OpenSlides 1.x\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-28 23:58+0100\n" +"POT-Creation-Date: 2013-01-30 17:20+0100\n" "PO-Revision-Date: 2012-07-28 11:07+0200\n" "Last-Translator: Emanuel Schuetze \n" "Language-Team: support@openslides.de\n" @@ -33,6 +33,10 @@ msgstr "Französisch" msgid "Parent item" msgstr "Elternelement" +#: agenda/forms.py:64 +msgid "Begin of event (hh:mm)" +msgstr "Beginn der Veranstaltung (ss:mm)" + #: agenda/models.py:35 msgid "Agenda item" msgstr "Tagesordnungseintrag" @@ -52,7 +56,7 @@ msgstr "Titel" msgid "Text" msgstr "Text" -#: agenda/models.py:41 agenda/templates/agenda/overview.html:65 +#: agenda/models.py:41 agenda/templates/agenda/overview.html:74 #: agenda/templates/agenda/view.html:13 participant/models.py:60 #: participant/templates/participant/overview.html:72 #: participant/templates/participant/user_detail.html:45 @@ -63,7 +67,7 @@ msgstr "Kommentar" msgid "Closed" msgstr "Abgeschlossen" -#: agenda/models.py:43 agenda/templates/agenda/overview.html:74 +#: agenda/models.py:43 agenda/templates/agenda/overview.html:83 #: projector/models.py:31 msgid "Weight" msgstr "Gewichtung" @@ -75,9 +79,9 @@ msgstr "Gewichtung" msgid "Type" msgstr "Typ" -#: agenda/models.py:49 agenda/templates/agenda/overview.html:68 -msgid "Duration" -msgstr "Dauer" +#: agenda/models.py:49 +msgid "Duration (hh:mm)" +msgstr "Dauer (ss:mm)" #: agenda/models.py:182 msgid "Can see agenda" @@ -91,49 +95,53 @@ msgstr "Darf die Tagesordung verwalten" msgid "Can see orga items" msgstr "Darf Organisationspunkte sehen" -#: agenda/models.py:194 agenda/slides.py:20 agenda/views.py:207 -#: agenda/views.py:208 agenda/views.py:228 agenda/views.py:242 +#: agenda/models.py:194 agenda/slides.py:20 agenda/views.py:219 +#: agenda/views.py:220 agenda/views.py:257 agenda/views.py:271 #: agenda/templates/agenda/base_agenda.html:10 #: agenda/templates/agenda/overview.html:8 #: agenda/templates/agenda/overview.html:52 -#: agenda/templates/agenda/overview.html:80 +#: agenda/templates/agenda/overview.html:89 #: agenda/templates/projector/AgendaSummary.html:6 #: agenda/templates/projector/AgendaSummary.html:10 msgid "Agenda" msgstr "Tagesordnung" -#: agenda/views.py:69 +#: agenda/views.py:81 msgid "You are not authorized to manage the agenda." msgstr "Sie sind nicht berechtigt die Tagesordnung zu ändern." -#: agenda/views.py:85 +#: agenda/views.py:97 msgid "Errors when reordering of the agenda" msgstr "Fehler beim Neusortieren der Tagesordnung" -#: agenda/views.py:147 +#: agenda/views.py:159 #, python-format msgid "Item %s was successfully modified." msgstr "Eintrag %s wurde erfolgreich bearbeitet." -#: agenda/views.py:168 +#: agenda/views.py:180 #, python-format msgid "Item %s was successfully created." msgstr "Eintrag %s wurde erfolgreich angelegt." -#: agenda/views.py:185 +#: agenda/views.py:197 msgid "Yes, with all child items." msgstr "Ja, mit allen Kindelementen." -#: agenda/views.py:193 +#: agenda/views.py:205 #, python-format msgid "Item %s and his children were successfully deleted." msgstr "Eintrag %s und seine Kindelemente wurde erfolgreich gelöscht." -#: agenda/views.py:198 +#: agenda/views.py:210 #, python-format msgid "Item %s was successfully deleted." msgstr "Eintrag %s wurde erfolgreich gelöscht." +#: agenda/views.py:248 +msgid "Agenda settings successfully saved." +msgstr "Tagesordnung Einstellungen erfolgreich gespeichert." + #: agenda/templates/agenda/base_agenda.html:12 msgid "All items" msgstr "Alle Einträge" @@ -236,7 +244,7 @@ msgid "Item closed" msgstr "Eintrag erledigt" #: agenda/templates/agenda/item_row.html:39 -#: agenda/templates/agenda/overview.html:90 +#: agenda/templates/agenda/overview.html:99 msgid "Activate item" msgstr "Eintrag projizieren" @@ -272,31 +280,43 @@ msgid "No" msgstr "Nein" #: agenda/templates/agenda/overview.html:55 +msgid "Start of event" +msgstr "Beginn der Veranstaltung" + +#: agenda/templates/agenda/overview.html:59 +msgid "Estimated end" +msgstr "Voraussichtliches Ende" + +#: agenda/templates/agenda/overview.html:64 #: assignment/templates/assignment/overview.html:12 #: motion/templates/motion/overview.html:12 #: participant/templates/participant/overview.html:22 msgid "Filter" msgstr "Filter" -#: agenda/templates/agenda/overview.html:56 +#: agenda/templates/agenda/overview.html:65 msgid "Hide closed items" msgstr "Verstecke abgeschlossene Einträge" -#: agenda/templates/agenda/overview.html:59 +#: agenda/templates/agenda/overview.html:68 msgid "item" msgid_plural "items" msgstr[0] "Eintrag" msgstr[1] "Einträge" -#: agenda/templates/agenda/overview.html:62 +#: agenda/templates/agenda/overview.html:71 msgid "Done" msgstr "Erledigt" -#: agenda/templates/agenda/overview.html:63 +#: agenda/templates/agenda/overview.html:72 msgid "Item" msgstr "Eintrag" -#: agenda/templates/agenda/overview.html:71 +#: agenda/templates/agenda/overview.html:77 +msgid "Duration" +msgstr "Dauer" + +#: agenda/templates/agenda/overview.html:80 #: assignment/templates/assignment/overview.html:28 #: motion/templates/motion/overview.html:43 #: participant/templates/participant/group_overview.html:14 @@ -304,7 +324,7 @@ msgstr "Eintrag" msgid "Actions" msgstr "Aktionen" -#: agenda/templates/agenda/overview.html:106 +#: agenda/templates/agenda/overview.html:115 #: agenda/templates/agenda/widget.html:46 #: projector/templates/projector/custom_slide_widget.html:36 msgid "No items available." diff --git a/openslides/locale/de/LC_MESSAGES/djangojs.mo b/openslides/locale/de/LC_MESSAGES/djangojs.mo index 7c267c9ba..cfba14c7a 100644 Binary files a/openslides/locale/de/LC_MESSAGES/djangojs.mo and b/openslides/locale/de/LC_MESSAGES/djangojs.mo differ diff --git a/openslides/locale/de/LC_MESSAGES/djangojs.po b/openslides/locale/de/LC_MESSAGES/djangojs.po index f528ae5fb..81c122520 100644 --- a/openslides/locale/de/LC_MESSAGES/djangojs.po +++ b/openslides/locale/de/LC_MESSAGES/djangojs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: OpenSlides 1.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-28 23:58+0100\n" +"POT-Creation-Date: 2013-01-30 16:45+0100\n" "PO-Revision-Date: 2012-07-28 11:07+0200\n" "Last-Translator: Oskar Hahn \n" "Language: de\n"