diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 6d54f10b..c110b3db 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -35,4 +35,9 @@ class AccountController extends Controller { return Redirect::to(Config::get('poniverse.urls')['register']); } + + public function getNotifications() + { + return View::make('shared.null'); + } } diff --git a/app/Http/routes.php b/app/Http/routes.php index ab05a173..3463c36c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -65,6 +65,8 @@ Route::get('playlist/{id}-{slug}', 'PlaylistsController@getPlaylist'); Route::get('p{id}', 'PlaylistsController@getShortlink')->where('id', '\d+'); Route::get('p{id}/dl.{extension}', 'PlaylistsController@getDownload' ); +Route::get('notifications', 'AccountController@getNotifications'); + Route::group(['prefix' => 'api/v1', 'middleware' => 'json-exceptions'], function() { diff --git a/public/templates/notifications/index.html b/public/templates/notifications/index.html index e69de29b..d5a9432a 100644 --- a/public/templates/notifications/index.html +++ b/public/templates/notifications/index.html @@ -0,0 +1,4 @@ +
+ +

{{ notification.text }}

+
\ No newline at end of file diff --git a/resources/assets/scripts/app/controllers/notifications.coffee b/resources/assets/scripts/app/controllers/notifications.coffee index 80bda43d..8dba5740 100644 --- a/resources/assets/scripts/app/controllers/notifications.coffee +++ b/resources/assets/scripts/app/controllers/notifications.coffee @@ -17,6 +17,8 @@ module.exports = angular.module('ponyfm').controller "notifications", [ '$scope', 'notifications' ($scope, notifications) -> + notifications.getNotifications().done (result) -> + $scope.notifications = result console.log result ] diff --git a/resources/assets/scripts/app/services/notifications.coffee b/resources/assets/scripts/app/services/notifications.coffee index 0205def9..e8c5f258 100644 --- a/resources/assets/scripts/app/services/notifications.coffee +++ b/resources/assets/scripts/app/services/notifications.coffee @@ -21,8 +21,8 @@ module.exports = angular.module('ponyfm').factory('notifications', [ getNotifications: () -> def = new $.Deferred() - $http.get('/api/web/account/notifications').success (response) -> - def.resolve response + $http.get('/api/web/notifications').success (response) -> + def.resolve response.notifications def.promise()