{% extends "two_column_body.html" %}
{% import "macros.html" as macros %}
{% block title %}{% filter trim %}{% trans %}Feedback{% endtrans %}{% endfilter %}{% endblock %}
{% block layout_class %}{{ super() }} feedback-page{% endblock %}
{% block content %}
  <h1>{% trans %}Give us your feedback!{% endtrans %}</h1>
  {% if form.errors %}
    <div class="error">
      {{form.errors.__all__}}
    </div>
  {%endif%}
  <form method="post" action="{{ url('feedback') }}" accept-charset="utf-8">{{ csrf_input }}
    <div>
      {{ settings.FEEDBACK_PAGE_MESSAGE|sub_vars(user)|convert_markdown }}
    </div>
    {% if user.is_anonymous %}
      <div>
        <label>{{form.name.label}}</label><br/>{{form.name}}
      </div>
      <div>
        <label>{{form.email.label}}
          {% if form.errors.email %}
            <span class='error'>{% trans %}(to hear from us please enter a valid email or check the box below){% endtrans %}</span>
          {% endif %}
        </label><br/>{{form.email}}
      </div>
      <div>
        <label>{{form.no_email.label}}
          {% if form.errors.no_email %}
            <span class="error">{% trans %}(this field is required){% endtrans %}</span>
          {% endif %}
          {{form.no_email}}
        </label>
      </div>
    {% endif %}
    <div>
      {% if form.errors.message %}
        <label>{{form.message.label}}
          <span class="error">{% trans %}(this field is required){% endtrans %}</span>
        </label>
        <br />
      {% endif %}
      {{form.message}}
    </div>
    {% if form.recaptcha %}
      <div class="row">
        {{ macros.form_field_with_errors(form.recaptcha) }}
      </div>
    {% endif %}
    {{form.next}}
    <div>
      <input class="btn" type="submit" value="{% trans %}Send Feedback{% endtrans %}"/>
      <input class="btn btn-muted" type="submit" name="cancel" value="{% trans %}Cancel{% endtrans %}"/>
    </div>
  </form>
{% endblock %}
