Merge branch 'release/1.1.3'

This commit is contained in:
Andy Miller 2016-01-06 12:36:53 -07:00
commit 47ee19d48b
5 changed files with 32 additions and 17 deletions

View File

@ -1,3 +1,17 @@
# v1.1.3
## 01/06/2016
1. [](#improved)
* Disable captcha by default, added instructions on how to enable it
1. [](#bugfix)
* Increase priority for onPageInitialized in the comments plugin over the form plugin one to prevent an issue when saving comments
# v1.1.2
## 12/11/2015
1. [](#improved)
Fix double escaping comments text and author
# v1.1.1 # v1.1.1
## 12/11/2015 ## 12/11/2015

View File

@ -16,8 +16,6 @@ Or clone from GitHub and put in the `user/plugins/comments` folder.
# Usage # Usage
Edit the
Add `{% include 'partials/comments.html.twig' with {'page': page} %}` to the template file where you want to add comments. Add `{% include 'partials/comments.html.twig' with {'page': page} %}` to the template file where you want to add comments.
For example, in Antimatter, in `templates/item.html.twig`: For example, in Antimatter, in `templates/item.html.twig`:
@ -49,9 +47,12 @@ The comment form will appear on the blog post items matching the enabled routes.
To set the enabled routes, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and edit the `enable_on_routes` and `disable_on_routes` options according to your needs. To set the enabled routes, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and edit the `enable_on_routes` and `disable_on_routes` options according to your needs.
> Make sure you configured the "Email from" and "Email to" email addresses in the Email plugin with your email address!
# Enabling Recaptcha # Enabling Recaptcha
The plugin comes with Recaptcha integration. To make it work, add your own Recaptcha `site` and `secret` keys the the plugin yaml config file. The plugin comes with Recaptcha integration. To make it work, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and uncomment the capthca form field and the captcha validation process.
Make sure you add your own Recaptcha `site` and `secret` keys too.
# Where are the comments stored? # Where are the comments stored?

View File

@ -1,5 +1,5 @@
name: Comments name: Comments
version: 1.1.1 version: 1.1.3
description: Adds a commenting functionality to your site description: Adds a commenting functionality to your site
icon: comment icon: comment
author: author:

View File

@ -26,7 +26,7 @@ class CommentsPlugin extends Plugin
return [ return [
'onPluginsInitialized' => ['onPluginsInitialized', 0], 'onPluginsInitialized' => ['onPluginsInitialized', 0],
'onFormProcessed' => ['onFormProcessed', 0], 'onFormProcessed' => ['onFormProcessed', 0],
'onPageInitialized' => ['onPageInitialized', 0], 'onPageInitialized' => ['onPageInitialized', 10],
'onTwigSiteVariables' => ['onTwigSiteVariables', 0] 'onTwigSiteVariables' => ['onTwigSiteVariables', 0]
]; ];
} }

View File

@ -50,15 +50,15 @@ form:
type: hidden type: hidden
evaluateDefault: grav.uri.path evaluateDefault: grav.uri.path
- name: g-recaptcha-response # - name: g-recaptcha-response
label: Captcha # label: Captcha
type: captcha # type: captcha
recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3 # recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3
recaptcha_not_validated: 'Captcha not valid!' # recaptcha_not_validated: 'Captcha not valid!'
validate: # validate:
required: true # required: true
process: # process:
ignore: true # ignore: true
buttons: buttons:
- type: submit - type: submit
@ -68,8 +68,8 @@ form:
- email: - email:
subject: "[New Comment] from {{ form.value.name|e }}" subject: "[New Comment] from {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}" body: "{% include 'forms/data.html.twig' %}"
- captcha: # - captcha:
recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je # recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je
- addComment: - addComment:
- message: Thank you for writing your comment! - message: Thank you for writing your comment!