From: Matt Webb Date: Sat, 27 Sep 2014 09:10:58 +0000 (+0100) Subject: ability to type HTML on the front-end X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=f1ab81f247682ba24e066275c9a048fb0b8e2a05;p=sirius.git ability to type HTML on the front-end --- diff --git a/app/main/__init__.py b/app/main/__init__.py index 63943a7..a446a3d 100644 --- a/app/main/__init__.py +++ b/app/main/__init__.py @@ -11,6 +11,7 @@ import pprint main = Blueprint('main', __name__) class SendDeliveryForm(Form): + html = TextAreaField(u'HTML to render') submit = SubmitField('Send Delivery') @main.route('/') @@ -26,10 +27,10 @@ def device(device_address): sender = current_app.sender if form.validate_on_submit(): - html = """

Hello, World!

My name is Little Printer

""" + #html = """

Hello, World!

My name is Little Printer

""" flash('Form submitted') q = sender.for_device(device) if q is not None: - dc = set_delivery_and_print(device.device_address, html=html) + dc = set_delivery_and_print(device.device_address, html=form.html.data) q.queue_device_command(dc) return render_template('dump.html', dump=pprint.pformat(device), form=form)