Reverted changset r279 from Default branch (because it's for
1.2-dev-branch only).
This commit is contained in:
parent
ac9d31d7d4
commit
0976206eb4
@ -11,7 +11,7 @@
|
||||
<li class="{% active request '/agenda/new/' %}"><a href="{% url item_new 'ItemText' %}">{%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 item_beamer %}"><img src="/static/images/icons/video-projector.png"> {%trans 'Projector view' %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
@ -13,6 +13,9 @@
|
||||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('agenda.views',
|
||||
url(r'^beamer/$', 'beamer',
|
||||
name='item_beamer'),
|
||||
|
||||
url(r'^$', 'overview'),
|
||||
|
||||
url(r'^agenda/$', 'overview',
|
||||
@ -53,4 +56,24 @@ urlpatterns = patterns('agenda.views',
|
||||
|
||||
url(r'^agenda/print/$', 'print_agenda',
|
||||
name='print_agenda'),
|
||||
|
||||
url(r'^beamer/bigger$', 'beamer_edit', {'direction': 'bigger'}, name='beamer_bigger'),
|
||||
|
||||
url(r'^beamer/smaller$', 'beamer_edit', {'direction': 'smaller'}, name='beamer_smaller'),
|
||||
|
||||
url(r'^beamer/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'),
|
||||
)
|
||||
|
@ -47,6 +47,93 @@ def view(request, item_id):
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@permission_required('agenda.can_see_projector')
|
||||
def beamer(request):
|
||||
"""
|
||||
Shows a active Slide.
|
||||
"""
|
||||
data = {'ajax': 'on'}
|
||||
template = ''
|
||||
try:
|
||||
item = get_active_item()
|
||||
votes = assignment_votes(item)
|
||||
polls = assignment_polls(item)
|
||||
if is_summary():
|
||||
items = item.children.filter(hidden=False)
|
||||
data['items'] = items
|
||||
data['title'] = item.title
|
||||
template = 'beamer/overview.html'
|
||||
else:
|
||||
data['item'] = item.cast()
|
||||
data['title'] = item.title
|
||||
data['votes'] = votes
|
||||
data['polls'] = polls
|
||||
template = 'beamer/%s.html' % (item.type)
|
||||
except Item.DoesNotExist:
|
||||
items = Item.objects.filter(parent=None).filter(hidden=False) \
|
||||
.order_by('weight')
|
||||
data['items'] = items
|
||||
data['title'] = _("Agenda")
|
||||
template = 'beamer/overview.html'
|
||||
|
||||
if request.is_ajax():
|
||||
content = render_block_to_string(template, 'content', data)
|
||||
jsondata = {'content': content,
|
||||
'title': data['title'],
|
||||
'time': datetime.now().strftime('%H:%M'),
|
||||
'bigger': config_get('bigger'),
|
||||
'up': config_get('up'),
|
||||
'countdown_visible': config_get('countdown_visible'),
|
||||
'countdown_time': config_get('agenda_countdown_time'),
|
||||
'countdown_control': config_get('countdown_control'),
|
||||
}
|
||||
return ajax_request(jsondata)
|
||||
else:
|
||||
return render_to_response(template,
|
||||
data,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_edit(request, direction):
|
||||
if direction == 'bigger':
|
||||
config_set('bigger', int(config_get('bigger', 100)) + 10)
|
||||
elif direction == 'smaller':
|
||||
config_set('bigger', int(config_get('bigger', 100)) - 10)
|
||||
elif direction == 'up':
|
||||
config_set('up', int(config_get('up', 0)) - 10)
|
||||
elif direction == 'down':
|
||||
config_set('up', int(config_get('up', 0)) + 10)
|
||||
elif direction == 'clean':
|
||||
config_set('up', 0)
|
||||
config_set('bigger', 100)
|
||||
|
||||
if request.is_ajax():
|
||||
return ajax_request({})
|
||||
return redirect(reverse('item_overview'))
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_countdown(request, command, time=60):
|
||||
if command == 'show':
|
||||
config_set('countdown_visible', True)
|
||||
elif command == 'hide':
|
||||
config_set('countdown_visible', False)
|
||||
elif command == 'reset':
|
||||
config_set('countdown_control', 'reset')
|
||||
elif command == 'start':
|
||||
config_set('countdown_control', 'start')
|
||||
elif command == 'stop':
|
||||
config_set('countdown_control', 'stop')
|
||||
|
||||
if request.is_ajax():
|
||||
if command == "show":
|
||||
link = reverse('countdown_close')
|
||||
else:
|
||||
link = reverse('countdown_open')
|
||||
return ajax_request({'countdown_visible': config_get('countdown_visible'),
|
||||
'link': link})
|
||||
return redirect(reverse('item_overview'))
|
||||
|
||||
def assignment_votes(item):
|
||||
votes = []
|
||||
if item.type == "ItemAssignment":
|
||||
|
@ -1,3 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
@ -1,16 +0,0 @@
|
||||
"""
|
||||
This file demonstrates writing tests using the unittest module. These will pass
|
||||
when you run "manage.py test".
|
||||
|
||||
Replace this with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.assertEqual(1 + 1, 2)
|
@ -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'),
|
||||
)
|
@ -1,118 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
openslides.beamer.views
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Views for the beamer app.
|
||||
|
||||
:copyright: 2011 by the OpenSlides team, see AUTHORS.
|
||||
:license: GNU GPL, see LICENSE for more details.
|
||||
"""
|
||||
from datetime import datetime
|
||||
|
||||
from django.shortcuts import render_to_response, redirect
|
||||
from django.template import RequestContext
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
||||
from utils.utils import template, permission_required, \
|
||||
del_confirm_form, ajax_request
|
||||
from utils.template import render_block_to_string
|
||||
|
||||
from system.api import config_set, config_get
|
||||
|
||||
from agenda.api import get_active_item, is_summary, children_list, \
|
||||
del_confirm_form_for_items
|
||||
from agenda.models import Item
|
||||
|
||||
|
||||
@permission_required('agenda.can_see_projector')
|
||||
def beamer(request):
|
||||
"""
|
||||
Shows a active Slide.
|
||||
"""
|
||||
data = {'ajax': 'on'}
|
||||
template = ''
|
||||
try:
|
||||
item = get_active_item()
|
||||
votes = assignment_votes(item)
|
||||
polls = assignment_polls(item)
|
||||
if is_summary():
|
||||
items = item.children.filter(hidden=False)
|
||||
data['items'] = items
|
||||
data['title'] = item.title
|
||||
template = 'beamer/overview.html'
|
||||
else:
|
||||
data['item'] = item.cast()
|
||||
data['title'] = item.title
|
||||
data['votes'] = votes
|
||||
data['polls'] = polls
|
||||
template = 'beamer/%s.html' % (item.type)
|
||||
except Item.DoesNotExist:
|
||||
items = Item.objects.filter(parent=None).filter(hidden=False) \
|
||||
.order_by('weight')
|
||||
data['items'] = items
|
||||
data['title'] = _("Agenda")
|
||||
template = 'beamer/overview.html'
|
||||
|
||||
if request.is_ajax():
|
||||
content = render_block_to_string(template, 'content', data)
|
||||
jsondata = {'content': content,
|
||||
'title': data['title'],
|
||||
'time': datetime.now().strftime('%H:%M'),
|
||||
'bigger': config_get('bigger'),
|
||||
'up': config_get('up'),
|
||||
'countdown_visible': config_get('countdown_visible'),
|
||||
'countdown_time': config_get('agenda_countdown_time'),
|
||||
'countdown_control': config_get('countdown_control'),
|
||||
}
|
||||
return ajax_request(jsondata)
|
||||
else:
|
||||
return render_to_response(template,
|
||||
data,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_edit(request, direction):
|
||||
if direction == 'bigger':
|
||||
config_set('bigger', int(config_get('bigger', 100)) + 10)
|
||||
elif direction == 'smaller':
|
||||
config_set('bigger', int(config_get('bigger', 100)) - 10)
|
||||
elif direction == 'up':
|
||||
config_set('up', int(config_get('up', 0)) - 10)
|
||||
elif direction == 'down':
|
||||
config_set('up', int(config_get('up', 0)) + 10)
|
||||
elif direction == 'clean':
|
||||
config_set('up', 0)
|
||||
config_set('bigger', 100)
|
||||
|
||||
if request.is_ajax():
|
||||
return ajax_request({})
|
||||
return redirect(reverse('item_overview'))
|
||||
|
||||
|
||||
@permission_required('agenda.can_manage_agenda')
|
||||
def beamer_countdown(request, command, time=60):
|
||||
if command == 'show':
|
||||
config_set('countdown_visible', True)
|
||||
elif command == 'hide':
|
||||
config_set('countdown_visible', False)
|
||||
elif command == 'reset':
|
||||
config_set('countdown_control', 'reset')
|
||||
elif command == 'start':
|
||||
config_set('countdown_control', 'start')
|
||||
elif command == 'stop':
|
||||
config_set('countdown_control', 'stop')
|
||||
|
||||
if request.is_ajax():
|
||||
if command == "show":
|
||||
link = reverse('countdown_close')
|
||||
else:
|
||||
link = reverse('countdown_open')
|
||||
return ajax_request({'countdown_visible': config_get('countdown_visible'),
|
||||
'link': link})
|
||||
return redirect(reverse('item_overview'))
|
@ -130,7 +130,6 @@ INSTALLED_APPS = (
|
||||
'poll',
|
||||
'assignment',
|
||||
'utils',
|
||||
'beamer',
|
||||
)
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
|
@ -2,7 +2,7 @@ function presentation_reload() {
|
||||
if ($('#config > #ajax').html() == 'on') {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/beamer',
|
||||
url: '/beamer/',
|
||||
dataType: 'json',
|
||||
data: '',
|
||||
success: function(data) {
|
||||
|
@ -24,7 +24,6 @@ urlpatterns = patterns('',
|
||||
(r'', include('openslides.participant.urls')),
|
||||
(r'', include('openslides.assignment.urls')),
|
||||
(r'', include('openslides.system.urls')),
|
||||
(r'beamer', include('beamer.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