Skip to content

Commit

Permalink
beta 14 (#25)
Browse files Browse the repository at this point in the history
* mithril2 updates

* props -> attrs

* Use event extender

* Remove deprecated AssertPermissionTrait

* Working :D

* Lint
  • Loading branch information
karaok491 authored Nov 14, 2020
1 parent a009a4c commit 868a35b
Show file tree
Hide file tree
Showing 24 changed files with 993 additions and 1,339 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^0.1.0-beta.8"
"flarum/core": "^0.1.0-beta.14"
},
"replace": {
"reflar/polls": "^1.3.4"
Expand Down
16 changes: 13 additions & 3 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace FoF\Polls;

use Flarum\Discussion\Discussion;
use Flarum\Discussion\Event\Saving;
use Flarum\Extend;
use FoF\Polls\Api\Controllers;
Expand All @@ -20,16 +21,25 @@
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/resources/less/forum.less'),

(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/resources/less/admin.less'),

new Extend\Locales(__DIR__.'/resources/locale'),

(new Extend\Routes('api'))
->patch('/fof/polls/{id}', 'fof.polls.edit', Controllers\EditPollController::class)
->delete('/fof/polls/{id}', 'fof.polls.delete', Controllers\DeletePollController::class)
->patch('/fof/polls/{id}/vote', 'fof.polls.vote', Controllers\VotePollController::class),
new Extend\Compat(function (Dispatcher $events) {

(new Extend\Model(Discussion::class))
->hasOne('poll', Poll::class, 'discussion_id', 'id'),

(new Extend\Event())
->listen(Saving::class, Listeners\SavePollsToDatabase::class),

function (Dispatcher $events) {
$events->subscribe(Listeners\AddDiscussionPollRelationship::class);
$events->listen(Saving::class, Listeners\SavePollsToDatabase::class);
}),
},
];
2 changes: 1 addition & 1 deletion js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 868a35b

Please sign in to comment.