Merge branch 'release/1.2.7'

This commit is contained in:
Flavio Copes 2017-05-12 14:55:52 +02:00
commit 04a2e6460f
6 changed files with 41 additions and 8 deletions

View File

@ -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

View File

@ -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:

View File

@ -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);

View File

@ -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

View File

@ -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: '<p>新しいコメントが%1$sについて%3$sから(%4$s)書かれた.</p><p>ページー : %2$s</p><p>文書 : %5$s</p>'
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

View File

@ -1,4 +1,5 @@
{% if grav.twig.enable_comments_plugin %}
{% set scope = scope ?: 'data.' %}
<h3>{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}</h3>
@ -13,9 +14,9 @@
{% endif %}
{% if config.plugins.login.enabled and grav.user.authenticated %}
{% if field.name == 'name' %}
<input type="hidden" name="{{field.name}}" value="{{grav.user.fullname}}">
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{grav.user.fullname}}">
{% elseif field.name == 'email' %}
<input type="hidden" name="{{field.name}}" value="{{grav.user.email}}">
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{grav.user.email}}">
{% else %}
<div>
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}