2013-07-30 06:53:57 +02:00
|
|
|
window.pfm.preloaders = {}
|
|
|
|
|
2013-08-31 04:46:28 +02:00
|
|
|
module = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'pasvaz.bindonce', 'angularytics']
|
|
|
|
|
|
|
|
module.run [
|
|
|
|
'Angularytics',
|
|
|
|
(analyitcs) ->
|
|
|
|
analyitcs.init()
|
|
|
|
]
|
2013-07-30 06:53:57 +02:00
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
module.config [
|
2013-08-31 04:46:28 +02:00
|
|
|
'$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider'
|
|
|
|
(location, state, $dialogProvider, analytics) ->
|
|
|
|
|
|
|
|
analytics.setEventHandlers ['Google']
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
# Upload
|
|
|
|
|
|
|
|
state.state 'uploader',
|
|
|
|
url: '/account/uploader'
|
|
|
|
templateUrl: '/templates/uploader/index.html'
|
|
|
|
controller: 'uploader'
|
|
|
|
|
2013-07-25 23:33:04 +02:00
|
|
|
# Account
|
|
|
|
|
|
|
|
state.state 'account',
|
|
|
|
url: '/account'
|
2013-08-31 03:46:35 +02:00
|
|
|
abstract: true
|
|
|
|
templateUrl: '/templates/account/_layout.html'
|
|
|
|
|
|
|
|
state.state 'account.settings',
|
|
|
|
url: ''
|
2013-07-25 23:33:04 +02:00
|
|
|
templateUrl: '/templates/account/settings.html'
|
|
|
|
controller: 'account-settings'
|
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.tracks',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/tracks'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/account/tracks.html'
|
2013-07-28 09:09:10 +02:00
|
|
|
controller: 'account-tracks'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.tracks.edit',
|
2013-07-28 09:09:10 +02:00
|
|
|
url: '/edit/:track_id'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/account/track.html'
|
|
|
|
controller: 'account-track'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.albums',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/albums'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/account/albums.html'
|
2013-07-28 09:09:10 +02:00
|
|
|
controller: 'account-albums'
|
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.albums.create',
|
2013-07-28 09:09:10 +02:00
|
|
|
url: '/create'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/account/album.html'
|
2013-07-28 09:09:10 +02:00
|
|
|
controller: 'account-albums-edit'
|
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.albums.edit',
|
2013-07-28 09:09:10 +02:00
|
|
|
url: '/edit/:album_id'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/account/album.html'
|
2013-07-28 09:09:10 +02:00
|
|
|
controller: 'account-albums-edit'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'account.playlists',
|
|
|
|
url: '/playlists'
|
|
|
|
templateUrl: '/templates/account/playlists.html'
|
2013-07-28 19:45:21 +02:00
|
|
|
controller: 'account-playlists'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'favourites',
|
2013-07-27 02:15:07 +02:00
|
|
|
url: '/account/favourites'
|
2013-07-25 23:33:04 +02:00
|
|
|
abstract: true
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/favourites/_layout.html'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'favourites.tracks',
|
|
|
|
url: '/tracks'
|
|
|
|
templateUrl: '/templates/favourites/tracks.html'
|
|
|
|
controller: 'favourites-tracks'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'favourites.playlists',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/playlists'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/favourites/playlists.html'
|
|
|
|
controller: 'favourites-playlists'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-31 03:46:35 +02:00
|
|
|
state.state 'favourites.albums',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/albums'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/favourites/albums.html'
|
|
|
|
controller: 'favourites-albums'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
|
|
|
# Tracks
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content',
|
2013-07-31 13:47:16 +02:00
|
|
|
abstract: true
|
2013-08-14 07:53:12 +02:00
|
|
|
templateUrl: '/templates/content/_layout.html'
|
2013-07-31 13:47:16 +02:00
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.tracks',
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/tracks/index.html'
|
2013-07-31 13:47:16 +02:00
|
|
|
controller: 'tracks'
|
2013-08-14 07:53:12 +02:00
|
|
|
url: '/tracks'
|
|
|
|
abstract: true
|
2013-07-31 13:47:16 +02:00
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.tracks.list',
|
|
|
|
url: '^/tracks?filter&page'
|
2013-08-31 03:46:35 +02:00
|
|
|
templateUrl: '/templates/tracks/list.html'
|
2013-07-31 13:47:16 +02:00
|
|
|
controller: 'tracks-list'
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.track',
|
|
|
|
url: '/tracks/{id:[^\-]+}-{slug}'
|
|
|
|
templateUrl: '/templates/tracks/show.html'
|
|
|
|
controller: 'track'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
|
|
|
# Albums
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.albums',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/albums'
|
|
|
|
templateUrl: '/templates/albums/index.html'
|
2013-08-01 04:01:41 +02:00
|
|
|
controller: 'albums'
|
|
|
|
abstract: true
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.albums.list',
|
2013-08-01 04:01:41 +02:00
|
|
|
url: '?page'
|
|
|
|
templateUrl: '/templates/albums/list.html'
|
|
|
|
controller: 'albums-list'
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.album',
|
2013-08-01 04:01:41 +02:00
|
|
|
url: '/albums/{id:[^\-]+}-{slug}'
|
|
|
|
templateUrl: '/templates/albums/show.html'
|
|
|
|
controller: 'album'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
|
|
|
# Playlists
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.playlists',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/playlists'
|
|
|
|
templateUrl: '/templates/playlists/index.html'
|
2013-08-27 08:53:37 +02:00
|
|
|
controller: 'playlists'
|
|
|
|
abstract: true
|
|
|
|
|
|
|
|
state.state 'content.playlists.list',
|
|
|
|
url: '?page'
|
|
|
|
controller: 'playlists-list'
|
|
|
|
templateUrl: '/templates/playlists/list.html'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.playlist',
|
2013-08-01 01:04:04 +02:00
|
|
|
url: '/playlist/{id:[^\-]+}-{slug}'
|
2013-07-28 19:45:21 +02:00
|
|
|
templateUrl: '/templates/playlists/show.html'
|
|
|
|
controller: 'playlist'
|
|
|
|
|
2013-07-25 23:33:04 +02:00
|
|
|
# Artists
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artists',
|
2013-07-25 23:33:04 +02:00
|
|
|
url: '/artists'
|
|
|
|
templateUrl: '/templates/artists/index.html'
|
2013-08-01 04:01:41 +02:00
|
|
|
controller: 'artists'
|
|
|
|
abstract: true
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artists.list',
|
2013-08-01 04:01:41 +02:00
|
|
|
url: '?page'
|
|
|
|
templateUrl: '/templates/artists/list.html'
|
|
|
|
controller: 'artists-list'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
|
|
|
# Pages
|
|
|
|
|
|
|
|
state.state 'faq',
|
|
|
|
url: '/faq'
|
|
|
|
templateUrl: '/templates/pages/faq.html'
|
|
|
|
|
|
|
|
state.state 'about',
|
|
|
|
url: '/about'
|
|
|
|
templateUrl: '/templates/pages/about.html'
|
|
|
|
|
|
|
|
# Auth
|
|
|
|
|
|
|
|
state.state 'login',
|
|
|
|
url: '/login'
|
|
|
|
templateUrl: '/templates/auth/login.html'
|
|
|
|
controller: 'login'
|
|
|
|
|
|
|
|
state.state 'register',
|
|
|
|
url: '/register'
|
|
|
|
templateUrl: '/templates/auth/register.html'
|
|
|
|
|
|
|
|
# Hompage
|
|
|
|
|
2013-07-28 23:51:35 +02:00
|
|
|
if window.pfm.auth.isLogged
|
|
|
|
state.state 'home',
|
|
|
|
url: '/'
|
2013-07-31 13:47:16 +02:00
|
|
|
templateUrl: '/templates/dashboard/index.html'
|
2013-07-28 23:51:35 +02:00
|
|
|
controller: 'dashboard'
|
|
|
|
else
|
|
|
|
state.state 'home',
|
|
|
|
url: '/'
|
|
|
|
templateUrl: '/templates/home/index.html'
|
2013-08-31 04:46:28 +02:00
|
|
|
controller: 'home'
|
2013-07-25 23:33:04 +02:00
|
|
|
|
2013-08-01 04:01:41 +02:00
|
|
|
# Final catch-all for aritsts
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artist',
|
|
|
|
url: '^/{slug}'
|
2013-08-01 04:47:21 +02:00
|
|
|
templateUrl: '/templates/artists/_show_layout.html'
|
|
|
|
abstract: true
|
2013-08-01 04:01:41 +02:00
|
|
|
controller: 'artist'
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artist.profile',
|
2013-08-01 04:47:21 +02:00
|
|
|
url: ''
|
|
|
|
templateUrl: '/templates/artists/profile.html'
|
|
|
|
controller: 'artist-profile'
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artist.content',
|
2013-08-01 04:47:21 +02:00
|
|
|
url: '/content'
|
|
|
|
templateUrl: '/templates/artists/content.html'
|
|
|
|
controller: 'artist-content'
|
|
|
|
|
2013-08-14 07:53:12 +02:00
|
|
|
state.state 'content.artist.favourites',
|
2013-08-01 04:47:21 +02:00
|
|
|
url: '/favourites'
|
|
|
|
templateUrl: '/templates/artists/favourites.html'
|
|
|
|
controller: 'artist-favourites'
|
|
|
|
|
2013-07-25 23:33:04 +02:00
|
|
|
location.html5Mode(true);
|
|
|
|
$dialogProvider.options
|
|
|
|
dialogFade: true
|
|
|
|
backdropClick: false
|
|
|
|
]
|