clean button for message

This commit is contained in:
Oskar Hahn 2012-04-16 16:38:47 +02:00
parent 534a81c46c
commit 7d16717ca8
2 changed files with 4 additions and 1 deletions

View File

@ -42,6 +42,7 @@
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
<input name='message_text' type='text' value="{% get_config 'projector_message' %}"> <input name='message_text' type='text' value="{% get_config 'projector_message' %}">
<button type="submit" class="button" name='message'><span class="icon ok">{% trans 'Save' %}</span></button> <button type="submit" class="button" name='message'><span class="icon ok">{% trans 'Save' %}</span></button>
<button type="submit" class="button" name='message-clean'><span class="icon cancel">{% trans 'Clean' %}</span></button>
</form> </form>
<div style="text-align: right; padding: 0 10px 5px 0; margin-top:-20px;"> <div style="text-align: right; padding: 0 10px 5px 0; margin-top:-20px;">
<!-- projector control --> <!-- projector control -->

View File

@ -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 from api import get_active_slide, set_active_slide, projector_message_set, projector_message_delete
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
@ -59,6 +59,8 @@ class ControlView(TemplateView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if 'message' in request.POST: if 'message' in request.POST:
projector_message_set(request.POST['message_text']) projector_message_set(request.POST['message_text'])
elif 'message-clean' in request.POST:
projector_message_delete()
else: else:
for overlay in self.get_projector_overlays(): for overlay in self.get_projector_overlays():
if overlay.def_name in request.POST: if overlay.def_name in request.POST: