From b082f8a8fc38222c004e91586d1627458060b1c0 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Mon, 6 May 2013 20:17:13 +0200 Subject: [PATCH 1/2] A lot of template improvements - Translate group name in participant overview table. - Move 'status_link' function from participants.js to utils.js for using in VoteCollector plugin. - Added hook 'post_js' for VoteCollector plugin. - Fixed poll id in poll_form. - Improved 'show log' button - Used welcome_title for default custom slide - Used bootstraps' fluid grid nesting for responsive layout of widgets. - Added microphone icon for 'add-me-to-list-of-speakers' button. - Format motion identifier and title in (motion and account) widgets. - Format list of speakers (slide, overlay, view, overview) - Format list of speakers widget and view. Added view to link to current list of speakers (without add to list). - Fixed motion slide. Made up/down animation faster and the scroll way shorter. - Fixed icon name. - Set default context of 'extra_javascript' to use kwargs['context']['extra_javascript'].append('...') without error. - Fixed translation of motion state. Moved css code. --- .../account/personal_info_widget.html | 30 +++---- openslides/agenda/models.py | 1 + openslides/agenda/signals.py | 5 +- .../static/img/glyphicons_300_microphone.png | Bin 0 -> 1076 bytes openslides/agenda/static/styles/agenda.css | 51 +++++++++++- .../agenda/templates/agenda/item_row.html | 11 ++- .../agenda/overlay_speaker_projector.html | 52 ++---------- .../agenda/templates/agenda/overview.html | 4 +- .../templates/agenda/speaker_widget.html | 11 ++- openslides/agenda/templates/agenda/view.html | 12 +-- .../agenda/templates/agenda/widget.html | 3 +- .../projector/agenda_list_of_speaker.html | 33 +++----- openslides/agenda/urls.py | 8 +- openslides/agenda/views.py | 31 ++++---- openslides/locale/de/LC_MESSAGES/django.po | 2 +- .../templates/motion/motion_detail.html | 6 +- .../motion/templates/motion/motion_list.html | 12 ++- .../motion/templates/motion/poll_form.html | 2 +- .../motion/templates/motion/widget.html | 17 ++-- .../motion/templates/projector/Motion.html | 74 +++++++++--------- .../static/javascript/participant.js | 25 +----- .../templates/participant/overview.html | 5 +- .../projector/static/javascript/projector.js | 4 +- .../projector/static/styles/projector.css | 9 +-- .../projector/custom_slide_widget.html | 2 +- .../templates/projector/dashboard.html | 7 +- openslides/projector/views.py | 4 +- openslides/static/javascript/utils.js | 23 +++++- openslides/static/styles/base.css | 9 +++ openslides/utils/views.py | 1 + 30 files changed, 237 insertions(+), 217 deletions(-) create mode 100644 openslides/agenda/static/img/glyphicons_300_microphone.png diff --git a/openslides/account/templates/account/personal_info_widget.html b/openslides/account/templates/account/personal_info_widget.html index 8d7f3f0d2..33907f019 100644 --- a/openslides/account/templates/account/personal_info_widget.html +++ b/openslides/account/templates/account/personal_info_widget.html @@ -15,13 +15,14 @@ {% trans 'I submitted the following motions:' %} {% for motion in submitted_motions %}
  • - {{ motion }} - ({% trans 'motion' %} - {% if motion.identifier %} - {{ motion.identifier }}) - {% else %} - [{% trans 'no number' %}]) - {% endif %} + + {% if motion.identifier %} + [#{{ motion.identifier }}] + {% else %} + [---] + {% endif %} + {{ motion }} +
  • {% empty %}
  • {% trans 'None' %}
  • @@ -34,13 +35,14 @@ {% trans 'I support the following motions:' %} {% for motion in supported_motions %}
  • - {{ motion }} - ({% trans 'motion' %} - {% if motion.identifier %} - {{ motion.identifier }}) - {% else %} - [{% trans 'no number' %}]) - {% endif %} + + {% if motion.identifier %} + [#{{ motion.identifier }}] + {% else %} + [---] + {% endif %} + {{ motion }} +
  • {% empty %}
  • {% trans 'None' %}
  • diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index b71817e22..5db0f3ea5 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -202,6 +202,7 @@ class Item(MPTTModel, SlideMixin): list_of_speakers = self.get_list_of_speakers( old_speakers_count=config['agenda_show_last_speakers']) data = {'title': self.get_title(), + 'item': self, 'template': 'projector/agenda_list_of_speaker.html', 'list_of_speakers': list_of_speakers} elif self.related_sid: diff --git a/openslides/agenda/signals.py b/openslides/agenda/signals.py index fec09339d..9f90b5bf0 100644 --- a/openslides/agenda/signals.py +++ b/openslides/agenda/signals.py @@ -93,7 +93,10 @@ def agenda_list_of_speakers(sender, **kwargs): list_of_speakers = slide.get_list_of_speakers( old_speakers_count=config['agenda_show_last_speakers'], coming_speakers_count=5) - context = {'list_of_speakers': list_of_speakers} + context = { + 'list_of_speakers': list_of_speakers, + 'closed': slide.speaker_list_closed, + } return render_to_string('agenda/overlay_speaker_projector.html', context) return Overlay(name, get_widget_html, get_projector_html) diff --git a/openslides/agenda/static/img/glyphicons_300_microphone.png b/openslides/agenda/static/img/glyphicons_300_microphone.png new file mode 100644 index 0000000000000000000000000000000000000000..bde033ca3b39c1316e370878e71bf97cf635acb3 GIT binary patch literal 1076 zcmV-41k3x0P)4Tx04R}-l+Q~PVHn51vyB)iL11Qkh@nGBs7w}RMCGo(*tBg~f0Po$?CiU{ zle4qa%26U(f|ru*d1uDm5$(qdGxK?$AK&MB z-{F0M8d)(-JtP5n!?BWmQR({Vm{j`_Asj&+!l+YJ+l(X<1E9fUv1@F;hrqupt$X|b zI_lE4ng@jaKh%lTb}(f=ak3uu6-!kMZ8FSKs7BM z|C+c%%_(W1MkH>@24YeH&g(_h@8=*r^~@L^r0;R+=`OQ-d=_TXN_RhT8}a8f>+a#2 z#Pb=gH%8n{&sxUn9rjo_p*gW3k3%Dd9v|?z$wwEp4JbjhwM#!rpOV)g4O?IHuKzA8qHe6NWHQ4?5 zW?+>pP^lFuS83d>RC0Yby(58Yf7(5YU7B8Os@7T+7jCT7FHP^*tHQ2TvC67;&Z}|3 zd?p?hPl_?ILp%pbyd-vt7sYOxofiix8N;NaVZv3ip-`5AN%ERI{+SmG@2t6_p^q8N z(o~6`|AbY@XgUiV(SNxAbMSk`qp>3J!UhhXuG%(|?j0gDE>~^N72v`*x)0t~ZOwEZ z4m|-D&ZtGJ}8;WLk96sqPn3I;4%{fxLET5GkbR{t#`+_*~}`j zbQ|o!Sm8skUWdN>^9=Kl{wB8{Kj^Azom^po0UjhbhN}A0Z>_zx|Mtvv#1oIxYu!|+$;1Dm;^KG{Ay$f*|g(n&0cY3U}^RUaSr??C_ z$`DIjVGr|$X@>cRADBhy3~%uY&t;)&@FI)uB)n5Yi%6W uM>gj%X05eJRjt;gU;n4Himl_Ls&WURpk`iG%08t40000 {% if perms.projector.can_manage_projector %} - - + + + + + {% endif %} {% if perms.agenda.can_manage_agenda %} diff --git a/openslides/agenda/templates/agenda/overlay_speaker_projector.html b/openslides/agenda/templates/agenda/overlay_speaker_projector.html index 6c9b9ac3a..28241833e 100644 --- a/openslides/agenda/templates/agenda/overlay_speaker_projector.html +++ b/openslides/agenda/templates/agenda/overlay_speaker_projector.html @@ -1,57 +1,19 @@ {% load i18n %} {% load tags %} - -
    -

    {% trans 'List of speakers' %}:

    +

    {% trans "List of speakers" %} {% if closed %}({% trans 'closed' %}){% endif %}

    {% if list_of_speakers %} -
      +
        {% for speaker_dict in list_of_speakers %} -
      • - {% if speaker_dict.type == 'actual_speaker' %} - - {% else %} - {{ speaker_dict.prefix }} - {% endif %} - {{ speaker_dict.speaker }} - {% if speaker_dict.type == 'actual_speaker' %} - +
      • {# old_speaker, actual_speaker, coming_speaker #} + {% if speaker_dict.type == 'coming_speaker' %} + {{ speaker_dict.prefix }}. {% endif %} + {{ speaker_dict.speaker }}
      • {% endfor %} -
      +
    {% else %} {% trans 'The list of speakers is empty.' %} {% endif %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 793a31be7..0ac81d5ef 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -96,7 +96,9 @@ {% if perms.projector.can_manage_projector %} - + diff --git a/openslides/agenda/templates/agenda/speaker_widget.html b/openslides/agenda/templates/agenda/speaker_widget.html index 6cf6e3744..fdd422bc2 100644 --- a/openslides/agenda/templates/agenda/speaker_widget.html +++ b/openslides/agenda/templates/agenda/speaker_widget.html @@ -1,6 +1,11 @@ {% load i18n %} {% load tags %} - + +

    {% trans 'Put me on the current list of speakers' %}

    +

    {% trans 'Go to current list of speakers' %}

    + +{% if perms.agenda.can_manage_agenda %} +
    + {% trans 'Next speaker' %} +{% endif %} diff --git a/openslides/agenda/templates/agenda/view.html b/openslides/agenda/templates/agenda/view.html index 19c0debbb..34488eb84 100644 --- a/openslides/agenda/templates/agenda/view.html +++ b/openslides/agenda/templates/agenda/view.html @@ -29,7 +29,7 @@ {% endif %} @@ -67,7 +67,7 @@ - + {% trans 'Show list' %} {% endif %} @@ -96,7 +96,7 @@
    {% elif speaker_dict.type == 'actual_speaker' %} - {% trans 'Actual speaker' %}: + {% trans 'Current speaker' %}: {% else %} {% trans "Next speakers" %}: {% endif %} @@ -113,14 +113,14 @@ {{ speaker_dict.prefix }}. {% else %} - [{{ speaker_dict.speaker.begin_time }}{% if speaker_dict.type == 'old_speaker' %} – {{ speaker_dict.speaker.end_time }}{% endif %}] + [{{ speaker_dict.speaker.begin_time }}{% if speaker_dict.type == 'old_speaker' %} – {{ speaker_dict.speaker.end_time }}{% endif %}] {% endif %} {{ speaker_dict.speaker }} {% if perms.agenda.can_manage_agenda %} {% if speaker_dict.type == 'actual_speaker' %} - {% trans 'End speach' %} + {% trans 'End speach' %} {% elif speaker_dict.type == 'coming_speaker' %} - {% trans "Next speaker" %} + {% trans "Begin speach" %} {% endif %} diff --git a/openslides/agenda/templates/agenda/widget.html b/openslides/agenda/templates/agenda/widget.html index 39c820953..8cb53f94b 100644 --- a/openslides/agenda/templates/agenda/widget.html +++ b/openslides/agenda/templates/agenda/widget.html @@ -19,7 +19,7 @@ {% for item in items %}
  •   @@ -51,4 +51,3 @@
  • {% trans 'No items available.' %}
  • {% endfor %} - diff --git a/openslides/agenda/templates/projector/agenda_list_of_speaker.html b/openslides/agenda/templates/projector/agenda_list_of_speaker.html index c966e9093..ca14c8a91 100644 --- a/openslides/agenda/templates/projector/agenda_list_of_speaker.html +++ b/openslides/agenda/templates/projector/agenda_list_of_speaker.html @@ -7,40 +7,27 @@ {% block content %}

    {{ title }}

    -

    {% trans 'List of speakers' %}

    +

    + {% trans 'List of speakers' %} + {% if item.speaker_list_closed %}({% trans 'closed' %}){% endif %} +

    {% endblock %} {% block scrollcontent %} - +

    {% if list_of_speakers %}

      {% for speaker_dict in list_of_speakers %} -
    • - {% if speaker_dict.type == 'actual_speaker' %} - - {% else %} - {{ speaker_dict.prefix }} - {% endif %} - {{ speaker_dict.speaker }} - {% if speaker_dict.type == 'actual_speaker' %} - +
    • {#o ld_speaker, actual_speaker, coming_speaker #} + {% if speaker_dict.type == 'coming_speaker' %} + {{ speaker_dict.prefix }}. {% endif %} + {{ speaker_dict.speaker }}
    • {% endfor %}
    {% else %} {% trans 'The list of speakers is empty.' %} {% endif %} +

    {% endblock %} diff --git a/openslides/agenda/urls.py b/openslides/agenda/urls.py index 2d7ad1e9f..d1cf912dd 100644 --- a/openslides/agenda/urls.py +++ b/openslides/agenda/urls.py @@ -60,7 +60,7 @@ urlpatterns = patterns( name='print_agenda', ), - # Speaker List + # List of speakers url(r'^(?P\d+)/speaker/$', SpeakerAppendView.as_view(), name='agenda_speaker_append', @@ -101,8 +101,14 @@ urlpatterns = patterns( name='agenda_speaker_change_order', ), + url(r'^list_of_speakers/add/$', + CurrentListOfSpeakersView.as_view(set_speaker=True), + name='agenda_add_to_current_list_of_speakers', + ), + url(r'^list_of_speakers/$', CurrentListOfSpeakersView.as_view(), name='agenda_current_list_of_speakers', ), + ) diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index b050aacb5..bf61c0876 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -18,6 +18,7 @@ from django.core.urlresolvers import reverse from django.contrib import messages from django.db import transaction from django.db.models import Model +from django.template import RequestContext from django.utils.translation import ugettext as _, ugettext_lazy from django.views.generic.detail import SingleObjectMixin @@ -81,7 +82,8 @@ class Overview(TemplateView): 'active_sid': get_active_slide(only_sid=True), 'duration': duration, 'start': start, - 'end': end}) + 'end': end, + 'show_list': config['presentation_argument'] == 'show_list_of_speakers'}) return context @transaction.commit_manually @@ -436,6 +438,8 @@ class CurrentListOfSpeakersView(RedirectView): """ Redirect to the current list of speakers and set the request.user on it. """ + set_speaker = False + def get_item(self): """ Returns the current Item, or None, if the current Slide is not an Agenda Item. @@ -467,19 +471,18 @@ class CurrentListOfSpeakersView(RedirectView): 'Please choose the agenda item manually from the agenda.')) return reverse('dashboard') - if item.speaker_list_closed: - messages.error(request, _('The list of speakers is closed.')) - return reverse('dashboard') + if self.set_speaker: + if item.speaker_list_closed: + messages.error(request, _('The list of speakers is closed.')) + return reverse('dashboard') - if self.request.user.has_perm('agenda.can_be_speaker'): - try: - Speaker.objects.add(self.request.user, item) - except OpenSlidesError: - messages.error(request, _('You are already on the list of speakers.')) + if self.request.user.has_perm('agenda.can_be_speaker'): + try: + Speaker.objects.add(self.request.user, item) + except OpenSlidesError: + messages.error(request, _('You are already on the list of speakers.')) else: - messages.success(request, _('You are now on the list of speakers.')) - else: - messages.error(request, _('You can not put yourself on the list of speakers.')) + messages.error(request, _('You can not put yourself on the list of speakers.')) if not self.request.user.has_perm('agenda.can_see_agenda'): return reverse('dashboard') @@ -519,7 +522,7 @@ def get_widgets(request): Widget( name='append_to_list_of_speakers', - display_name=_('To the current list of speakers'), + display_name=_('List of speakers'), template='agenda/speaker_widget.html', - context={}, + context=RequestContext(request, {}), permission_required='agenda.can_be_speaker')] diff --git a/openslides/locale/de/LC_MESSAGES/django.po b/openslides/locale/de/LC_MESSAGES/django.po index 83d2975bd..8287f2b2b 100644 --- a/openslides/locale/de/LC_MESSAGES/django.po +++ b/openslides/locale/de/LC_MESSAGES/django.po @@ -217,7 +217,7 @@ msgid "" "There is no list of speakers for the current slide. Please choose the agenda " "item manually from the agenda." msgstr "" -"Es existiert keine Rednerliste für die aktuelle Folie. Bitte wähle den " +"Es existiert keine Rednerliste für die aktuelle Folie. Bitte wählen Sie den " "Tagesordnungseintrag manuell von der Tagesordnung." #: agenda/views.py:451 diff --git a/openslides/motion/templates/motion/motion_detail.html b/openslides/motion/templates/motion/motion_detail.html index 17d2bff82..4488741f1 100644 --- a/openslides/motion/templates/motion/motion_detail.html +++ b/openslides/motion/templates/motion/motion_detail.html @@ -145,9 +145,11 @@ {% if perms.motion.can_manage_motion %} +
    +
      {% for message in motion.log_messages.all %} @@ -188,10 +190,6 @@ {{ motion.state }}
      {% endif %} - {% for note in motion.notes %} - {{ note }} - {% if not forloop.last %}
      {% endif %} - {% endfor %}
      {% trans "Vote results" %}:
      diff --git a/openslides/motion/templates/motion/motion_list.html b/openslides/motion/templates/motion/motion_list.html index cffe8b759..4b7828c06 100644 --- a/openslides/motion/templates/motion/motion_list.html +++ b/openslides/motion/templates/motion/motion_list.html @@ -22,6 +22,8 @@ +{% comment %} + TODO: remove this filter and add client side filtering with DataTables
      {% if min_supporters > 0 %}