Skip to content

Commit

Permalink
Feature/kirby 3 6 (#23)
Browse files Browse the repository at this point in the history
* chore: kirby 3.6 alpha

* chore: updated setup

* feat: new panel moderation view

* fix: removed dublicate from blueprint

* chore: editor configs

* improvement: moderation view

* chore: new comment listing

* improvement: backward compatibility to k3.5
  • Loading branch information
mauricerenck authored Oct 29, 2021
1 parent b5db28b commit 9703324
Show file tree
Hide file tree
Showing 436 changed files with 2,703 additions and 8,590 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[*.{css,scss,less,js,json,ts,sass,html,hbs,mustache,phtml,html.twig,md,yml}]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_size = 4
trim_trailing_whitespace = false

[site/templates/**.php]
indent_size = 2

[site/snippets/**.php]
indent_size = 2

[package.json,.{babelrc,editorconfig,eslintrc,lintstagedrc,stylelintrc}]
indent_style = space
indent_size = 2
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"endOfLine": "lf",
"semi": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "es5",
"eslintIntegration": false,
"tslintIntegration": true,
"printWidth": 120,
"tslint.packageManager": "yarn",
"npm.packageManager": "yarn",
"prettier.tslintIntegration": true
}
55 changes: 39 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
# Komments
# Komments

![GitHub release](https://img.shields.io/github/release/mauricerenck/komments.svg?maxAge=1800) ![License](https://img.shields.io/github/license/mashape/apistatus.svg) ![Kirby Version](https://img.shields.io/badge/Kirby-3.3%2B-black.svg)
![GitHub release](https://img.shields.io/github/release/mauricerenck/komments.svg?maxAge=1800) ![License](https://img.shields.io/github/license/mashape/apistatus.svg) ![Kirby Version](https://img.shields.io/badge/Kirby-3.5%2B-black.svg)

---

## Roadmap

- [x] New Panel View for moderation
- [x] Mark comment as spam
- [x] Mark comment as verified
- [x] Delete comment
- [ ] Reply from within panel
- [x] Pending comments field
- [ ] Comments list on page level
- [ ] Switch to KirbyUp
- [ ] Move "send to mastodon" to IndieConnector
- [ ] Move "ping archive.org" to IndieConnector
- [ ] Move "send webmentions" to IndieConnector
- [ ] Mark webmentions from known users as verified

---

A Kirby comment plugin

There is an update for Kirby 3.6 in the making [here](https://github.com/mauricerenck/komments/tree/feature/kirby-3-6)

## Features

- Receive comments from a form on your site
- Receive comments from a form on your site
- The user will be informed that the komment is in moderation
- Spam detection
- Reject spam or just mark komments as spam
- ✅ Receive and send webmentions
- ✅ Send updates to Mastodon
- ✅ Ping archive.org
- ✅ Panel support
- Receive
- Panel support
- Dashboard for komments in moderation/spam
- Moderate komments on your page
- Disable/enable komments per page
- ✅ Disable komments after a certain number of dates in relation to the publish date
- ✅ Reply to comments
- ✅ Verified badge for logged in users
- Disable komments after a certain number of dates in relation to the publish date
- Reply to comments
- Verified badge for logged in users

## Deprecated

- Send webmentions
- Send updates to Mastodon
- Ping archive.org

**As of version 0.10.0 the split view is the default view** The mixed view is deprecated due to the new nested comments functionality.

Expand Down Expand Up @@ -110,11 +133,11 @@ You can fine tune the komments to behave as you whish, use this options in `conf
| `auto-delete-spam` | `true` | When comment spam is detected it will be rejected, set to false to just mark the comment as SPAM |
| `auto-disable-komments` | `0` | Disables the komment form after `n` number of days. Use `0` to never disable komments (default) |
| `auto-disable-komments-datefield` | `'date'` | Set a field to function as publish date field used for `auto-disable-komments` |
| `komment-icon-like` | '❤️' | The icon for likes in your komment list |
| `komment-icon-reply` | '💬' | The icon for replies/comments in your komment list |
| `komment-icon-repost` | '♻️' | The icon for reposts in your komment list |
| `komment-icon-mention` | '♻️' | The icon for mention in your komment list |
| `komment-icon-verified` | '✅' | The icon for the verify badge list |
| `komment-icon-like` | '❤️' | The icon for likes in your komment list |
| `komment-icon-reply` | '💬' | The icon for replies/comments in your komment list |
| `komment-icon-repost` | '♻️' | The icon for reposts in your komment list |
| `komment-icon-mention` | '♻️' | The icon for mention in your komment list |
| `komment-icon-verified` | '✅' | The icon for the verify badge list |
| `replyClassNames` | '' | add classnames to the reply link |
| `form.submit.classNames` | `'button button-tiny button-primary'` | add classnames to the submit button |
| `form.twitter.classNames` | `'button button-tiny button-outlined share komment-share-twitter'` | add classnames to the twitter button |
Expand All @@ -124,7 +147,7 @@ You can fine tune the komments to behave as you whish, use this options in `conf

## Page Methods

| Method | Returns | Exsample |
| Method | Returns | Example |
| ----------------------------- | --------- | ------------------------------------------------------------------------------------------ |
| `$page->kommentCount()` | `integer` | `<?php echo $page->kommentCount(); ?> comments` |
| `$page->kommentsAreEnabled()` | `boolean` | `<?php if($page->kommentsAreEnabled()): ><button>Write a comment!</button><?php endif; ?>` |
Expand Down
15 changes: 10 additions & 5 deletions blueprints/sections/komments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ fields:
type: toggle
label: Komments enabled
default: true
kommentsEnabledOnpage:
type: toggle
label: Komments enabled
default: true
text:
- Disabled
- Enabled
kommentsInbox:
type: structure
label: Inbox
fields:
avatar:
type: gravatar
type: url
label: Avatar
width: 1/6
author:
Expand Down Expand Up @@ -64,10 +63,16 @@ fields:
status:
type: toggle
label: Status
text:
- Pending
- Published
width: 1/4
verified:
type: toggle
label: Verified
text:
- Unverified
- Verified
width: 1/4
columns:
author:
Expand Down
35 changes: 35 additions & 0 deletions components/areas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace mauricerenck\Komments;

return [
'komments' => function ($kirby) {
return [
'label' => 'Komments',
'icon' => 'chat',
'menu' => true,
'link' => 'komments',
'views' => [
[
'pattern' => 'komments',
'action' => function () {
return [
'component' => 'k-komments-view',
'title' => 'Komments',
'props' => [
'queuedKomments' => function () {
$kommentUtils = new KommentBaseUtils();
return $kommentUtils->getPendingKomments();
},
'version' => function () {
$kommentUtils = new KommentBaseUtils();
return $kommentUtils->getPluginVersion();
}
],
];
}
]
]
];
}
];
31 changes: 31 additions & 0 deletions components/fields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace mauricerenck\Komments;

return [
'kommentType' => [
'props' => [
]
],
'kommentsPending' => [
'props' => [
'queuedComments' => function () {
$kommentUtils = new KommentBaseUtils();
$pendingComments = $kommentUtils->getPendingKomments();
return count($pendingComments);
},
]
],
'komments' => [
'props' => [
'queuedComments' => function () {
$kommentUtils = new KommentBaseUtils();
return $kommentUtils->getPendingKomments();
},
'version' => function () {
$kommentUtils = new KommentBaseUtils();
return $kommentUtils->getPluginVersion();
}
]
]
];
68 changes: 35 additions & 33 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
{
"name": "mauricerenck/komments",
"version": "0.10.5",
"description": "A comment and webmention plugin for Kirby 3",
"type": "kirby-plugin",
"license": "MIT",
"authors": [
{
"name": "Maurice Renck",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"mauricerenck\\Komments\\": "utils/"
"name": "mauricerenck/komments",
"version": "1.0.0",
"description": "A comment and webmention plugin for Kirby 3",
"type": "kirby-plugin",
"license": "MIT",
"authors": [
{
"name": "Maurice Renck",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"mauricerenck\\Komments\\": "utils/"
},
"classmap": [
"utils"
]
},
"classmap": [
"utils"
]
},
"require-dev": {
"getkirby/cms": "^3.5"
},
"require": {
"getkirby/composer-installer": "^1.1",
"indieweb/mention-client": "^1.2"
},
"config": {
"optimize-autoloader": true
},
"scripts": {
"test": "vendor/bin/phpunit --testdox tests",
"build-test-package": "git archive HEAD -o komments.zip --worktree-attributes",
"build-composer": "composer install --no-dev --optimize-autoloader"
}
"require-dev": {
"getkirby/cms": "^3.6"
},
"require": {
"getkirby/composer-installer": "^1.1",
"indieweb/mention-client": "^1.2",
"php": ">=7.3.0 <8.1.0"
},
"config": {
"optimize-autoloader": true
},
"scripts": {
"test": "vendor/bin/phpunit --testdox tests",
"build-test-package": "git archive HEAD -o komments.zip --worktree-attributes",
"build-composer": "composer install --no-dev --optimize-autoloader"
},
"minimum-stability": "dev"
}
Loading

0 comments on commit 9703324

Please sign in to comment.