Squashed commit of the following: commit 4dc223939c31fd5771b9e6895c8e9e0c88fc6663 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:29 2018 +0000 update changelog commit 7b15937a097c12145e60dfec67cad19e385fcb9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:19:13 2018 +0000 re-compile frontend assets commit f533d5e463d06e158b7bedbfd3602af70113acbc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:14:11 2018 +0000 Only use “by” if there is an author name to show commit 7b067fd559ce2f4a82ad747a3ebd3474e221169c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:12:27 2018 +0000 Some styles for the likes page commit 039523f595115c1329a3939837ebf589184de995 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 21:11:44 2018 +0000 Add a like with just the url to the seeder commit c43d4b07936fceeeb59460399a20abec7a9bc3ae Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:46 2018 +0000 Add test for the admin cp part of likes commit eb115fa481319e98bf54a9fa6aa682479e56787d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:44:28 2018 +0000 Catch 400 errors from a POSSE attempt, its not that important commit 79f7aa7807534eb76ae57dee72002f99249255b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:01:19 2018 +0000 Better fetch data for tweets, attempt to POSSE them back to twitter commit 1ad078929f918c00db550c0af315677cd991dad6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 20:00:40 2018 +0000 Only filter the like content when its actual HTML commit 10f1ba430d4d5262d28e24ca0413474900ea6145 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:57 2018 +0000 Add link to POSSE to twitter via bridgy commit 7f8e5c6dd39716fb51b5766de2f24c7e01355dbb Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 19:59:22 2018 +0000 add links in the admin welcome page for likes commit ebe80b07759881ffb98f8f5117ef25310aaabe6c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:35 2018 +0000 Add the admin routes commit 5e150a7c39f5d71688b7ef14c924d09ba2ec82ba Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 12 18:22:15 2018 +0000 Add admin functionality for likes
172 lines
6.7 KiB
PHP
172 lines
6.7 KiB
PHP
<?php
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::group(['domain' => config('url.longurl')], function () {
|
|
Route::get('/', 'NotesController@index');
|
|
|
|
//Static project page
|
|
Route::view('projects', 'projects');
|
|
|
|
//Static colophon page
|
|
Route::view('colophon', 'colophon');
|
|
|
|
//The login routes to get authe'd for admin
|
|
Route::get('login', 'AuthController@showLogin')->name('login');
|
|
Route::post('login', 'AuthController@login');
|
|
|
|
//Admin pages grouped for filter
|
|
Route::group([
|
|
'middleware' => 'myauth',
|
|
'namespace' => 'Admin',
|
|
'prefix' => 'admin',
|
|
], function () {
|
|
Route::get('/', 'HomeController@welcome');
|
|
|
|
//Articles
|
|
Route::group(['prefix' => 'blog'], function () {
|
|
Route::get('/', 'ArticlesController@index');
|
|
Route::get('/create', 'ArticlesController@create');
|
|
Route::post('/', 'ArticlesController@store');
|
|
Route::get('/{id}/edit', 'ArticlesController@edit');
|
|
Route::put('/{id}', 'ArticlesController@update');
|
|
Route::delete('/{id}', 'ArticlesController@destroy');
|
|
});
|
|
|
|
//Notes
|
|
Route::group(['prefix' => 'notes'], function () {
|
|
Route::get('/', 'NotesController@index');
|
|
Route::get('/create', 'NotesController@create');
|
|
Route::post('/', 'NotesController@store');
|
|
Route::get('/{id}/edit', 'NotesController@edit');
|
|
Route::put('/{id}', 'NotesController@update');
|
|
Route::delete('/{id}', 'NotesController@destroy');
|
|
});
|
|
|
|
//Micropub Clients
|
|
Route::group(['prefix' => 'clients'], function () {
|
|
Route::get('/', 'ClientsController@index');
|
|
Route::get('/create', 'ClientsController@create');
|
|
Route::post('/', 'ClientsController@store');
|
|
Route::get('/{id}/edit', 'ClientsController@edit');
|
|
Route::put('/{id}', 'ClientsController@update');
|
|
Route::delete('/{id}', 'ClientsController@destroy');
|
|
});
|
|
|
|
//Contacts
|
|
Route::group(['prefix' => 'contacts'], function () {
|
|
Route::get('/', 'ContactsController@index');
|
|
Route::get('/create', 'ContactsController@create');
|
|
Route::post('/', 'ContactsController@store');
|
|
Route::get('/{id}/edit', 'ContactsController@edit');
|
|
Route::put('/{id}', 'ContactsController@update');
|
|
Route::delete('/{id}', 'ContactsController@destroy');
|
|
Route::get('/{id}/getavatar', 'ContactsController@getAvatar');
|
|
});
|
|
|
|
//Places
|
|
Route::group(['prefix' => 'places'], function () {
|
|
Route::get('/', 'PlacesController@index');
|
|
Route::get('/create', 'PlacesController@create');
|
|
Route::post('/', 'PlacesController@store');
|
|
Route::get('/{id}/edit', 'PlacesController@edit');
|
|
Route::put('/{id}', 'PlacesController@update');
|
|
Route::get('/{id}/merge', 'PlacesController@mergeIndex');
|
|
Route::get('/{place1_id}/merge/{place2_id}', 'PlacesController@mergeEdit');
|
|
Route::post('/merge', 'PlacesController@mergeStore');
|
|
Route::delete('/{id}', 'PlacesController@destroy');
|
|
});
|
|
|
|
//Likes
|
|
Route::group(['prefix' => 'likes'], function () {
|
|
Route::get('/', 'LikesController@index');
|
|
Route::get('/create', 'LikesController@create');
|
|
Route::post('/', 'LikesController@store');
|
|
Route::get('/{id}/edit', 'LikesController@edit');
|
|
Route::put('/{id}', 'LikesController@update');
|
|
Route::delete('/{id}', 'LikesController@destroy');
|
|
});
|
|
});
|
|
|
|
//Blog pages using ArticlesController
|
|
Route::group(['prefix' => 'blog'], function () {
|
|
Route::get('/feed.rss', 'FeedsController@blogRss');
|
|
Route::get('/feed.atom', 'FeedsController@blogAtom');
|
|
Route::get('/feed.json', 'FeedsController@blogJson');
|
|
Route::get('/s/{id}', 'ArticlesController@onlyIdInURL');
|
|
Route::get('/{year?}/{month?}', 'ArticlesController@index');
|
|
Route::get('/{year}/{month}/{slug}', 'ArticlesController@show');
|
|
});
|
|
|
|
//Notes pages using NotesController
|
|
Route::group(['prefix' => 'notes'], function () {
|
|
Route::get('/', 'NotesController@index');
|
|
Route::get('/feed.rss', 'FeedsController@notesRss');
|
|
Route::get('/feed.atom', 'FeedsController@notesAtom');
|
|
Route::get('/feed.json', 'FeedsController@notesJson');
|
|
Route::get('/{id}', 'NotesController@show');
|
|
Route::get('/tagged/{tag}', 'NotesController@tagged');
|
|
});
|
|
Route::get('note/{id}', 'NotesController@redirect'); // for legacy note URLs
|
|
|
|
// Likes
|
|
Route::group(['prefix' => 'likes'], function () {
|
|
Route::get('/', 'LikesController@index');
|
|
Route::get('/{like}', 'LikesController@show');
|
|
});
|
|
|
|
// Bookmarks
|
|
Route::group(['prefix' => 'bookmarks'], function () {
|
|
Route::get('/', 'BookmarksController@index');
|
|
Route::get('/{bookmark}', 'BookmarksController@show');
|
|
});
|
|
|
|
// Token Endpoint
|
|
Route::post('api/token', 'TokenEndpointController@create');
|
|
|
|
// Micropub Endpoints
|
|
Route::get('api/post', 'MicropubController@get')->middleware('micropub.token');
|
|
Route::post('api/post', 'MicropubController@post')->middleware('micropub.token');
|
|
Route::post('api/media', 'MicropubController@media')->middleware('micropub.token')->name('media-endpoint');
|
|
|
|
//webmention
|
|
Route::get('webmention', 'WebMentionsController@get');
|
|
Route::post('webmention', 'WebMentionsController@receive');
|
|
|
|
//Contacts
|
|
Route::get('contacts', 'ContactsController@index');
|
|
Route::get('contacts/{nick}', 'ContactsController@show');
|
|
|
|
//Places
|
|
Route::get('places', 'PlacesController@index');
|
|
Route::get('places/{slug}', 'PlacesController@show');
|
|
|
|
Route::get('search', 'SearchController@search');
|
|
|
|
Route::post('update-colour-scheme', 'SessionStoreController@saveColour');
|
|
});
|
|
|
|
//Short URL
|
|
Route::group(['domain' => config('url.shorturl')], function () {
|
|
Route::get('/', 'ShortURLsController@baseURL');
|
|
Route::get('@', 'ShortURLsController@twitter');
|
|
Route::get('+', 'ShortURLsController@googlePlus');
|
|
|
|
Route::get('{type}/{id}', 'ShortURLsController@expandType')->where(
|
|
[
|
|
'type' => '[bt]',
|
|
'id' => '[0-9A-HJ-NP-Z_a-km-z]+',
|
|
]
|
|
);
|
|
|
|
Route::get('h/{id}', 'ShortURLsController@redirect');
|
|
});
|