{% block content %}
<script type="text/javascript">
    function printImg(source) {
        var win = window.open('');
        win.document.write('<img src="' + source + '" onload="window.print();window.close()" />');
        win.focus();
    }
</script>
<div class="panel panel-default">
    <div class="panel-heading">
        <strong>QR Code</strong>
        <div class="pull-right">
            {% if with_text %}
            <div class="btn-group btn-group-xs" role="group">
                <a href="?with_text=true&text_below=true" class="btn btn-default{% if text_below %} active {% endif %}">Text below</a>
                <a href="?with_text=true" class="btn btn-default{% if not text_below %} active {% endif %}">Text right</a>
            </div>
            {% endif %}
            <div class="btn-group btn-group-xs" role="group">
                <a href="?with_text=true" class="btn btn-default{% if with_text %} active {% endif %}">With Text</a>
                <a href="?with_text=false" class="btn btn-default{% if not with_text %} active {% endif %}">Without Text</a>
            </div>
        </div>
    </div>
    <div class="panel-body">
        
        <span class="text-muted"><img src="{{qr}}"></span>
        
    </div>
    <div class="panel-footer text-right noprint">
        <button onclick="printImg('{{qr}}')" ; class="btn btn-xs btn-primary">
            <span class="glyphicon glyphicon-print" aria-hidden="true"></span> Print
        </button>
    </div>
</div>
{% endblock %}
