#92 preview for slides
This commit is contained in:
parent
6798050ded
commit
49e2f73df4
@ -7,6 +7,7 @@
|
||||
<a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}">
|
||||
<div></div>
|
||||
</a>
|
||||
<a href="{% url projctor_preview_slide slide.sid %}">preview</a>
|
||||
{% for p in slide.get_ancestors %}
|
||||
<span class="indentation"> </span>
|
||||
{% endfor %}
|
||||
|
@ -88,8 +88,6 @@ def default_config(sender, key, **kwargs):
|
||||
}.get(key)
|
||||
|
||||
|
||||
|
||||
|
||||
from django.dispatch import receiver
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.importlib import import_module
|
||||
|
@ -14,7 +14,7 @@ def split_sid(sid):
|
||||
return (model, id)
|
||||
if len(data) == 1:
|
||||
try:
|
||||
return (SLIDE[data[0]].func(), None)
|
||||
return (SLIDE[data[0]].key, None)
|
||||
except KeyError:
|
||||
return None
|
||||
return None
|
||||
|
@ -6,6 +6,7 @@
|
||||
<a href="{% url projector_activate_slide slides.key %}" class="activate_link {% if slides.active %}active{% endif %}">
|
||||
<div></div>
|
||||
</a>
|
||||
<a href="{% url projctor_preview_slide slides.key %}">preview</a>
|
||||
{{ slides.name }}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}">
|
||||
<div></div>
|
||||
</a>
|
||||
<a href="{% url projctor_preview_slide slide.sid %}">preview</a>
|
||||
<a href="{{ slide.get_absolute_url }}">{{ slide }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -21,9 +21,16 @@ from models import ProjectorSlide
|
||||
|
||||
urlpatterns = patterns('projector.views',
|
||||
url(r'^$', 'active_slide',
|
||||
name='projector_show'),
|
||||
{'sid': None},
|
||||
name='projector_show',
|
||||
),
|
||||
|
||||
url(r'^control$',
|
||||
url(r'^preview/(?P<sid>[^/]*)/$',
|
||||
'active_slide',
|
||||
name='projctor_preview_slide',
|
||||
),
|
||||
|
||||
url(r'^control/$',
|
||||
ControlView.as_view(),
|
||||
name='projector_control',
|
||||
),
|
||||
|
@ -30,7 +30,7 @@ from utils.template import Tab
|
||||
|
||||
from config.models import config
|
||||
|
||||
from api import get_active_slide, set_active_slide, projector_message_set, projector_message_delete
|
||||
from api import get_active_slide, set_active_slide, projector_message_set, projector_message_delete, get_slide_from_sid
|
||||
from projector import SLIDE
|
||||
from models import ProjectorOverlay
|
||||
from openslides.projector.signals import projector_overlays, projector_control_box
|
||||
@ -112,22 +112,25 @@ class ActivateView(RedirectView):
|
||||
|
||||
|
||||
@permission_required('projector.can_see_projector')
|
||||
def active_slide(request):
|
||||
def active_slide(request, sid=None):
|
||||
"""
|
||||
Shows the active Slide.
|
||||
"""
|
||||
try:
|
||||
data = get_active_slide()
|
||||
except AttributeError: #TODO: It has to be an Slide.DoesNotExist
|
||||
data = None
|
||||
if sid is None:
|
||||
try:
|
||||
data = get_active_slide()
|
||||
except AttributeError: #TODO: It has to be an Slide.DoesNotExist
|
||||
data = None
|
||||
data['ajax'] = 'on'
|
||||
else:
|
||||
data = get_slide_from_sid(sid)
|
||||
data['ajax'] = 'off'
|
||||
|
||||
if data is None:
|
||||
data = {
|
||||
'title': config['event_name'],
|
||||
'template': 'projector/default.html',
|
||||
}
|
||||
|
||||
data['ajax'] = 'on'
|
||||
data['overlays'] = []
|
||||
data['overlay'] = ''
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user