From 7176fb2bca950b8ffb7f727cccb21cc8991c6757 Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Sat, 13 Feb 2016 19:11:32 -0800 Subject: [PATCH] #2: Implemented the inline track editor on track pages. Also includes a fix for lyrics on track pages. --- app/Http/Controllers/TracksController.php | 5 ++++ app/Http/routes.php | 1 + public/templates/directives/track-editor.html | 2 +- public/templates/tracks/edit.html | 6 ++--- public/templates/tracks/frame.html | 12 ++++----- public/templates/tracks/show.html | 6 ++--- .../scripts/app/controllers/track-edit.coffee | 4 +++ .../scripts/app/controllers/track.coffee | 25 +++++++++++++------ 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/app/Http/Controllers/TracksController.php b/app/Http/Controllers/TracksController.php index b51d388e..866478a7 100644 --- a/app/Http/Controllers/TracksController.php +++ b/app/Http/Controllers/TracksController.php @@ -91,6 +91,11 @@ class TracksController extends Controller return View::make('tracks.show'); } + public function getEdit($id, $slug) + { + return $this->getTrack($id, $slug); + } + public function getShortlink($id) { $track = Track::find($id); diff --git a/app/Http/routes.php b/app/Http/routes.php index 57f3edb5..60242b0c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -39,6 +39,7 @@ Route::get('/tracks/popular', 'TracksController@getIndex'); Route::get('/tracks/random', 'TracksController@getIndex'); Route::get('tracks/{id}-{slug}', 'TracksController@getTrack'); +Route::get('tracks/{id}-{slug}/edit', 'TracksController@getEdit'); Route::get('t{id}', 'TracksController@getShortlink' )->where('id', '\d+'); Route::get('t{id}/embed', 'TracksController@getEmbed' ); Route::get('t{id}/stream.{extension}', 'TracksController@getStream' ); diff --git a/public/templates/directives/track-editor.html b/public/templates/directives/track-editor.html index e3eaac49..54a2f905 100644 --- a/public/templates/directives/track-editor.html +++ b/public/templates/directives/track-editor.html @@ -111,7 +111,7 @@