Skip to content

Commit

Permalink
Add "clear display" buttons to deck presenter view
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepman4267 committed Apr 27, 2024
1 parent cd5179c commit be6b964
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion OpenShow/slides/templates/slides/deck.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1>{{ deck.name }}</h1>
{# </div>#}
{# <hr>#}
<div id="display-selector">
<div>Displays:</div>
<div>Displays:
<ul>
{% for display in display_list %}
<li>
Expand All @@ -97,6 +97,13 @@ <h1>{{ deck.name }}</h1>
</li>
{% endfor %}
</ul>
Clear:
<ul>
{% for display in display_list %}
<button hx-get="{% url 'clear-slide' display.pk %}" hx-swap="none">Clear {{ display.name }}</button>
{% endfor %}
</ul>
</div>
</div>
</div>
{# <div class="slide-thumbnail">#}
Expand Down
5 changes: 5 additions & 0 deletions OpenShow/slides/templates/slides/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
send "grab-theme" to #slide-style
send "grab-slide" to #slide-grabber
end
on display-{{ display.pk }}-clear
getTransition()
make a <div.slide/>
put it at end of body
end
end
on animationend remove <.slide:not(:last-child)/> then send unlatch
</script>
Expand Down
1 change: 1 addition & 0 deletions OpenShow/slides/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
path('displays/<int:pk>', views.DisplayView.as_view(), name='display'),
path('displays/<int:pk>/style', views.DisplayView.as_view(template_name='slides/display_style.css'), name='display-style'),
path('displays/<int:pk>/transition', views.DisplayView.as_view(template_name='slides/transition.css'), name='display-transition'),
path('displays/<int:pk>/clear', views.clear_slide, name='clear-slide'),
path('show/<int:pk>', views.ShowView.as_view(), name='show'),
path('show/<int:pk>/advance_mode', views.AdvanceModeView.as_view(), name='advance-mode'),
path('show/<int:pk>/advance_loop', views.AdvanceLoopView.as_view(), name='advance-loop'),
Expand Down
7 changes: 7 additions & 0 deletions OpenShow/slides/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,10 @@ class AdvanceModeView(UpdateView):
class AdvanceLoopView(UpdateView): # TODO: Combine this and the above view, make this all one proper Django form
model = Show
fields = ['advance_loop']


def clear_slide(request, pk):
display = Display.objects.get(pk=pk)
send_event('test', f'display-{display.pk}-clear', f'clearing display {display.pk}')
return HttpResponse('OK')

0 comments on commit be6b964

Please sign in to comment.