{% extends '@Socializr/app.twig' %}

{% block content %}
    <form action="" method="post">
        <div class="form-row">
            <label for="title">Title:</label>
            <input id="title" type="text" value="{{ values.title }}" name="title" required>
            <label class="error">{{ errors.title }}</label>
        </div>

        <div class="form-row">
            <label for="slug">Handle:</label>
            <input id="slug" type="text" value="{{ values.slug }}" name="slug">
            <label class="error">{{ errors.slug }}</label>
        </div>

        <div class="form-row">
            <label for="url">Url:</label>
            {% raw %}
            <p>The following handles can be used to add dynamic content into the url.</p>
            <table class="wp-list-table widefat fixed striped posts mb">
                <thead>
                    <th>Handle</th>
                    <th>Return Value</th>
                </thead>
                <tbody>
                    <tr>
                        <td>{{ blog_url }}</td>
                        <td>Return the blog home url</td>
                    </tr>

                    <tr>
                        <td>{{ blog_title }}</td>
                        <td>Return the blog title</td>
                    </tr>

                    <tr>
                        <td>{{ current_url }}</td>
                        <td>Returns the current page url</td>
                    </tr>

                    <tr>
                        <td>{{ current_title }}</td>
                        <td>Return the current post/page title.</td>
                    </tr>
                </tbody>
            </table>
            {% endraw %}
            <input id="url" type="url" value="{{ values.url }}" name="url" required>
            <label class="error">{{ errors.url }}</label>
        </div>

        <div class="form-row">
            <input class="button button-primary" type="submit" name="submit" value="Edit Custom Link">
            <div class="row-actions" style="visibility:visible !important; margin-left: 15px; margin-top: 5px; display: inline-block; vertical-align: middle;">
            <span class="trash">
                <a class="submitdelete" href="{{ delete_url }}">Delete This Social Set</a>
            </span>
        </div>
    </form>
{% endblock %}
