2017-10-25 00:58:07 +00:00
|
|
|
<form id="comments-form" name="{{ grav.config.plugins.comments.form.name }}" class="comments-form"
|
2017-10-19 16:53:40 +00:00
|
|
|
action="{{ grav.config.plugins.comments.form.action ? base_url ~ grav.config.plugins.comments.form.action : page.url }}"
|
|
|
|
method="{{ grav.config.plugins.comments.form.method|upper|default('POST') }}">
|
|
|
|
|
|
|
|
{% for field in grav.config.plugins.comments.form.fields %}
|
|
|
|
{% set value = form.value(field.name) %}
|
|
|
|
{% if field.evaluateDefault %}
|
|
|
|
{% set value = evaluate(field.evaluateDefault) %}
|
|
|
|
{% endif %}
|
|
|
|
{% if config.plugins.login.enabled and grav.user.authenticated %}
|
|
|
|
{% if field.name == 'name' %}
|
|
|
|
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{grav.user.fullname}}">
|
|
|
|
{% elseif field.name == 'email' %}
|
|
|
|
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{grav.user.email}}">
|
|
|
|
{% else %}
|
|
|
|
<div>
|
|
|
|
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<div>
|
|
|
|
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% include "forms/fields/formname/formname.html.twig" %}
|
|
|
|
|
|
|
|
<div class="buttons">
|
|
|
|
{% for button in grav.config.plugins.comments.form.buttons %}
|
|
|
|
<button class="button" type="{{ button.type|default('submit') }}">{{ button.value|t|default('Submit') }}</button>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
2017-10-23 11:39:31 +00:00
|
|
|
{{ nonce_field('comments', 'form-nonce')|raw }}
|
2017-10-19 16:53:40 +00:00
|
|
|
</form>
|
|
|
|
|
2017-10-25 00:58:07 +00:00
|
|
|
<div id="comments-alert" class="alert">{{ form.message }}</div>
|