#41 Time for each agenda item

This commit is contained in:
Stefan Frauenknecht 2013-01-29 14:28:42 +01:00
parent aee24425bc
commit bc9dcffff4
9 changed files with 53 additions and 24 deletions

View File

@ -27,6 +27,8 @@ 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)
class Meta: class Meta:
model = Item model = Item
exclude = ('closed', 'weight', 'related_sid') exclude = ('closed', 'weight', 'related_sid')

View File

@ -46,6 +46,8 @@ 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'));
related_sid = models.CharField(null=True, blank=True, max_length=63) related_sid = models.CharField(null=True, blank=True, max_length=63)
def get_related_slide(self): def get_related_slide(self):
@ -174,6 +176,7 @@ class Item(MPTTModel, SlideMixin):
def __unicode__(self): def __unicode__(self):
return self.get_title() return self.get_title()
class Meta: class Meta:
permissions = ( permissions = (
('can_see_agenda', ugettext_noop("Can see agenda")), ('can_see_agenda', ugettext_noop("Can see agenda")),
@ -185,5 +188,7 @@ class Item(MPTTModel, SlideMixin):
order_insertion_by = ['weight'] order_insertion_by = ['weight']
register_slidemodel(Item, control_template='agenda/control_item.html') register_slidemodel(Item, control_template='agenda/control_item.html')
register_slidefunc('agenda', agenda_show, weight=-1, name=_('Agenda')) register_slidefunc('agenda', agenda_show, weight=-1, name=_('Agenda'))

View File

@ -27,6 +27,10 @@
<td> <td>
{{ item.comment|first_line }} {{ item.comment|first_line }}
</td> </td>
<td>
{{ item.duration|time:"H:i" }}
</td>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %}
<td> <td>

View File

@ -64,6 +64,9 @@
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<th width="200">{% trans "Comment" %}</th> <th width="200">{% trans "Comment" %}</th>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda %}
<th width="50">{% trans "Duration" %}</th>
{% endif %}
{% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %}
<th width="50">{% trans "Actions" %}</th> <th width="50">{% trans "Actions" %}</th>
{% endif %} {% endif %}
@ -78,6 +81,7 @@
</td> </td>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<td></td> <td></td>
<td>{{ duration|time:"H:i" }}</td>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %}
<td> <td>
@ -99,7 +103,7 @@
{% endfor %} {% endfor %}
{% else %} {% else %}
<tr> <tr>
<td colspan="4"><i>{% trans "No items available." %}</i></td> <td colspan="5"><i>{% trans "No items available." %}</i></td>
</tr> </tr>
{% endif %} {% endif %}
</table> </table>

View File

@ -28,6 +28,7 @@ from openslides.projector.api import get_active_slide
from openslides.projector.projector import Widget, SLIDE from openslides.projector.projector import Widget, SLIDE
from .models import Item from .models import Item
from .forms import ItemOrderForm, ItemForm from .forms import ItemOrderForm, ItemForm
from datetime import datetime, timedelta
class Overview(TemplateView): class Overview(TemplateView):
@ -37,6 +38,8 @@ class Overview(TemplateView):
permission_required = 'agenda.can_see_agenda' permission_required = 'agenda.can_see_agenda'
template_name = 'agenda/overview.html' template_name = 'agenda/overview.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(Overview, self).get_context_data(**kwargs) context = super(Overview, self).get_context_data(**kwargs)
@ -45,9 +48,15 @@ class Overview(TemplateView):
else: else:
items = Item.objects.filter(type__exact = 'agd') items = Item.objects.filter(type__exact = 'agd')
duration = timedelta()
for agenda_item in Item.objects.filter(closed=False):
if agenda_item.duration is not None:
duration += timedelta(hours=agenda_item.duration.hour, minutes=agenda_item.duration.minute)
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'),
}) })
return context return context
@ -100,6 +109,7 @@ class SetClosed(RedirectView, SingleObjectMixin):
url = 'item_overview' url = 'item_overview'
model = Item model = Item
def get_ajax_context(self, **kwargs): def get_ajax_context(self, **kwargs):
context = super(SetClosed, self).get_ajax_context(**kwargs) context = super(SetClosed, self).get_ajax_context(**kwargs)
closed = kwargs['closed'] closed = kwargs['closed']

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-05 22:30+0100\n" "POT-Creation-Date: 2013-01-28 23:58+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"
@ -63,7 +63,7 @@ msgstr "Kommentar"
msgid "Closed" msgid "Closed"
msgstr "Abgeschlossen" msgstr "Abgeschlossen"
#: agenda/models.py:43 agenda/templates/agenda/overview.html:71 #: agenda/models.py:43 agenda/templates/agenda/overview.html:74
#: projector/models.py:31 #: projector/models.py:31
msgid "Weight" msgid "Weight"
msgstr "Gewichtung" msgstr "Gewichtung"
@ -75,57 +75,61 @@ msgstr "Gewichtung"
msgid "Type" msgid "Type"
msgstr "Typ" msgstr "Typ"
#: agenda/models.py:179 #: agenda/models.py:49 agenda/templates/agenda/overview.html:68
msgid "Duration"
msgstr "Dauer"
#: agenda/models.py:182
msgid "Can see agenda" msgid "Can see agenda"
msgstr "Darf die Tagesordnung sehen" msgstr "Darf die Tagesordnung sehen"
#: agenda/models.py:180 #: agenda/models.py:183
msgid "Can manage agenda" msgid "Can manage agenda"
msgstr "Darf die Tagesordung verwalten" msgstr "Darf die Tagesordung verwalten"
#: agenda/models.py:181 #: agenda/models.py:184
msgid "Can see orga items" msgid "Can see orga items"
msgstr "Darf Organisationspunkte sehen" msgstr "Darf Organisationspunkte sehen"
#: agenda/models.py:189 agenda/slides.py:20 agenda/views.py:191 #: agenda/models.py:194 agenda/slides.py:20 agenda/views.py:207
#: agenda/views.py:192 agenda/views.py:212 agenda/views.py:226 #: agenda/views.py:208 agenda/views.py:228 agenda/views.py:242
#: 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:77 #: agenda/templates/agenda/overview.html:80
#: 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:54 #: agenda/views.py:69
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:70 #: agenda/views.py:85
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:131 #: agenda/views.py:147
#, 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:152 #: agenda/views.py:168
#, 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:169 #: agenda/views.py:185
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:177 #: agenda/views.py:193
#, 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:182 #: agenda/views.py:198
#, 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."
@ -149,12 +153,12 @@ msgstr "Eintrag anzeigen"
#: agenda/templates/agenda/base_agenda.html:31 #: agenda/templates/agenda/base_agenda.html:31
#: agenda/templates/agenda/edit.html:8 agenda/templates/agenda/edit.html:16 #: agenda/templates/agenda/edit.html:8 agenda/templates/agenda/edit.html:16
#: agenda/templates/agenda/item_row.html:40 #: agenda/templates/agenda/item_row.html:44
msgid "Edit item" msgid "Edit item"
msgstr "Eintrag bearbeiten" msgstr "Eintrag bearbeiten"
#: agenda/templates/agenda/base_agenda.html:33 #: agenda/templates/agenda/base_agenda.html:33
#: agenda/templates/agenda/item_row.html:41 #: agenda/templates/agenda/item_row.html:45
msgid "Delete item" msgid "Delete item"
msgstr "Eintrag löschen" msgstr "Eintrag löschen"
@ -231,12 +235,12 @@ msgstr "Eintrag als erledigt markieren"
msgid "Item closed" msgid "Item closed"
msgstr "Eintrag erledigt" msgstr "Eintrag erledigt"
#: agenda/templates/agenda/item_row.html:35 #: agenda/templates/agenda/item_row.html:39
#: agenda/templates/agenda/overview.html:86 #: agenda/templates/agenda/overview.html:90
msgid "Activate item" msgid "Activate item"
msgstr "Eintrag projizieren" msgstr "Eintrag projizieren"
#: agenda/templates/agenda/item_row.html:44 #: agenda/templates/agenda/item_row.html:48
#: agenda/templates/agenda/widget.html:35 #: agenda/templates/agenda/widget.html:35
msgid "Activate summary for this item" msgid "Activate summary for this item"
msgstr "Zusammenfassung für diesen Eintrag projizieren" msgstr "Zusammenfassung für diesen Eintrag projizieren"
@ -292,7 +296,7 @@ msgstr "Erledigt"
msgid "Item" msgid "Item"
msgstr "Eintrag" msgstr "Eintrag"
#: agenda/templates/agenda/overview.html:68 #: agenda/templates/agenda/overview.html:71
#: 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
@ -300,7 +304,7 @@ msgstr "Eintrag"
msgid "Actions" msgid "Actions"
msgstr "Aktionen" msgstr "Aktionen"
#: agenda/templates/agenda/overview.html:102 #: agenda/templates/agenda/overview.html:106
#: 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-05 22:30+0100\n" "POT-Creation-Date: 2013-01-28 23:58+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"