From 16c37661f772e06970bc1f1fb5587b895442b6a6 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Mon, 6 Feb 2012 22:08:08 +0100 Subject: [PATCH] renamed beamer in projector --- openslides/agenda/api.py | 2 +- openslides/agenda/models.py | 12 ++--- .../agenda/templates/agenda/base_agenda.html | 2 +- .../agenda/templates/agenda/overview.html | 18 +++---- .../{beamer => projector}/AgendaSummary.html | 2 +- .../{beamer => projector}/AgendaText.html | 2 +- openslides/agenda/tests.py | 14 ----- openslides/agenda/views.py | 10 ++-- openslides/application/models.py | 12 ++--- .../{beamer => projector}/Application.html | 2 +- openslides/assignment/models.py | 12 ++--- .../{beamer => projector}/Assignment.html | 2 +- openslides/beamer/urls.py | 47 ----------------- openslides/default.settings.py | 2 +- openslides/{beamer => projector}/__init__.py | 0 openslides/{beamer => projector}/api.py | 4 +- openslides/{beamer => projector}/models.py | 6 +-- .../templates/base-projector.html} | 6 +-- openslides/{beamer => projector}/tests.py | 0 openslides/projector/urls.py | 48 ++++++++++++++++++ openslides/{beamer => projector}/views.py | 16 +++--- .../{logo-beamer.png => logo-projector.png} | Bin openslides/static/javascript/agenda.js | 6 +-- .../javascript/{beamer.js => projector.js} | 2 +- .../styles/{beamer.css => projector.css} | 2 +- openslides/urls.py | 2 +- 26 files changed, 107 insertions(+), 124 deletions(-) rename openslides/agenda/templates/{beamer => projector}/AgendaSummary.html (92%) rename openslides/agenda/templates/{beamer => projector}/AgendaText.html (88%) rename openslides/application/templates/{beamer => projector}/Application.html (98%) rename openslides/assignment/templates/{beamer => projector}/Assignment.html (99%) delete mode 100644 openslides/beamer/urls.py rename openslides/{beamer => projector}/__init__.py (100%) rename openslides/{beamer => projector}/api.py (96%) rename openslides/{beamer => projector}/models.py (87%) rename openslides/{beamer/templates/beamer.html => projector/templates/base-projector.html} (86%) rename openslides/{beamer => projector}/tests.py (100%) create mode 100644 openslides/projector/urls.py rename openslides/{beamer => projector}/views.py (91%) rename openslides/static/images/{logo-beamer.png => logo-projector.png} (100%) rename openslides/static/javascript/{beamer.js => projector.js} (98%) rename openslides/static/styles/{beamer.css => projector.css} (99%) diff --git a/openslides/agenda/api.py b/openslides/agenda/api.py index d07c306af..aa67e86c6 100644 --- a/openslides/agenda/api.py +++ b/openslides/agenda/api.py @@ -15,7 +15,7 @@ from django.contrib import messages from django.core.context_processors import csrf from openslides.system.api import config_get -from beamer.api import get_active_element +from projector.api import get_active_element def is_summary(): diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index f0228ef53..42bf0250c 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -18,8 +18,8 @@ except ImportError: from django.db import models from django.utils.translation import ugettext as _ -from beamer.models import Element -from beamer.api import element_register +from projector.models import Element +from projector.api import element_register from system.api import config_set from application.models import Application from poll.models import Poll @@ -41,14 +41,14 @@ class Item(models.Model, Element): prefix = 'item' - def beamer(self): + def slide(self): """ - Return a map with all Data for the Beamer + Return a map with all Data for the Slide """ return { 'item': self, 'title': self.title, - 'template': 'beamer/AgendaText.html', + 'template': 'projector/AgendaText.html', } @property @@ -137,7 +137,7 @@ class Item(models.Model, Element): def get_absolute_url(self, link='view'): """ Return the URL to this item. By default it is the Link to its - beamer-view. + slide link can be: * view diff --git a/openslides/agenda/templates/agenda/base_agenda.html b/openslides/agenda/templates/agenda/base_agenda.html index 331f98d6f..6d9e54097 100644 --- a/openslides/agenda/templates/agenda/base_agenda.html +++ b/openslides/agenda/templates/agenda/base_agenda.html @@ -11,7 +11,7 @@
  • {%trans "New item" %}
  • {% endif %} {% if perms.agenda.can_see_projector %} -
  • {%trans 'Projector view' %}
  • +
  • {%trans 'Projector view' %}
  • {% endif %} {% endblock %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index bbde2f377..2c1319477 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -52,18 +52,18 @@ {% trans "Countdown" %} ({{countdown_time}}{% trans "sec" %}){% if countdown_visible == "True" %}: - - - + + + {% endif %}

    - + {% trans "Adjust projector view" %}: - - - - - + + + + + {% endif %} diff --git a/openslides/agenda/templates/beamer/AgendaSummary.html b/openslides/agenda/templates/projector/AgendaSummary.html similarity index 92% rename from openslides/agenda/templates/beamer/AgendaSummary.html rename to openslides/agenda/templates/projector/AgendaSummary.html index 1a5b240a4..aa8fcc3f8 100644 --- a/openslides/agenda/templates/beamer/AgendaSummary.html +++ b/openslides/agenda/templates/projector/AgendaSummary.html @@ -1,4 +1,4 @@ -{% extends "beamer.html" %} +{% extends "base-projector.html" %} {% block title %}{{ block.super }} - {% if title %} {{ title }} {% else %} {%trans "Agenda" %} {% endif %} {% endblock %} diff --git a/openslides/agenda/templates/beamer/AgendaText.html b/openslides/agenda/templates/projector/AgendaText.html similarity index 88% rename from openslides/agenda/templates/beamer/AgendaText.html rename to openslides/agenda/templates/projector/AgendaText.html index 36626b53d..3b7767ffe 100644 --- a/openslides/agenda/templates/beamer/AgendaText.html +++ b/openslides/agenda/templates/projector/AgendaText.html @@ -1,4 +1,4 @@ -{% extends "beamer.html" %} +{% extends "base-projector.html" %} {% block title %}{{ block.super }} - {{ item.title }}{% endblock %} {% block content %} {% if item.text %} diff --git a/openslides/agenda/tests.py b/openslides/agenda/tests.py index 8728c4f2d..f44fed453 100644 --- a/openslides/agenda/tests.py +++ b/openslides/agenda/tests.py @@ -110,20 +110,6 @@ class ViewTest(TestCase): def anonymClient(self): return Client() - def testBeamer(self): - c = self.anonymClient - response = c.get('/beamer/') - self.assertEqual(response.status_code, 302) - - c = self.adminClient - response = c.get('/beamer/') - self.assertEqual(response.status_code, 200) - - response = c.get('/agenda/%d/' % self.item1.id) - self.assertEqual(response.status_code, 200) - self.assertEqual(response.context['item'], self.item1.cast()) - self.assertEqual(response.templates[0].name, 'beamer/ItemText.html') - def testActivate(self): c = self.adminClient diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 9702b6b5b..3e16f3dd2 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -17,7 +17,7 @@ from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext as _ -from beamer.api import get_active_element +from projector.api import get_active_element from agenda.models import Item from agenda.api import is_summary, children_list, \ del_confirm_form_for_items @@ -37,14 +37,10 @@ def view(request, item_id): Shows the Slide. """ item = Item.objects.get(id=item_id) - votes = assignment_votes(item) - polls = assignment_polls(item) - return render_to_response('beamer/%s.html' % item.type, + return render_to_response('projector/AgendaText.html', { - 'item': item.cast(), + 'item': item, 'ajax': 'off', - 'votes': votes, - 'polls': polls, }, context_instance=RequestContext(request)) diff --git a/openslides/application/models.py b/openslides/application/models.py index 79404ed5e..5c74b4fc2 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -17,8 +17,8 @@ from django.db.models import Max from django.contrib.auth.models import User from django.utils.translation import ugettext as _ -from beamer.api import element_register -from beamer.models import Element +from projector.api import element_register +from projector.models import Element from participant.models import Profile from system.api import config_get @@ -430,14 +430,14 @@ class Application(models.Model, Element): results.append([option.yes, option.no, option.undesided, poll.votesinvalidf, poll.votescastf]) return results - def beamer(self): + def slide(self): """ - return the beamer dict + return the slide dict """ - data = super(Application, self).beamer() + data = super(Application, self).slide() data['application'] = self data['title'] = self.title - data['template'] = 'beamer/Application.html' + data['template'] = 'projector/Application.html' return data @models.permalink diff --git a/openslides/application/templates/beamer/Application.html b/openslides/application/templates/projector/Application.html similarity index 98% rename from openslides/application/templates/beamer/Application.html rename to openslides/application/templates/projector/Application.html index cad4db3e1..827f4e829 100644 --- a/openslides/application/templates/beamer/Application.html +++ b/openslides/application/templates/projector/Application.html @@ -1,4 +1,4 @@ -{% extends "beamer.html" %} +{% extends "base-projector.html" %} {% load tags %} {% block title %}{{ block.super }} - {{ item.title }}{% endblock %} {% block content %} diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index 337a6bb0b..6b0ed77a4 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -15,8 +15,8 @@ from django.utils.translation import ugettext as _ from participant.models import Profile -from beamer.models import Element -from beamer.api import element_register +from projector.models import Element +from projector.api import element_register class Assignment(models.Model, Element): @@ -117,14 +117,14 @@ class Assignment(models.Model, Element): poll.add_option(candidate) return poll - def beamer(self): + def slide(self): """ - return the beamer dict + return the slide dict """ - data = super(Assignment, self).beamer() + data = super(Assignment, self).slide() data['assignment'] = self data['title'] = self.name - data['template'] = 'beamer/Assignment.html' + data['template'] = 'projector/Assignment.html' return data @models.permalink diff --git a/openslides/assignment/templates/beamer/Assignment.html b/openslides/assignment/templates/projector/Assignment.html similarity index 99% rename from openslides/assignment/templates/beamer/Assignment.html rename to openslides/assignment/templates/projector/Assignment.html index b0a6c38eb..bda794ae2 100644 --- a/openslides/assignment/templates/beamer/Assignment.html +++ b/openslides/assignment/templates/projector/Assignment.html @@ -1,4 +1,4 @@ -{% extends "beamer.html" %} +{% extends "base-projector.html" %} {% block title %}{{ block.super }} - #{{ item.title }}{% endblock %} {% block header %} diff --git a/openslides/beamer/urls.py b/openslides/beamer/urls.py deleted file mode 100644 index 4fb419630..000000000 --- a/openslides/beamer/urls.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -""" - openslides.beamer.urls - ~~~~~~~~~~~~~~~~~~~~~~ - - URL list for the beamer app. - - :copyright: 2011 by the OpenSlides team, see AUTHORS. - :license: GNU GPL, see LICENSE for more details. -""" - -from django.conf.urls.defaults import * - -urlpatterns = patterns('beamer.views', - url(r'^$', 'beamer', - name='beamer_show'), - - url(r'^bigger$', 'beamer_edit', {'direction': 'bigger'}, - name='beamer_bigger'), - - url(r'^smaller$', 'beamer_edit', {'direction': 'smaller'}, name='beamer_smaller'), - - url(r'^up$', 'beamer_edit', {'direction': 'up'}, - name='beamer_up'), - - url(r'^beamer/down$', 'beamer_edit', {'direction': 'down'}, - name='beamer_down'), - - url(r'^beamer/clean$', 'beamer_edit', {'direction': 'clean'}, - name='beamer_clean'), - - url(r'^beamer/countdown/show$', 'beamer_countdown', {'command': 'show'}, - name='countdown_open'), - - url(r'^beamer/countdown/hide$', 'beamer_countdown', {'command': 'hide'}, - name='countdown_close'), - - url(r'^beamer/countdown/reset/(?P