#41 Time for each agenda item finished

This commit is contained in:
Stefan Frauenknecht 2013-01-30 17:39:53 +01:00
parent bc9dcffff4
commit 65ebcbc991
9 changed files with 106 additions and 29 deletions

View File

@ -27,7 +27,12 @@ class ItemForm(forms.ModelForm, CssClassMixin):
parent = TreeNodeChoiceField( parent = TreeNodeChoiceField(
queryset=Item.objects.all(), label=_("Parent item"), required=False) 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: class Meta:
model = Item model = Item
@ -55,3 +60,11 @@ class ItemOrderForm(forms.Form, CssClassMixin):
parent = forms.IntegerField( parent = forms.IntegerField(
widget=forms.HiddenInput(attrs={'class': 'menu-plid'}), 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)"),
)

View File

@ -46,7 +46,7 @@ class Item(MPTTModel, SlideMixin):
type = models.CharField(max_length=3, choices=ITEM_TYPE, type = models.CharField(max_length=3, choices=ITEM_TYPE,
default='agd', verbose_name=_("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) related_sid = models.CharField(null=True, blank=True, max_length=63)

View File

@ -22,3 +22,9 @@
table#menu-overview { table#menu-overview {
white-space: nowrap; white-space: nowrap;
} }
table#agendatime {
float: right;
width: 15%;
margin-bottom: 1em;
}

View File

@ -50,7 +50,16 @@
{% endif %} {% endif %}
<h1>{% trans "Agenda" %}</h1> <h1>{% trans "Agenda" %}</h1>
<table id="agendatime">
<tr>
<td>{% trans "Start of event" %}</td>
<td>{{ start|time:"H:i" }}</td>
</tr>
<tr>
<td>{% trans "Estimated end" %}</td>
<td>{{ end|time:"H:i" }}</td>
</tr>
</table>
<p> <p>
{% trans "Filter" %}: {% trans "Filter" %}:
<input type="checkbox" id="hide_closed_items"> {% trans "Hide closed items" %} <input type="checkbox" id="hide_closed_items"> {% trans "Hide closed items" %}

View File

@ -18,10 +18,12 @@ from django.db.models import Model
from django.utils.translation import ugettext as _, ugettext_lazy from django.utils.translation import ugettext as _, ugettext_lazy
from django.views.generic.detail import SingleObjectMixin 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.pdf import stylesheet
from openslides.utils.views import ( from openslides.utils.views import (
TemplateView, RedirectView, UpdateView, CreateView, DeleteView, PDFView, TemplateView, RedirectView, UpdateView, CreateView, DeleteView, PDFView,
DetailView) DetailView, FormView)
from openslides.utils.template import Tab from openslides.utils.template import Tab
from openslides.utils.utils import html_strong from openslides.utils.utils import html_strong
from openslides.projector.api import get_active_slide from openslides.projector.api import get_active_slide
@ -53,10 +55,20 @@ class Overview(TemplateView):
if agenda_item.duration is not None: if agenda_item.duration is not None:
duration += timedelta(hours=agenda_item.duration.hour, minutes=agenda_item.duration.minute) 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({ context.update({
'items': items, 'items': items,
'active_sid': get_active_slide(only_sid=True), 'active_sid': get_active_slide(only_sid=True),
'duration': datetime.strptime(str(duration), '%H:%M:%S'), 'duration': duration,
'start': start,
'end': end,
}) })
return context return context
@ -218,6 +230,23 @@ class AgendaPDF(PDFView):
else: else:
story.append(Paragraph(item.get_title(), stylesheet['Item'])) 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): def register_tab(request):
""" """

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenSlides 1.x\n" "Project-Id-Version: OpenSlides 1.x\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2012-07-28 11:07+0200\n"
"Last-Translator: Emanuel Schuetze <emanuel@intevation.de>\n" "Last-Translator: Emanuel Schuetze <emanuel@intevation.de>\n"
"Language-Team: support@openslides.de\n" "Language-Team: support@openslides.de\n"
@ -33,6 +33,10 @@ msgstr "Französisch"
msgid "Parent item" msgid "Parent item"
msgstr "Elternelement" msgstr "Elternelement"
#: agenda/forms.py:64
msgid "Begin of event (hh:mm)"
msgstr "Beginn der Veranstaltung (ss:mm)"
#: agenda/models.py:35 #: agenda/models.py:35
msgid "Agenda item" msgid "Agenda item"
msgstr "Tagesordnungseintrag" msgstr "Tagesordnungseintrag"
@ -52,7 +56,7 @@ msgstr "Titel"
msgid "Text" msgid "Text"
msgstr "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 #: agenda/templates/agenda/view.html:13 participant/models.py:60
#: participant/templates/participant/overview.html:72 #: participant/templates/participant/overview.html:72
#: participant/templates/participant/user_detail.html:45 #: participant/templates/participant/user_detail.html:45
@ -63,7 +67,7 @@ msgstr "Kommentar"
msgid "Closed" msgid "Closed"
msgstr "Abgeschlossen" 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 #: projector/models.py:31
msgid "Weight" msgid "Weight"
msgstr "Gewichtung" msgstr "Gewichtung"
@ -75,9 +79,9 @@ msgstr "Gewichtung"
msgid "Type" msgid "Type"
msgstr "Typ" msgstr "Typ"
#: agenda/models.py:49 agenda/templates/agenda/overview.html:68 #: agenda/models.py:49
msgid "Duration" msgid "Duration (hh:mm)"
msgstr "Dauer" msgstr "Dauer (ss:mm)"
#: agenda/models.py:182 #: agenda/models.py:182
msgid "Can see agenda" msgid "Can see agenda"
@ -91,49 +95,53 @@ msgstr "Darf die Tagesordung verwalten"
msgid "Can see orga items" msgid "Can see orga items"
msgstr "Darf Organisationspunkte sehen" msgstr "Darf Organisationspunkte sehen"
#: agenda/models.py:194 agenda/slides.py:20 agenda/views.py:207 #: agenda/models.py:194 agenda/slides.py:20 agenda/views.py:219
#: agenda/views.py:208 agenda/views.py:228 agenda/views.py:242 #: agenda/views.py:220 agenda/views.py:257 agenda/views.py:271
#: agenda/templates/agenda/base_agenda.html:10 #: agenda/templates/agenda/base_agenda.html:10
#: agenda/templates/agenda/overview.html:8 #: agenda/templates/agenda/overview.html:8
#: agenda/templates/agenda/overview.html:52 #: 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:6
#: agenda/templates/projector/AgendaSummary.html:10 #: agenda/templates/projector/AgendaSummary.html:10
msgid "Agenda" msgid "Agenda"
msgstr "Tagesordnung" msgstr "Tagesordnung"
#: agenda/views.py:69 #: agenda/views.py:81
msgid "You are not authorized to manage the agenda." msgid "You are not authorized to manage the agenda."
msgstr "Sie sind nicht berechtigt die Tagesordnung zu ändern." msgstr "Sie sind nicht berechtigt die Tagesordnung zu ändern."
#: agenda/views.py:85 #: agenda/views.py:97
msgid "Errors when reordering of the agenda" msgid "Errors when reordering of the agenda"
msgstr "Fehler beim Neusortieren der Tagesordnung" msgstr "Fehler beim Neusortieren der Tagesordnung"
#: agenda/views.py:147 #: agenda/views.py:159
#, python-format #, python-format
msgid "Item %s was successfully modified." msgid "Item %s was successfully modified."
msgstr "Eintrag %s wurde erfolgreich bearbeitet." msgstr "Eintrag %s wurde erfolgreich bearbeitet."
#: agenda/views.py:168 #: agenda/views.py:180
#, python-format #, python-format
msgid "Item %s was successfully created." msgid "Item %s was successfully created."
msgstr "Eintrag %s wurde erfolgreich angelegt." msgstr "Eintrag %s wurde erfolgreich angelegt."
#: agenda/views.py:185 #: agenda/views.py:197
msgid "Yes, with all child items." msgid "Yes, with all child items."
msgstr "Ja, mit allen Kindelementen." msgstr "Ja, mit allen Kindelementen."
#: agenda/views.py:193 #: agenda/views.py:205
#, python-format #, python-format
msgid "Item %s and his children were successfully deleted." msgid "Item %s and his children were successfully deleted."
msgstr "Eintrag %s und seine Kindelemente wurde erfolgreich gelöscht." msgstr "Eintrag %s und seine Kindelemente wurde erfolgreich gelöscht."
#: agenda/views.py:198 #: agenda/views.py:210
#, python-format #, python-format
msgid "Item %s was successfully deleted." msgid "Item %s was successfully deleted."
msgstr "Eintrag %s wurde erfolgreich gelöscht." 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 #: agenda/templates/agenda/base_agenda.html:12
msgid "All items" msgid "All items"
msgstr "Alle Einträge" msgstr "Alle Einträge"
@ -236,7 +244,7 @@ msgid "Item closed"
msgstr "Eintrag erledigt" msgstr "Eintrag erledigt"
#: agenda/templates/agenda/item_row.html:39 #: agenda/templates/agenda/item_row.html:39
#: agenda/templates/agenda/overview.html:90 #: agenda/templates/agenda/overview.html:99
msgid "Activate item" msgid "Activate item"
msgstr "Eintrag projizieren" msgstr "Eintrag projizieren"
@ -272,31 +280,43 @@ msgid "No"
msgstr "Nein" msgstr "Nein"
#: agenda/templates/agenda/overview.html:55 #: 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 #: assignment/templates/assignment/overview.html:12
#: motion/templates/motion/overview.html:12 #: motion/templates/motion/overview.html:12
#: participant/templates/participant/overview.html:22 #: participant/templates/participant/overview.html:22
msgid "Filter" msgid "Filter"
msgstr "Filter" msgstr "Filter"
#: agenda/templates/agenda/overview.html:56 #: agenda/templates/agenda/overview.html:65
msgid "Hide closed items" msgid "Hide closed items"
msgstr "Verstecke abgeschlossene Einträge" msgstr "Verstecke abgeschlossene Einträge"
#: agenda/templates/agenda/overview.html:59 #: agenda/templates/agenda/overview.html:68
msgid "item" msgid "item"
msgid_plural "items" msgid_plural "items"
msgstr[0] "Eintrag" msgstr[0] "Eintrag"
msgstr[1] "Einträge" msgstr[1] "Einträge"
#: agenda/templates/agenda/overview.html:62 #: agenda/templates/agenda/overview.html:71
msgid "Done" msgid "Done"
msgstr "Erledigt" msgstr "Erledigt"
#: agenda/templates/agenda/overview.html:63 #: agenda/templates/agenda/overview.html:72
msgid "Item" msgid "Item"
msgstr "Eintrag" 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 #: assignment/templates/assignment/overview.html:28
#: motion/templates/motion/overview.html:43 #: motion/templates/motion/overview.html:43
#: participant/templates/participant/group_overview.html:14 #: participant/templates/participant/group_overview.html:14
@ -304,7 +324,7 @@ msgstr "Eintrag"
msgid "Actions" msgid "Actions"
msgstr "Aktionen" msgstr "Aktionen"
#: agenda/templates/agenda/overview.html:106 #: agenda/templates/agenda/overview.html:115
#: agenda/templates/agenda/widget.html:46 #: agenda/templates/agenda/widget.html:46
#: projector/templates/projector/custom_slide_widget.html:36 #: projector/templates/projector/custom_slide_widget.html:36
msgid "No items available." msgid "No items available."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenSlides 1.3\n" "Project-Id-Version: OpenSlides 1.3\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2012-07-28 11:07+0200\n"
"Last-Translator: Oskar Hahn <mail@oshahn.de>\n" "Last-Translator: Oskar Hahn <mail@oshahn.de>\n"
"Language: de\n" "Language: de\n"