<?php
+Route::get('/translations', 'HomeController@getTranslations');
+
// Authenticated routes...
Route::group(['middleware' => 'auth'], function () {
Route::get('/{slug}/delete', 'BookController@showDelete');
Route::get('/{bookSlug}/sort', 'BookController@sort');
Route::put('/{bookSlug}/sort', 'BookController@saveSort');
+ Route::get('/{bookSlug}/export/html', 'BookController@exportHtml');
+ Route::get('/{bookSlug}/export/pdf', 'BookController@exportPdf');
+ Route::get('/{bookSlug}/export/plaintext', 'BookController@exportPlainText');
// Pages
Route::get('/{bookSlug}/page/create', 'PageController@create');
Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move');
Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showRestrict');
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', 'ChapterController@exportPdf');
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', 'ChapterController@exportHtml');
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', 'ChapterController@exportPlainText');
Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@restrict');
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
Route::delete('/{imageId}', 'ImageController@destroy');
});
- // File routes
- Route::get('/files/{id}', 'FileController@get');
- Route::post('/files/upload', 'FileController@upload');
- Route::post('/files/upload/{id}', 'FileController@uploadUpdate');
- Route::post('/files/link', 'FileController@attachLink');
- Route::put('/files/{id}', 'FileController@update');
- Route::get('/files/get/page/{pageId}', 'FileController@listForPage');
- Route::put('/files/sort/page/{pageId}', 'FileController@sortForPage');
- Route::delete('/files/{id}', 'FileController@delete');
+ // Attachments routes
+ Route::get('/attachments/{id}', 'AttachmentController@get');
+ Route::post('/attachments/upload', 'AttachmentController@upload');
+ Route::post('/attachments/upload/{id}', 'AttachmentController@uploadUpdate');
+ Route::post('/attachments/link', 'AttachmentController@attachLink');
+ Route::put('/attachments/{id}', 'AttachmentController@update');
+ Route::get('/attachments/get/page/{pageId}', 'AttachmentController@listForPage');
+ Route::put('/attachments/sort/page/{pageId}', 'AttachmentController@sortForPage');
+ Route::delete('/attachments/{id}', 'AttachmentController@delete');
// AJAX routes
Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
Route::get('/suggest/names', 'TagController@getNameSuggestions');
Route::get('/suggest/values', 'TagController@getValueSuggestions');
- Route::post('/update/{entityType}/{entityId}', 'TagController@updateForEntity');
});
Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
+ // Comments
+ Route::post('/ajax/page/{pageId}/comment/', 'CommentController@save');
+ Route::put('/ajax/page/{pageId}/comment/{commentId}', 'CommentController@save');
+ Route::delete('/ajax/comment/{id}', 'CommentController@destroy');
+ Route::get('/ajax/page/{pageId}/comments/', 'CommentController@getPageComments');
+
// Links
Route::get('/link/{id}', 'PageController@redirectFromLink');
// Search
- Route::get('/search/all', 'SearchController@searchAll');
- Route::get('/search/pages', 'SearchController@searchPages');
- Route::get('/search/books', 'SearchController@searchBooks');
- Route::get('/search/chapters', 'SearchController@searchChapters');
+ Route::get('/search', 'SearchController@search');
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
+ Route::get('/search/chapter/{bookId}', 'SearchController@searchChapter');
// Other Pages
Route::get('/', 'HomeController@index');
// Settings
Route::group(['prefix' => 'settings'], function() {
- Route::get('/', 'SettingController@index');
+ Route::get('/', 'SettingController@index')->name('settings');
Route::post('/', 'SettingController@update');
// Users
});
// Social auth routes
-Route::get('/login/service/{socialDriver}', 'Auth\RegisterController@getSocialLogin');
+Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
Route::get('/login/service/{socialDriver}/callback', 'Auth\RegisterController@socialCallback');
Route::get('/login/service/{socialDriver}/detach', 'Auth\RegisterController@detachSocialAccount');
Route::get('/register/service/{socialDriver}', 'Auth\RegisterController@socialRegister');