2015-10-15 16:04:02 +00:00
|
|
|
{% if grav.twig.enable %}
|
2015-10-07 18:18:44 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
<h3>{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}</h3>
|
2015-10-06 17:23:02 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
<form name="{{ grav.config.plugins.comments.form.name }}"
|
|
|
|
action="{{ uri.rootUrl ~ (grav.config.plugins.comments.form.action|default(page.route)) }}"
|
|
|
|
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 %}
|
|
|
|
<div>
|
|
|
|
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
|
|
|
|
</div>
|
2015-10-13 21:39:13 +00:00
|
|
|
{% endfor %}
|
2015-10-06 17:23:02 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
<div class="buttons">
|
|
|
|
{% for button in grav.config.plugins.comments.form.buttons %}
|
|
|
|
<button class="button" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="alert">{{ form.message }}</div>
|
2015-10-13 21:39:13 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
{% if grav.twig.comments|length %}
|
2015-10-07 14:23:32 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
<h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>
|
2015-10-07 14:23:32 +00:00
|
|
|
|
2015-10-15 16:04:02 +00:00
|
|
|
<table>
|
|
|
|
{% for comment in grav.twig.comments|array_reverse %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{comment.text|e}}
|
|
|
|
<br />
|
|
|
|
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {{comment.author|e}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
2015-10-07 14:23:32 +00:00
|
|
|
{% endif %}
|