{% extends "layout.html" %}
{% block content %}

<div>
    <div class="mb-3">Document Number {{ data['number'] }} </div>
    <form method="post">
        {% for d in data.keys() %}
        {% if d in hide_keys %}
        <input type="hidden" name="{{ d }}" value="{{ data[d] }}">
        {% else %}
        {% if d in ['hide', 'spread', 'r2l'] %}
        <div class="mb-3">
            <input class="form-check-input" type="checkbox" id="{{ d }}" name="{{ d }}" {{ "checked" if data[d]==1 }} />
            <label class="form-check-label" for="{{ d }}">
                {{ d }}
            </label>
        </div>
        {% else %}
        <div class="mb-3">
            <label class="form-label">{{ d }}</label>
            <input class="form-control" type="text" id="{{ d }}" value="{{ data[d] }}" name="{{ d }}" />
        </div>
        {% endif %}
        {% endif %}
        {% endfor %}
        <button type="submit" class="btn btn-primary" accesskey="s">Submit</button>
    </form>
</div>

<div class="mt-3">
    <form method="post" action="/remove">
        <input type="hidden" name="number" value="{{ data['number'] }}">
        <button type="submit" class="btn btn-danger" onClick="return window.confirm('Are you sure?')">Remove</button>
    </form>
</div>
{% endblock %}