2018-08-25 21:16:20 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use FastRoute\RouteCollector;
|
|
|
|
|
|
|
|
/** @var RouteCollector $route */
|
|
|
|
|
2018-12-18 02:23:44 +01:00
|
|
|
// Pages
|
2019-06-13 15:18:47 +02:00
|
|
|
$route->get('/', 'HomeController@index');
|
2018-09-02 02:13:18 +02:00
|
|
|
$route->get('/credits', 'CreditsController@index');
|
2018-12-18 02:23:44 +01:00
|
|
|
|
2018-10-25 18:53:05 +02:00
|
|
|
// Authentication
|
2018-11-27 12:01:36 +01:00
|
|
|
$route->get('/login', 'AuthController@login');
|
|
|
|
$route->post('/login', 'AuthController@postLogin');
|
2018-10-25 18:53:05 +02:00
|
|
|
$route->get('/logout', 'AuthController@logout');
|
|
|
|
|
2019-10-08 16:17:06 +02:00
|
|
|
// Password recovery
|
|
|
|
$route->get('/password/reset', 'PasswordResetController@reset');
|
|
|
|
$route->post('/password/reset', 'PasswordResetController@postReset');
|
|
|
|
$route->get('/password/reset/{token:.+}', 'PasswordResetController@resetPassword');
|
|
|
|
$route->post('/password/reset/{token:.+}', 'PasswordResetController@postResetPassword');
|
|
|
|
|
2018-12-18 02:23:44 +01:00
|
|
|
// Stats
|
|
|
|
$route->get('/metrics', 'Metrics\\Controller@metrics');
|
|
|
|
$route->get('/stats', 'Metrics\\Controller@stats');
|
2018-11-20 18:55:56 +01:00
|
|
|
|
2020-04-05 16:54:45 +02:00
|
|
|
// News
|
|
|
|
$route->get('/news', 'NewsController@index');
|
|
|
|
$route->get('/meetings', 'NewsController@meetings');
|
|
|
|
$route->get('/news/{id:\d+}', 'NewsController@show');
|
|
|
|
$route->post('/news/{id:\d+}', 'NewsController@comment');
|
|
|
|
|
2018-11-20 18:55:56 +01:00
|
|
|
// API
|
|
|
|
$route->get('/api[/{resource:.+}]', 'ApiController@index');
|
2019-11-27 23:43:21 +01:00
|
|
|
|
2020-04-24 18:08:09 +02:00
|
|
|
// Design
|
|
|
|
$route->get('/design', 'DesignController@index');
|
|
|
|
|
2019-11-27 23:43:21 +01:00
|
|
|
// Administration
|
|
|
|
$route->addGroup(
|
|
|
|
'/admin',
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
// Schedule
|
|
|
|
$route->addGroup(
|
2020-04-07 15:08:49 +02:00
|
|
|
'/schedule',
|
2019-11-27 23:43:21 +01:00
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('', 'Admin\\Schedule\\ImportSchedule@index');
|
2020-04-07 15:08:49 +02:00
|
|
|
$route->post('/load', 'Admin\\Schedule\\ImportSchedule@loadSchedule');
|
|
|
|
$route->post('/import', 'Admin\\Schedule\\ImportSchedule@importSchedule');
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
);
|
2020-04-05 16:54:45 +02:00
|
|
|
$route->addGroup(
|
|
|
|
'/news',
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('[/{id:\d+}]', 'Admin\\NewsController@edit');
|
|
|
|
$route->post('[/{id:\d+}]', 'Admin\\NewsController@save');
|
|
|
|
}
|
|
|
|
);
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
);
|