From ea415b399b5cef1260e846faa59bbe737eb081c6 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 15 Jan 2022 19:56:21 +1300 Subject: [PATCH] (Grav GitSync) Automatic Commit from dan --- plugins/comments/.gitignore | 1 + .../templates/en/partials/comments.html.twig | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 plugins/comments/.gitignore create mode 100755 themes/mytheme/templates/en/partials/comments.html.twig diff --git a/plugins/comments/.gitignore b/plugins/comments/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/plugins/comments/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/themes/mytheme/templates/en/partials/comments.html.twig b/themes/mytheme/templates/en/partials/comments.html.twig new file mode 100755 index 0000000..b1ff904 --- /dev/null +++ b/themes/mytheme/templates/en/partials/comments.html.twig @@ -0,0 +1,60 @@ +{% if enable_comments_plugin %} + {% set scope = scope ?: 'data.' %} + +

{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}

+ +
+ + {% 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' %} + + {% elseif field.name == 'email' %} + + {% else %} +
+ {% include "forms/fields/#{field.type}/#{field.type}.html.twig" %} +
+ {% endif %} + {% else %} +
+ {% include "forms/fields/#{field.type}/#{field.type}.html.twig" %} +
+ {% endif %} + {% endfor %} + {% include "forms/fields/formname/formname.html.twig" %} + +
+ {% for button in grav.config.plugins.comments.form.buttons %} + + {% endfor %} +
+ + {{ nonce_field('form', 'form-nonce')|raw }} +
+ +
{{ form.message }}
+ + {% if grav.twig.comments|length %} + +

{{'PLUGIN_COMMENTS.COMMENTS'|t}}

+ + + {% for comment in comments|array_reverse %} + + + + {% endfor %} +
+ {{comment.text}} +
+ {{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {{comment.author}} +
+ {% endif %} +{% endif %}