{% if not request.is_xhr %} {% endif %}
{% if not Config.get('comments', 'requires_login') or current_user.is_authenticated() %}
{% for field in form %} {% if field.type in ['CSRFTokenField', 'HiddenField'] %} {{ field() }} {% endif %} {% endfor %}
{% if current_user.is_authenticated() %} {{form.author_name(value=current_user.name, type="hidden")}}

{{current_user.name}}

{% else %} {{form.author_name(class="form-control", placeholder="your name", required="required")}} {% endif %}
{% if current_user.is_authenticated() %} {{form.author_email(value=current_user.email, type="hidden")}}

{{current_user.email}}

{% else %} {{form.author_email(class="form-control", placeholder="you@domain.com", required="required", type="email")}} {% endif %}
{{form.body(class="form-control", rows="3")}}
{% else %} Login to add a comment {% endif %}