diff --git a/CHANGELOG.md b/CHANGELOG.md index f72cf4e..f2d5015 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,18 @@ +# v1.2.7 +## 05/12/2017 + +1. [](#improved) + * Added Japanese translation + * Move captcha over email [#45](https://github.com/getgrav/grav-plugin-comments/issues/45) +1. [](#bugfix) + * Fix comment form processing + * Fix issue with scope for autofilled values + # v1.2.6 ## 01/09/2017 1. [](#improved) - Use existing `Utils::startsWith()` method + * Use existing `Utils::startsWith()` method 1. [](#bugfix) * Fix [#41](https://github.com/getgrav/grav-plugin-comments/issues/41) using Comments in a Gantry-powered theme did not escape the comment form token correctly diff --git a/blueprints.yaml b/blueprints.yaml index 4de7704..1daf30b 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Comments -version: 1.2.6 +version: 1.2.7 description: Adds a commenting functionality to your site icon: comment author: diff --git a/comments.php b/comments.php index c6ee298..7a59543 100644 --- a/comments.php +++ b/comments.php @@ -187,7 +187,7 @@ class CommentsPlugin extends Plugin switch ($action) { case 'addComment': - $post = !empty($_POST) ? $_POST : []; + $post = isset($_POST['data']) ? $_POST['data'] : []; $lang = filter_var(urldecode($post['lang']), FILTER_SANITIZE_STRING); $path = filter_var(urldecode($post['path']), FILTER_SANITIZE_STRING); diff --git a/comments.yaml b/comments.yaml index 05a16eb..5c09966 100644 --- a/comments.yaml +++ b/comments.yaml @@ -53,7 +53,7 @@ form: # - name: g-recaptcha-response # label: Captcha # type: captcha -# recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3 +# recaptcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3 # recaptcha_not_validated: 'Captcha not valid!' # validate: # required: true @@ -65,11 +65,11 @@ form: value: PLUGIN_COMMENTS.SUBMIT_COMMENT_BUTTON_TEXT process: +# - captcha: +# recaptcha_secret: ej32oiej23oiej32oijeoi32jeio32je - email: subject: PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT body: "{% include 'forms/data.html.twig' %}" -# - captcha: -# recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je - addComment: - message: PLUGIN_COMMENTS.THANK_YOU_MESSAGE - reset: true diff --git a/languages.yaml b/languages.yaml index 61cc568..812f22d 100644 --- a/languages.yaml +++ b/languages.yaml @@ -130,6 +130,28 @@ it: EMAIL_NEW_COMMENT_SUBJECT: "[Nuovo commento] da {{ form.value.name|e }}" THANK_YOU_MESSAGE: "Grazie per il tuo commento!" +ja: + PLUGIN_COMMENTS: + ADD_COMMENT: コメントを追加する + COMMENTS: コメント + EMAIL_NOT_CONFIGURED: メールアドレスは設定さていません + NEW_COMMENT_EMAIL_SUBJECT: '%1$sについて新しいコメント' + NEW_COMMENT_EMAIL_BODY: '

新しいコメントが%1$sについて%3$sから(%4$s)書かれた.

ページー : %2$s

文書 : %5$s

' + EMAIL_FOOTER: '' + NAME: 名前 : + EMAIL: メールアドレス : + WRITTEN_ON: に書かれた + BY: に + NAME_LABEL: "名前" + NAME_PLACEHOLDER: "お名前を" + EMAIL_LABEL: "メールアドレスを" + EMAIL_PLACEHOLDER: "ご自分のメールアドレスをここに..." + MESSAGE_LABEL: "コメント" + MESSAGE_PLACEHOLDER: "コメントをここに" + SUBMIT_COMMENT_BUTTON_TEXT: "送信する" + EMAIL_NEW_COMMENT_SUBJECT: "[新しいコメント]、 {{ form.value.name|e }}から" + THANK_YOU_MESSAGE: "コメントを書いてくださいましてありがとうございました!" + pl: PLUGIN_COMMENTS: ADD_COMMENT: Dodaj komentarz diff --git a/templates/partials/comments.html.twig b/templates/partials/comments.html.twig index 7528223..29d79b9 100644 --- a/templates/partials/comments.html.twig +++ b/templates/partials/comments.html.twig @@ -1,4 +1,5 @@ {% if grav.twig.enable_comments_plugin %} + {% set scope = scope ?: 'data.' %}

{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}

@@ -13,9 +14,9 @@ {% 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" %}