renamed beamer in projector
This commit is contained in:
parent
65887c8c21
commit
16c37661f7
@ -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():
|
||||
|
@ -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
|
||||
|
@ -11,7 +11,7 @@
|
||||
<li class="{% active request '/agenda/new/' %}"><a href="{% url item_new %}">{%trans "New item" %}</a></li>
|
||||
{% endif %}
|
||||
{% if perms.agenda.can_see_projector %}
|
||||
<li><a href="{% url beamer_show %}"><img src="/static/images/icons/video-projector.png"> {%trans 'Projector view' %}</a></li>
|
||||
<li><a href="{% url projector_show %}"><img src="/static/images/icons/video-projector.png"> {%trans 'Projector view' %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
@ -52,18 +52,18 @@
|
||||
<input type="checkbox" name="countdown" onchange="document.location='{% if countdown_visible == "True" %}{% url countdown_close %}{% else %}{% url countdown_open %}{% endif %}'"
|
||||
{% if countdown_visible == "True" %}checked{% endif %}>
|
||||
{% trans "Countdown" %} (<a href="{% url config_agenda %}">{{countdown_time}}{% trans "sec" %}</a>){% if countdown_visible == "True" %}:
|
||||
<a class="beamer_countdown" href="{% url countdown_reset countdown_time %}" title="{% trans 'Reset countdown' %}"><img src="/static/images/icons/media-skip-backward.png"></a>
|
||||
<a class="beamer_countdown" href="{% url countdown_start %}" title="{% trans 'Start countdown' %}"><img src="/static/images/icons/media-playback-start.png"></a>
|
||||
<a class="beamer_countdown" href="{% url countdown_stop %}" title="{% trans 'Stop countdown' %}"><img src="/static/images/icons/media-playback-pause.png"></a>
|
||||
<a class="projector_countdown" href="{% url countdown_reset countdown_time %}" title="{% trans 'Reset countdown' %}"><img src="/static/images/icons/media-skip-backward.png"></a>
|
||||
<a class="projector_countdown" href="{% url countdown_start %}" title="{% trans 'Start countdown' %}"><img src="/static/images/icons/media-playback-start.png"></a>
|
||||
<a class="projector_countdown" href="{% url countdown_stop %}" title="{% trans 'Stop countdown' %}"><img src="/static/images/icons/media-playback-pause.png"></a>
|
||||
{% endif %}
|
||||
<p></p>
|
||||
<!-- beamer control -->
|
||||
<!-- projector control -->
|
||||
{% trans "Adjust projector view" %}:
|
||||
<a class="beamer_edit" href="{% url beamer_bigger %}" title="{% trans 'Zoom in' %}"><img src="/static/images/icons/zoom-in.png"></a>
|
||||
<a class="beamer_edit" href="{% url beamer_smaller %}" title="{% trans 'Zoom out' %}"><img src="/static/images/icons/zoom-out.png"></a>
|
||||
<a class="beamer_edit" href="{% url beamer_up %}" title="{% trans 'Scroll text up' %}"><img src="/static/images/icons/go-up.png"></a>
|
||||
<a class="beamer_edit" href="{% url beamer_down %}" title="{% trans 'Scroll text down' %}"><img src="/static/images/icons/go-down.png"></a>
|
||||
<a class="beamer_edit" href="{% url beamer_clean %}" title="{% trans 'Reset projector view' %}"><img src="/static/images/icons/view-restore.png"></a>
|
||||
<a class="projector_edit" href="{% url projector_bigger %}" title="{% trans 'Zoom in' %}"><img src="/static/images/icons/zoom-in.png"></a>
|
||||
<a class="projector_edit" href="{% url projector_smaller %}" title="{% trans 'Zoom out' %}"><img src="/static/images/icons/zoom-out.png"></a>
|
||||
<a class="projector_edit" href="{% url projector_up %}" title="{% trans 'Scroll text up' %}"><img src="/static/images/icons/go-up.png"></a>
|
||||
<a class="projector_edit" href="{% url projector_down %}" title="{% trans 'Scroll text down' %}"><img src="/static/images/icons/go-down.png"></a>
|
||||
<a class="projector_edit" href="{% url projector_clean %}" title="{% trans 'Reset projector view' %}"><img src="/static/images/icons/view-restore.png"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "beamer.html" %}
|
||||
{% extends "base-projector.html" %}
|
||||
{% block title %}{{ block.super }} -
|
||||
{% if title %} {{ title }} {% else %} {%trans "Agenda" %} {% endif %}
|
||||
{% endblock %}
|
@ -1,4 +1,4 @@
|
||||
{% extends "beamer.html" %}
|
||||
{% extends "base-projector.html" %}
|
||||
{% block title %}{{ block.super }} - {{ item.title }}{% endblock %}
|
||||
{% block content %}
|
||||
{% if item.text %}
|
@ -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
|
||||
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "beamer.html" %}
|
||||
{% extends "base-projector.html" %}
|
||||
{% load tags %}
|
||||
{% block title %}{{ block.super }} - {{ item.title }}{% endblock %}
|
||||
{% block content %}
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "beamer.html" %}
|
||||
{% extends "base-projector.html" %}
|
||||
{% block title %}{{ block.super }} - #{{ item.title }}{% endblock %}
|
||||
{% block header %}
|
||||
<link type="text/css" rel="stylesheet" media="all" href="/static/styles/assignment.css" />
|
@ -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<time>\d+)$', 'beamer_countdown', {'command': 'reset'},
|
||||
name='countdown_reset'),
|
||||
|
||||
url(r'^beamer/countdown/start$', 'beamer_countdown', {'command': 'start'},
|
||||
name='countdown_start'),
|
||||
|
||||
url(r'^beamer/countdown/stop$', 'beamer_countdown', {'command': 'stop'},
|
||||
name='countdown_stop'),
|
||||
)
|
@ -130,7 +130,7 @@ INSTALLED_APPS = (
|
||||
'poll',
|
||||
'assignment',
|
||||
'utils',
|
||||
'beamer',
|
||||
'projector',
|
||||
)
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
|
@ -1,5 +1,5 @@
|
||||
from system.api import config_set, config_get
|
||||
from beamer.models import ELEMENT
|
||||
from projector.models import ELEMENT
|
||||
|
||||
|
||||
def get_element_from_eid(eid):
|
||||
@ -20,7 +20,7 @@ def get_active_element(only_eid=False):
|
||||
if only_id is True, returns only the id of this item. Returns None if not Item
|
||||
is active. Does not Raise Item.DoesNotExist
|
||||
"""
|
||||
from beamer.models import Element
|
||||
from projector.models import Element
|
||||
eid = config_get("presentation", None)
|
||||
|
||||
if only_eid:
|
@ -6,9 +6,9 @@ ELEMENT = {}
|
||||
|
||||
class Element(object):
|
||||
|
||||
def beamer(self):
|
||||
def slide(self):
|
||||
"""
|
||||
Return a map with all Data for the Beamer
|
||||
Return a map with all Data for a Slide
|
||||
"""
|
||||
return {
|
||||
'element': self,
|
||||
@ -30,7 +30,7 @@ class Element(object):
|
||||
"""
|
||||
Return True, if the the element is the active one.
|
||||
"""
|
||||
from beamer.api import get_active_element
|
||||
from projector.api import get_active_element
|
||||
return True if get_active_element(only_eid=True) == self.eid else False
|
||||
|
||||
def set_active(self):
|
@ -4,10 +4,10 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
{% load tags %}
|
||||
<head>
|
||||
<link type="text/css" rel="stylesheet" href="/static/styles/beamer.css">
|
||||
<link type="text/css" rel="stylesheet" href="/static/styles/projector.css">
|
||||
<link rel="shortcut icon" href="/static/images/favicon.png" type="image/png" />
|
||||
<script type="text/javascript" src="/static/javascript/jquery.js"></script>
|
||||
<script type="text/javascript" src="/static/javascript/beamer.js"></script>
|
||||
<script type="text/javascript" src="/static/javascript/projector.js"></script>
|
||||
<title>{% block title %} {% get_config 'event_name' %} {% endblock %}</title>
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
@ -19,7 +19,7 @@
|
||||
<div id="ajaxswitcher"></div>
|
||||
|
||||
<div id="header">
|
||||
<div id="logo"><img src="/static/images/logo-beamer.png"></div>
|
||||
<div id="logo"><img src="/static/images/logo-projector.png"></div>
|
||||
<div class="event_name">{% get_config 'event_name' %}</div>
|
||||
<div class="event_description">{% get_config 'event_description' %}</div>
|
||||
</div>
|
48
openslides/projector/urls.py
Normal file
48
openslides/projector/urls.py
Normal file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
openslides.projector.urls
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
URL list for the projector 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('projector.views',
|
||||
url(r'^$', 'active_slide',
|
||||
name='projector_show'),
|
||||
|
||||
url(r'^bigger$', 'projector_edit', {'direction': 'bigger'},
|
||||
name='projector_bigger'),
|
||||
|
||||
url(r'^smaller$', 'projector_edit', {'direction': 'smaller'},
|
||||
name='projector_smaller'),
|
||||
|
||||
url(r'^up$', 'projector_edit', {'direction': 'up'},
|
||||
name='projector_up'),
|
||||
|
||||
url(r'^projector/down$', 'projector_edit', {'direction': 'down'},
|
||||
name='projector_down'),
|
||||
|
||||
url(r'^projector/clean$', 'projector_edit', {'direction': 'clean'},
|
||||
name='projector_clean'),
|
||||
|
||||
url(r'^projector/countdown/show$', 'projector_countdown', {'command': 'show'},
|
||||
name='countdown_open'),
|
||||
|
||||
url(r'^projector/countdown/hide$', 'projector_countdown', {'command': 'hide'},
|
||||
name='countdown_close'),
|
||||
|
||||
url(r'^projector/countdown/reset/(?P<time>\d+)$', 'projector_countdown', {'command': 'reset'},
|
||||
name='countdown_reset'),
|
||||
|
||||
url(r'^projector/countdown/start$', 'projector_countdown', {'command': 'start'},
|
||||
name='countdown_start'),
|
||||
|
||||
url(r'^projector/countdown/stop$', 'projector_countdown', {'command': 'stop'},
|
||||
name='countdown_stop'),
|
||||
)
|
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
openslides.beamer.views
|
||||
openslides.projector.views
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Views for the beamer app.
|
||||
Views for the projector app.
|
||||
|
||||
:copyright: 2011 by the OpenSlides team, see AUTHORS.
|
||||
:license: GNU GPL, see LICENSE for more details.
|
||||
@ -28,11 +28,11 @@ from agenda.api import is_summary, children_list, \
|
||||
del_confirm_form_for_items
|
||||
from agenda.models import Item
|
||||
|
||||
from beamer.api import get_active_element, assignment_votes, assignment_polls
|
||||
from projector.api import get_active_element, assignment_votes, assignment_polls
|
||||
|
||||
|
||||
@permission_required('agenda.can_see_projector')
|
||||
def beamer(request):
|
||||
def active_slide(request):
|
||||
"""
|
||||
Shows the active Slide.
|
||||
"""
|
||||
@ -45,7 +45,7 @@ def beamer(request):
|
||||
if element is None:
|
||||
data = {}
|
||||
else:
|
||||
data = element.beamer()
|
||||
data = element.slide()
|
||||
|
||||
data['ajax'] = 'on'
|
||||
|
||||
@ -59,7 +59,7 @@ def beamer(request):
|
||||
items = element.children.filter(hidden=False)
|
||||
data['title'] = element.title
|
||||
data['items'] = items
|
||||
data['template'] = 'beamer/AgendaSummary.html'
|
||||
data['template'] = 'projector/AgendaSummary.html'
|
||||
|
||||
|
||||
if request.is_ajax():
|
||||
@ -84,7 +84,7 @@ def beamer(request):
|
||||
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_edit(request, direction):
|
||||
def projector_edit(request, direction):
|
||||
if direction == 'bigger':
|
||||
config_set('bigger', int(config_get('bigger', 100)) + 10)
|
||||
elif direction == 'smaller':
|
||||
@ -103,7 +103,7 @@ def beamer_edit(request, direction):
|
||||
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_countdown(request, command, time=60):
|
||||
def projector_countdown(request, command, time=60):
|
||||
if command == 'show':
|
||||
config_set('countdown_visible', True)
|
||||
elif command == 'hide':
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@ -78,8 +78,8 @@ $(function() {
|
||||
hideClosedSlides(true);
|
||||
}
|
||||
|
||||
// control beamer
|
||||
$('.beamer_edit').click(function(event) {
|
||||
// control the projector
|
||||
$('.projector_edit').click(function(event) {
|
||||
event.preventDefault();
|
||||
link = $(this);
|
||||
$.ajax({
|
||||
@ -92,7 +92,7 @@ $(function() {
|
||||
});
|
||||
|
||||
// control countdown
|
||||
$('.beamer_countdown').click(function(event) {
|
||||
$('.projector_countdown').click(function(event) {
|
||||
event.preventDefault();
|
||||
link = $(this);
|
||||
$.ajax({
|
||||
|
@ -2,7 +2,7 @@ function presentation_reload() {
|
||||
if ($('#config > #ajax').html() == 'on') {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/beamer',
|
||||
url: '/projector',
|
||||
dataType: 'json',
|
||||
data: '',
|
||||
success: function(data) {
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* OpenSlides Beamer Style
|
||||
* OpenSlides projector Style
|
||||
*/
|
||||
body{
|
||||
margin : 0px;
|
@ -24,7 +24,7 @@ urlpatterns = patterns('',
|
||||
(r'', include('openslides.participant.urls')),
|
||||
(r'', include('openslides.assignment.urls')),
|
||||
(r'', include('openslides.system.urls')),
|
||||
(r'beamer', include('beamer.urls')),
|
||||
(r'projector', include('projector.urls')),
|
||||
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),
|
||||
(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user