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