+ {% if display.current_slide %}
+ {% include 'slides/slide-thumbnail.html' with slide=object.current_slide %}
+ {% else %}
+ None
+ {% endif %}
+
+ Open this display (in a new tab)
+{% endblock %}
diff --git a/OpenShow/slides/editor/templates/editor/display/update.html b/OpenShow/slides/editor/templates/editor/display/update.html
new file mode 100644
index 0000000..4ff7409
--- /dev/null
+++ b/OpenShow/slides/editor/templates/editor/display/update.html
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/OpenShow/slides/editor/urls.py b/OpenShow/slides/editor/urls.py
index eb629e0..95cd69a 100644
--- a/OpenShow/slides/editor/urls.py
+++ b/OpenShow/slides/editor/urls.py
@@ -14,6 +14,7 @@
from slides.editor.views.utils import generate_lorem
from slides.editor.views.transition import TransitionEditorView, TransitionCreateView, TransitionKeyframeCreateView, \
TransitionKeyframeUpdateView, TransitionEditorIndexView
+from slides.editor.views.display import DisplayCreateView, DisplayDeleteView, DisplayUpdateView, DisplayDetailView
urlpatterns = [
@@ -51,4 +52,8 @@
path('transition/new', TransitionCreateView.as_view(), name='new-transition'),
path('transition/keyframe/new', TransitionKeyframeCreateView.as_view(), name='new-keyframe'),
path('transition/keyframe/', TransitionKeyframeUpdateView.as_view(), name='edit-keyframe'),
+ path('display/new', DisplayCreateView.as_view(), name='new-display'),
+ path('display/', DisplayDetailView.as_view(), name='display-detail'),
+ path('display//update', DisplayUpdateView.as_view(), name='update-display'),
+ path('display//delete', DisplayDeleteView.as_view(), name='delete-display'),
]
\ No newline at end of file
diff --git a/OpenShow/slides/editor/views/display.py b/OpenShow/slides/editor/views/display.py
new file mode 100644
index 0000000..9c5b901
--- /dev/null
+++ b/OpenShow/slides/editor/views/display.py
@@ -0,0 +1,36 @@
+from django.views.generic import CreateView, UpdateView, DeleteView, DetailView
+from slides.models import Display
+
+
+class DisplayDetailView(DetailView):
+ model = Display
+ template_name = 'editor/display/detail.html'
+ extra_context = {
+ 'previous_page': 'slides-index',
+ }
+
+
+class DisplayCreateView(CreateView):
+ model = Display
+ fields = [
+ 'name',
+ ]
+ template_name = 'editor/display/create.html'
+
+
+class DisplayUpdateView(UpdateView):
+ model = Display
+ fields = [
+ 'name',
+ # 'pixel_width',
+ # 'pixel_height',
+ # Changing these will break things right now; non-1080p resolutions are not supported. See #22.
+ 'custom_css',
+ # Display.custom_css might go away to be replaced by theme display variants.
+ ]
+ template_name = 'editor/display/update.html'
+
+
+class DisplayDeleteView(DeleteView):
+ model = Display
+ template_name = 'editor/display/delete.html'
\ No newline at end of file
diff --git a/OpenShow/slides/models.py b/OpenShow/slides/models.py
index 3dc0f4c..f9ed610 100644
--- a/OpenShow/slides/models.py
+++ b/OpenShow/slides/models.py
@@ -137,6 +137,9 @@ def __str__(self):
# TODO: The Display should probably know the current segment, as well as the current show.
# auto_advance_paused = models.BooleanField(default=False, null=False)
+ def get_absolute_url(self):
+ return reverse('display-detail', kwargs={'pk': self.pk})
+
class Deck(models.Model): # A Reusable set of slides, which can be included in a Show Segment
name = models.CharField(max_length=100)
diff --git a/OpenShow/slides/templates/slides/index.html b/OpenShow/slides/templates/slides/index.html
index 5ab0e65..47aff42 100644
--- a/OpenShow/slides/templates/slides/index.html
+++ b/OpenShow/slides/templates/slides/index.html
@@ -82,8 +82,18 @@
Themes
Displays
- Displays can be configured to have the correct resolution, and set custom CSS. Editor not yet implemented.
+ Displays can be configured to have the correct resolution, and set custom CSS.