{% extends 'layouts/admin.twig' %}

{% block content %}

    {% if success == true %}

        <h3>Your {{ section.title }} article section has been created.</h3>

        <br />

        <a href="/cms/admin/content_manager/?page={{ section.id }}"
            class="btn actionButton"
            target="_blank"
        >
            View in admin
        </a>

        <a href="{{ section.url }}"
            class="btn actionButton secondaryActionButton"
            target="_blank"
        >
            View {{ section.title }} on front end
        </a>

    {% else %}

        <form action="{{ self }}" method="post" class="style">

            <fieldset class="show">

                <h1>
                    <a class="show el">
                        Article Generator
                        <i class="fa fa-caret-down"></i>
                    </a>
                </h1>

                <div class="row">
                    <label for="sectionTitle">Parent page title</label>
                    <input type="text"
                        name="section_title"
                        value="News"
                        id="sectionTitle"
                    />
                </div>

                <div class="row">
                    <label for="numberOfArticles">Number of sample articles</label>
                    <input type="text"
                        name="number_of_articles"
                        value="0"
                        id="numberOfArticles"
                    />
                </div>

                <div class="row">
                    <input type="submit"
                        value="Generate"
                    />
                </div>

                <input type="hidden"
                    name="generate"
                    value="true"
                />

            </fieldset>

        </form>

    {% endif %}


{% endblock %}
