{% extends "base.html" %}
{% block title %}UNL 2 RDF demo{% endblock %}
{% block content %}
{% if not unl %}
<div class="form-group">
    <form action="{{request.path}}" method="POST">
        <h2>Enter some UNL here I will convert it for you</h2>
        <textarea class="form-control" name="unl" cols="80" rows="10" style="width: 300px; height: 150px;"></textarea>
        <h2>Tell me which output(s) you want</h2>
        <ul>
            <li><label><input type="checkbox" name="outputs" value="rdf" checked>RDF</label></li>
            <li><label><input type="checkbox" name="outputs" value="dot" checked>Graph (dot)</label></li>
        </ul>
        <button class="btn btn-primary" type="submit">Submit</button>
    </form>
</div>
{% else %}
    <h2> UNL </h2>
    <pre>
        <code>
            {{ unl }}
        </code>
    </pre>

    {% if output['dot'] %}
        <h2> Unl graph </h2>
        {{ output['dot'] }}
    {% endif %}

    {% if output['rdf'] %}
        <h2> RDF </h2>
        <pre>
            <code>
                {{ output['rdf'] }}
            </code>
        </pre>
    {% endif %}

{% endif %}
{% endblock %}