mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 14:37:59 +01:00
Test UI for notifications
This commit is contained in:
parent
0109244115
commit
ef598a72ef
5 changed files with 15 additions and 2 deletions
|
@ -35,4 +35,9 @@ class AccountController extends Controller
|
|||
{
|
||||
return Redirect::to(Config::get('poniverse.urls')['register']);
|
||||
}
|
||||
|
||||
public function getNotifications()
|
||||
{
|
||||
return View::make('shared.null');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<div ng-repeat="notification in notifications">
|
||||
<a href="{{ notification.url }}"><img pfm-src-loader="::notification.thumbnail_url" pfm-src-size="thumbnail"></a>
|
||||
<a href="{{ notification.url }}"><p>{{ notification.text }}</p></a>
|
||||
</div>
|
|
@ -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
|
||||
]
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue