{% import 'macros/form.html' as form %}

<section class="module module-narrow tweet">
    {% block edit_tweet_title %}
        <h2 class="module-heading">
            <i class="fab fa-twitter inline-icon-left"></i>{{ _('Tweet this?') }}
        </h2>
    {% endblock %}
    {% block edit_tweet_nav %}
    <ul class="nav nav-simple">
        <li class="nav-item">
            {% block edit_tweet_form %}
            <form class="form-horizontal" id="edit-tweet-form">
                {% set data = {'tweet_text': tweet} %} {% set results = {} %} {% set errors = {} %} {%
                set error_summary = {} %}
                {% if disable_edit == "true" or disable_edit == "True" %}
                {% set extra_attrs = {'readonly':'true'} %}
                {% else %}
                {% set extra_attrs = {'maxlength': 140} %}
                {% endif %}
                {{ form.textarea('tweet_text', label=_('Tweet text'), id='field-tweet',
                value=data.tweet_text,
                error=errors.tweet_text, is_required=true, attrs=extra_attrs) }}
                <div class="form-actions">
                    {{ form.required_message() }}
                    <button class="btn btn-primary save" type="submit"
                            id="edit-tweet-save">{{ _('Yes') }}
                    </button>
                    <button class="btn btn-danger cancel" type="button"
                            id="edit-tweet-cancel">{{ _('No') }}
                    </button>
                </div>
            </form>
            {% endblock %}
        </li>
    </ul>
    {% endblock %}
</section>
