-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<form method="post" action="{% url 'new-display' %}"> | ||
{% csrf_token %} | ||
{{ form }} | ||
<button type="submit">Submit</button> | ||
</form> |
Empty file.
38 changes: 38 additions & 0 deletions
38
OpenShow/slides/editor/templates/editor/display/detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% extends 'core/base.html' %} | ||
{% load icon %} | ||
{% load static %} | ||
|
||
{% block extra_css %} | ||
<link rel="stylesheet" href="{% static 'slides/slide-thumbnail.css' %}"> | ||
<style>body {--display-size-divisor: 3} .slide-thumbnail:hover{box-shadow: none}</style> | ||
{% endblock %} | ||
|
||
{% block header %} | ||
<h1>{{ object.name }}</h1> | ||
{% endblock %} | ||
|
||
{% block title %}Editing {{ object.name }} - OpenShow{% endblock %} | ||
|
||
{% block header_right_button %} | ||
<a | ||
hx-get="{% url 'update-display' object.pk %}" | ||
hx-target="<main/>" | ||
hx-swap="innerHTML" | ||
class="icon-button" | ||
aria-label="Edit {{ object.name }}" | ||
> | ||
{% icon 'edit-2' %} | ||
</a> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h2>Current Slide</h2> | ||
<div> | ||
{% if display.current_slide %} | ||
{% include 'slides/slide-thumbnail.html' with slide=object.current_slide %} | ||
{% else %} | ||
None | ||
{% endif %} | ||
</div> | ||
<a href="{% url 'display' object.pk %}" target="_blank">Open this display (in a new tab)</a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<form method="post" action="{% url 'update-display' object.pk %}"> | ||
{% csrf_token %} | ||
{{ form }} | ||
<button type="submit">Submit</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters