Store page name in the comments file

This commit is contained in:
Flavio Copes 2015-10-07 15:43:16 +02:00
parent c18914d3e3
commit 5fd4cd6ac5
2 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,7 @@ class CommentsPlugin extends Plugin
]; ];
} else { } else {
$data = array( $data = array(
'name' => $post['name'],
'comments' => array([ 'comments' => array([
'text' => $post['text'], 'text' => $post['text'],
'date' => gmdate('D, d M Y H:i:s', time()), 'date' => gmdate('D, d M Y H:i:s', time()),

View File

@ -9,6 +9,7 @@ jQuery(document).on('click tap', '.js__add-new-comment', function(event) {
text: $('.js__new-comment-text').val(), text: $('.js__new-comment-text').val(),
name: $('.js__new-comment-name').val(), name: $('.js__new-comment-name').val(),
email: $('.js__new-comment-email').val(), email: $('.js__new-comment-email').val(),
name: "{{ grav.page.header.title }}"
path: "{{ grav.uri.path }}" path: "{{ grav.uri.path }}"
}, },
type: 'POST' type: 'POST'