]> git.aero2k.de Git - sirius.git/commitdiff
ability to type HTML on the front-end
authorMatt Webb <matt@interconnected.org>
Sat, 27 Sep 2014 09:10:58 +0000 (10:10 +0100)
committerMatt Webb <matt@interconnected.org>
Sat, 27 Sep 2014 09:10:58 +0000 (10:10 +0100)
app/main/__init__.py

index 63943a7baf5753adf052e4286a0e8636c628a8d4..a446a3de3c7b282d1eed6aaf7308b0424ccda784 100644 (file)
@@ -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 = """<html><body><h1>Hello, World!</h1><p>My name is Little Printer</p></html>"""
+               #html = """<html><body><h1>Hello, World!</h1><p>My name is Little Printer</p></html>"""
                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)