From d8933374abbe35d68986256c24398a89223fa0d4 Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Fri, 18 Mar 2016 19:47:45 -0700 Subject: [PATCH] #2: Rearranged various routes for account management + other cleanup. The "Favourites" area within account management was removed as it duplicates the functionality of the favourites area on public profiles. --- app/Http/Controllers/FavouritesController.php | 41 ------------------- app/Http/routes.php | 40 +++++++++--------- public/templates/account/_layout.html | 3 ++ public/templates/account/albums.html | 4 +- public/templates/artists/_show_layout.html | 2 +- public/templates/favourites/_layout.html | 9 ---- public/templates/favourites/albums.html | 3 -- public/templates/favourites/playlists.html | 3 -- public/templates/favourites/tracks.html | 3 -- resources/assets/scripts/app/app.coffee | 34 ++++----------- .../controllers/account-albums-edit.coffee | 4 +- .../app/controllers/account-tracks.coffee | 4 ++ .../app/controllers/favourites-albums.coffee | 28 ------------- .../controllers/favourites-playlists.coffee | 28 ------------- .../app/controllers/favourites-tracks.coffee | 28 ------------- resources/views/shared/_app_layout.blade.php | 4 +- 16 files changed, 42 insertions(+), 196 deletions(-) delete mode 100644 app/Http/Controllers/FavouritesController.php delete mode 100644 public/templates/favourites/_layout.html delete mode 100644 public/templates/favourites/albums.html delete mode 100644 public/templates/favourites/playlists.html delete mode 100644 public/templates/favourites/tracks.html delete mode 100644 resources/assets/scripts/app/controllers/favourites-albums.coffee delete mode 100644 resources/assets/scripts/app/controllers/favourites-playlists.coffee delete mode 100644 resources/assets/scripts/app/controllers/favourites-tracks.coffee diff --git a/app/Http/Controllers/FavouritesController.php b/app/Http/Controllers/FavouritesController.php deleted file mode 100644 index 54ffd501..00000000 --- a/app/Http/Controllers/FavouritesController.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace Poniverse\Ponyfm\Http\Controllers; - -use View; - -class FavouritesController extends Controller -{ - public function getTracks() - { - return View::make('shared.null'); - } - - public function getAlbums() - { - return View::make('shared.null'); - } - - public function getPlaylists() - { - return View::make('shared.null'); - } -} diff --git a/app/Http/routes.php b/app/Http/routes.php index 349c006d..cff6880d 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -158,22 +158,6 @@ Route::group(['prefix' => 'api/web'], function() { Route::post('/auth/logout', 'Api\Web\AuthController@postLogout'); }); -Route::group(['prefix' => 'account', 'middleware' => 'auth'], function() { - Route::get('/favourites/tracks', 'FavouritesController@getTracks'); - Route::get('/favourites/albums', 'FavouritesController@getAlbums'); - Route::get('/favourites/playlists', 'FavouritesController@getPlaylists'); - - Route::get('/tracks', 'ContentController@getTracks'); - Route::get('/tracks/edit/{id}', 'ContentController@getTracks'); - Route::get('/albums', 'ContentController@getAlbums'); - Route::get('/albums/edit/{id}', 'ContentController@getAlbums'); - Route::get('/albums/create', 'ContentController@getAlbums'); - Route::get('/playlists', 'ContentController@getPlaylists'); - - Route::get('/uploader', 'UploaderController@getIndex'); - - Route::get('/', 'AccountController@getIndex'); -}); Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'can:access-admin-area']], function() { Route::get('/genres', 'AdminController@getGenres'); @@ -182,9 +166,27 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'can:access-admin-ar Route::get('u{id}', 'ArtistsController@getShortlink')->where('id', '\d+'); Route::get('users/{id}-{slug}', 'ArtistsController@getShortlink')->where('id', '\d+'); -Route::get('{slug}', 'ArtistsController@getProfile'); -Route::get('{slug}/content', 'ArtistsController@getContent'); -Route::get('{slug}/favourites', 'ArtistsController@getFavourites'); + + +Route::group(['prefix' => '{slug}'], function() { + Route::get('/', 'ArtistsController@getProfile'); + Route::get('/content', 'ArtistsController@getContent'); + Route::get('/favourites', 'ArtistsController@getFavourites'); + + + Route::group(['prefix' => 'account', 'middleware' => 'auth'], function() { + Route::get('/tracks', 'ContentController@getTracks'); + Route::get('/tracks/edit/{id}', 'ContentController@getTracks'); + Route::get('/albums', 'ContentController@getAlbums'); + Route::get('/albums/edit/{id}', 'ContentController@getAlbums'); + Route::get('/albums/create', 'ContentController@getAlbums'); + Route::get('/playlists', 'ContentController@getPlaylists'); + + Route::get('/uploader', 'UploaderController@getIndex'); + + Route::get('/', 'AccountController@getIndex'); + }); +}); Route::get('/', 'HomeController@getIndex'); diff --git a/public/templates/account/_layout.html b/public/templates/account/_layout.html index 0504e5c4..042b0ece 100644 --- a/public/templates/account/_layout.html +++ b/public/templates/account/_layout.html @@ -1,4 +1,7 @@