Skip to content

Commit

Permalink
merge licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiewebb committed May 19, 2023
2 parents e1271b8 + 3139b52 commit fe6c737
Show file tree
Hide file tree
Showing 46 changed files with 5,445 additions and 1,964 deletions.
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^1.0",
"fof/sitemap": "^2.0"
"flarum/core": "^1.7.2",
"fof/sitemap": "*"
},
"authors": [
{
Expand All @@ -27,6 +27,11 @@
"name": "Andreas Hofmann",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Rafael Horvat",
"email": "[email protected]",
"role": "Developer"
}
],
"autoload": {
Expand Down
41 changes: 25 additions & 16 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,51 @@

namespace Webbinaro\AdvCalendar;

use Flarum\Api\Serializer\UserSerializer;
use Flarum\Extend;
use Webbinaro\AdvCalendar\Api\Controllers as ControllersAlias;
use Illuminate\Events\Dispatcher;
use Webbinaro\AdvCalendar\Integrations\EventResourceRegister;
use Webbinaro\AdvCalendar\Integrations\SitemapsResource;
use Webbinaro\AdvCalendar\Listeners;

return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/resources/less/forum.less')
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/resources/less/forum.less')
->route('/events', 'advevents')
->route(
'/events/{id}[/{filter:[0-9]*}]',
'advevent',
Content\Event::class),
Content\Event::class
),



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

//API Routes
(new Extend\Routes('api'))
->get('/events','events.index', ControllersAlias\EventsListController::class)
->get('/events/{id}','events.show', ControllersAlias\EventsShowController::class)
->post('/events','events.create', ControllersAlias\EventsCreateController::class)
->patch('/events/{id}','events.edit', ControllersAlias\EventsUpdateController::class)
->delete('/events/{id}','events.delete', ControllersAlias\EventsDeleteController::class),
->get('/events', 'events.index', ControllersAlias\EventsListController::class)
->get('/events/{id}', 'events.show', ControllersAlias\EventsShowController::class)
->post('/events', 'events.create', ControllersAlias\EventsCreateController::class)
->patch('/events/{id}', 'events.edit', ControllersAlias\EventsUpdateController::class)
->delete('/events/{id}', 'events.delete', ControllersAlias\EventsDeleteController::class),

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

(new Extend\Event)
->subscribe(Listeners\AdvEventListener::class),

new EventResourceRegister(),

(new Extend\Settings)
->serializeToForum('webbinaro-calendar.hide_host', 'webbinaro-calendar.hide_host', 'boolval', false),

(new Extend\ApiSerializer(UserSerializer::class))
->attribute('canModerateEvents', function (UserSerializer $serializer) {
return $serializer->getActor()->can('event.moderate');
})
->attribute('canStartEvents', function (UserSerializer $serializer) {
return $serializer->getActor()->can('event.create');
})
->attribute('canViewEvents', function (UserSerializer $serializer) {
return $serializer->getActor()->can('event.view');
}),
];
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.

Loading

0 comments on commit fe6c737

Please sign in to comment.