Skip to content

Commit

Permalink
added: initial very alpha version
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Apr 26, 2019
1 parent bbb645e commit eccbfba
Show file tree
Hide file tree
Showing 23 changed files with 3,609 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# files of Composer dependencies that are not needed for the plugin
/vendor/**/.*
/vendor/**/*.json
/vendor/**/*.txt
/vendor/**/*.md
/vendor/**/*.yml
/vendor/**/*.yaml
/vendor/**/*.xml
/vendor/**/*.dist
/vendor/**/readme.php
/vendor/**/LICENSE
/vendor/**/COPYING
/vendor/**/VERSION
/vendor/**/docs/*
/vendor/**/example/*
/vendor/**/examples/*
/vendor/**/test/*
/vendor/**/tests/*
/vendor/**/php4/*
/vendor/getkirby/composer-installer
/vendor/doctrine
/vendor/myclabs
/vendor/phar-io
/vendor/phpdocumentor
/vendor/phpspec
/vendor/phpunit
/vendor/sebastian
/vendor/symfony
/vendor/theseer
/vendor/webmozart
10 changes: 10 additions & 0 deletions assets/komments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function replyToComment(self) {
document.querySelector('.komment-reply-indicator .komment-gravatar').innerHTML = '<img src="https://www.gravatar.com/avatar/' + self.dataset.gravatar + '?s=100" alt="gravatar">';
document.querySelector('.komment-reply-indicator .komment-author').innerHTML = '@' + self.dataset.author;
document.querySelector('#replyTo').value = self.dataset.slug;
}

window.onload = function () {
[...document.querySelectorAll('.komment-reply')]
.forEach(a => { a.onclick = function() { replyToComment(this) }; });
};
20 changes: 20 additions & 0 deletions blueprints/pages/komment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
label: Komment
icon: quote
columns:
- width: 2/3
sections:
komment:
type: fields
fields:
text:
type: textarea
size: medium
email:
type: email
width: 1/3
author:
type: text
width: 1/3
replyTo:
type: hidden

4 changes: 4 additions & 0 deletions blueprints/pages/komments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: Komments
tabs:
komments:
extends: tabs/komments
26 changes: 26 additions & 0 deletions blueprints/tabs/komments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
label: Komments
icon: quote
columns:
- width: 1/2
sections:
published:
type: pages
headline: Veröffentlicht
status: published
info: " {{ page.date.toDate('Y-m-d') }}"
size: small
sortBy: date desc
parent: page.find("komments")
text: "{{ page.author }}: {{ page.title }}"
empty: No public komments
- width: 1/2
sections:
drafts:
type: pages
headline: Awaiting moderation
status: draft
parent: page.find("komments")
sortBy: date desc
text: "{{ page.author }}: {{ page.title }}"
empty: No waiting komments
info: " {{ page.date.toDate('Y-m-d') }}"
15 changes: 15 additions & 0 deletions blueprints/users/komments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: Komments
description: This user can create komments
permissions:
access: false
files: false
page:
changeSlug: false
changeStatus: true
changeTemplate: false
changeTitle: false
create: true
delete: false
preview: false
update: false
users: false
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "mauricerenck/komments",
"description": "A comment plugin for Kirby 3",
"type": "kirby-plugin",
"license": "MIT",
"authors": [
{
"name": "Maurice Renck",
"email": "[email protected]"
}
],
"version": "0.0.1",
"autoload": {
"files": [
"utils/readKomments.php",
"utils/writeKomments.php"
]
},
"require": {
"getkirby/composer-installer": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^7.2"
}
}
Loading

0 comments on commit eccbfba

Please sign in to comment.