diff --git a/.gitignore b/.gitignore
index 20e1ee9b..c962ed84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,8 @@ intermediate
publish
.idea
+node_modules
+/public/build/
/bootstrap/compiled.php
/vendor
/app/config/production
diff --git a/app/library/Assets.php b/app/library/Assets.php
index 06554dc7..6aa1dd54 100644
--- a/app/library/Assets.php
+++ b/app/library/Assets.php
@@ -6,138 +6,100 @@
class Assets {
public static function scriptIncludes($area = 'app') {
- $js = self::scriptAssetCollection($area);
+ if (!Config::get("app.debug"))
+ return '';
- if (Config::get('app.debug')) {
- $retVal = '';
+ $scripts = self::mergeGlobs(self::getScriptsForArea($area));
+ $retVal = "";
- foreach ($js as $script) {
- $retVal .= '';
- }
-
- return $retVal;
+ foreach ($scripts as $script) {
+ $filename = self::replaceExtensionWith($script, ".coffee", ".js");
+ $retVal .= "";
}
- return '';
+ return $retVal;
}
public static function styleIncludes($area = 'app') {
- $css = self::styleAssetCollection($area);
+ if (!Config::get("app.debug"))
+ return '';
- if (Config::get('app.debug')) {
- $retVal = '';
+ $styles = self::mergeGlobs(self::getStylesForArea($area));
+ $retVal = "";
- foreach ($css as $style) {
- if ($style instanceof CacheBusterAsset)
- continue;
-
- $retVal .= '';
- }
-
- return $retVal;
+ foreach ($styles as $style) {
+ $filename = self::replaceExtensionWith($style, ".less", ".css");
+ $retVal .= "";
}
- return '';
+ return $retVal;
}
- public static function scriptAssetCollection($area) {
- $coffeeScript = new CoffeeScriptFilter(Config::get('app.coffee'), Config::get('app.node'));
+ private static function replaceExtensionWith($filename, $fromExtension, $toExtension) {
+ $fromLength = strlen($fromExtension);
+ return substr($filename, -$fromLength) == $fromExtension
+ ? substr($filename, 0, strlen($filename) - $fromLength) . $toExtension
+ : $filename;
+ }
- if ($area == 'app') {
- $collection = new AssetCollection([
- new FileAsset('scripts/base/jquery-2.0.2.js'),
- new FileAsset('scripts/base/jquery-ui.js'),
- new FileAsset('scripts/base/jquery.cookie.js'),
- new FileAsset('scripts/base/jquery.colorbox.js'),
- new FileAsset('scripts/base/jquery.viewport.js'),
- new FileAsset('scripts/base/underscore.js'),
- new FileAsset('scripts/base/moment.js'),
- new FileAsset('scripts/base/soundmanager2-nodebug.js'),
- new FileAsset('scripts/base/angular.js'),
- new FileAsset('scripts/base/bindonce.js'),
- new FileAsset('scripts/base/ui-bootstrap-tpls-0.4.0.js'),
- new FileAsset('scripts/base/angular-ui-sortable.js'),
- new FileAsset('scripts/base/angular-ui-date.js'),
- new FileAsset('scripts/base/angular-ui-router.js'),
- new FileAsset('scripts/base/angularytics.js'),
- new FileAsset('scripts/base/tumblr.js'),
- new AssetCollection([
- new GlobAsset('scripts/shared/*.coffee'),
- ], [
- $coffeeScript
- ]),
- new GlobAsset('scripts/shared/*.js'),
- new AssetCollection([
- new GlobAsset('scripts/app/*.coffee'),
- new GlobAsset('scripts/app/services/*.coffee'),
- new GlobAsset('scripts/app/filters/*.coffee'),
- ], [
- $coffeeScript
- ]),
- new GlobAsset('scripts/app/filters/*.js'),
- new AssetCollection([
- new GlobAsset('scripts/app/directives/*.coffee'),
- new GlobAsset('scripts/app/controllers/*.coffee'),
- ], [
- $coffeeScript
- ])
- ]);
+ /** Merges an array of paths that are passed into "glob" into a list of unique filenames.
+ * Note that this method assumes the globs should be relative to the "app" folder of this project */
+ private static function mergeGlobs($globs) {
+ $files = [];
+ $filesFound = [];
+ foreach ($globs as $glob) {
+ foreach (glob("../app/" . $glob, GLOB_BRACE) as $file) {
+ if (isset($filesFound[$file]))
+ continue;
- if (Config::get('app.debug')) {
- $collection->add(new GlobAsset('scripts/debug/*.js'));
-
- $collection->add(new AssetCollection([
- new GlobAsset('scripts/debug/*.coffee'),
- ], [
- $coffeeScript
- ]));
+ $filesFound[$file] = true;
+ $files[] = substr($file, 7); // chop off ../app/
}
+ }
- return $collection;
+ return $files;
+ }
+
+ private static function getScriptsForArea($area) {
+ if ($area == 'app') {
+ return [
+ "scripts/base/jquery-2.0.2.js",
+ "scripts/base/angular.js",
+ "scripts/base/*.{coffee,js}",
+ "scripts/shared/*.{coffee,js}",
+ "scripts/app/*.{coffee,js}",
+ "scripts/app/services/*.{coffee,js}",
+ "scripts/app/filters/*.{coffee,js}",
+ "scripts/app/directives/*.{coffee,js}",
+ "scripts/app/controllers/*.{coffee,js}",
+ "scripts/**/*.{coffee,js}"
+ ];
} else if ($area == 'embed') {
- $collection = new AssetCollection([
- new FileAsset('scripts/base/jquery-2.0.2.js'),
- new FileAsset('scripts/base/jquery.viewport.js'),
- new FileAsset('scripts/base/underscore.js'),
- new FileAsset('scripts/base/moment.js'),
- new FileAsset('scripts/base/jquery.timeago.js'),
- new FileAsset('scripts/base/soundmanager2-nodebug.js'),
- new AssetCollection([
- new GlobAsset('scripts/embed/*.coffee'),
- ], [
- $coffeeScript
- ])
- ]);
-
- return $collection;
+ return [
+ "scripts/base/jquery-2.0.2.js",
+ "scripts/base/jquery.viewport.js",
+ "scripts/base/underscore.js",
+ "scripts/base/moment.js",
+ "scripts/base/jquery.timeago.js",
+ "scripts/base/soundmanager2-nodebug.js",
+ "scripts/embed/*.coffee"];
}
throw new Exception();
}
- public static function styleAssetCollection($area) {
+ private static function getStylesForArea($area) {
if ($area == 'app') {
- $lastModifiedCollection = new AssetCollection([new GlobAsset("styles/*.less")]);
-
- $css = new AssetCollection([
- new FileAsset('styles/base/jquery-ui.css'),
- new FileAsset('styles/base/colorbox.css'),
- new FileAsset('styles/app.less'),
- new CacheBusterAsset($lastModifiedCollection->getLastModified())
- ], [new \Assetic\Filter\LessFilter('node', Config::get('app.node_paths'))]);
-
- if (Config::get('app.debug')) {
- $css->add(new FileAsset('styles/profiler.less'));
- $css->add(new FileAsset('styles/prettify.css'));
- }
-
- return $css;
+ return [
+ "styles/base/jquery-ui.css",
+ "styles/base/colorbox.css",
+ "styles/app.less",
+ "styles/profiler.less"
+ ];
} else if ($area == 'embed') {
- $css = new AssetCollection([
- new FileAsset('styles/embed.less'),
- ], [new \Assetic\Filter\LessFilter('node', Config::get('app.node_paths'))]);
-
- return $css;
+ return [
+ "styles/embed.less"
+ ];
}
throw new Exception();
diff --git a/public/scripts/app/app.coffee b/app/scripts/app/app.coffee
similarity index 100%
rename from public/scripts/app/app.coffee
rename to app/scripts/app/app.coffee
diff --git a/public/scripts/app/controllers/account-albums-edit.coffee b/app/scripts/app/controllers/account-albums-edit.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-albums-edit.coffee
rename to app/scripts/app/controllers/account-albums-edit.coffee
diff --git a/public/scripts/app/controllers/account-albums.coffee b/app/scripts/app/controllers/account-albums.coffee
similarity index 99%
rename from public/scripts/app/controllers/account-albums.coffee
rename to app/scripts/app/controllers/account-albums.coffee
index 78451c8e..b75344ec 100644
--- a/public/scripts/app/controllers/account-albums.coffee
+++ b/app/scripts/app/controllers/account-albums.coffee
@@ -7,6 +7,7 @@ window.pfm.preloaders['account-albums'] = [
angular.module('ponyfm').controller "account-albums", [
'$scope', '$state', 'account-albums', 'account-tracks'
($scope, $state, albums, tracks) ->
+
$scope.albums = []
$scope.data =
isEditorOpen: false
diff --git a/public/scripts/app/controllers/account-image-select.coffee b/app/scripts/app/controllers/account-image-select.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-image-select.coffee
rename to app/scripts/app/controllers/account-image-select.coffee
diff --git a/public/scripts/app/controllers/account-playlists.coffee b/app/scripts/app/controllers/account-playlists.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-playlists.coffee
rename to app/scripts/app/controllers/account-playlists.coffee
diff --git a/public/scripts/app/controllers/account-settings.coffee b/app/scripts/app/controllers/account-settings.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-settings.coffee
rename to app/scripts/app/controllers/account-settings.coffee
diff --git a/public/scripts/app/controllers/account-track.coffee b/app/scripts/app/controllers/account-track.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-track.coffee
rename to app/scripts/app/controllers/account-track.coffee
diff --git a/public/scripts/app/controllers/account-tracks.coffee b/app/scripts/app/controllers/account-tracks.coffee
similarity index 100%
rename from public/scripts/app/controllers/account-tracks.coffee
rename to app/scripts/app/controllers/account-tracks.coffee
diff --git a/public/scripts/app/controllers/album.coffee b/app/scripts/app/controllers/album.coffee
similarity index 100%
rename from public/scripts/app/controllers/album.coffee
rename to app/scripts/app/controllers/album.coffee
diff --git a/public/scripts/app/controllers/albums-list.coffee b/app/scripts/app/controllers/albums-list.coffee
similarity index 100%
rename from public/scripts/app/controllers/albums-list.coffee
rename to app/scripts/app/controllers/albums-list.coffee
diff --git a/public/scripts/app/controllers/albums.coffee b/app/scripts/app/controllers/albums.coffee
similarity index 100%
rename from public/scripts/app/controllers/albums.coffee
rename to app/scripts/app/controllers/albums.coffee
diff --git a/public/scripts/app/controllers/application.coffee b/app/scripts/app/controllers/application.coffee
similarity index 100%
rename from public/scripts/app/controllers/application.coffee
rename to app/scripts/app/controllers/application.coffee
diff --git a/public/scripts/app/controllers/artist-content.coffee b/app/scripts/app/controllers/artist-content.coffee
similarity index 100%
rename from public/scripts/app/controllers/artist-content.coffee
rename to app/scripts/app/controllers/artist-content.coffee
diff --git a/public/scripts/app/controllers/artist-favourites.coffee b/app/scripts/app/controllers/artist-favourites.coffee
similarity index 100%
rename from public/scripts/app/controllers/artist-favourites.coffee
rename to app/scripts/app/controllers/artist-favourites.coffee
diff --git a/public/scripts/app/controllers/artist-profile.coffee b/app/scripts/app/controllers/artist-profile.coffee
similarity index 100%
rename from public/scripts/app/controllers/artist-profile.coffee
rename to app/scripts/app/controllers/artist-profile.coffee
diff --git a/public/scripts/app/controllers/artist.coffee b/app/scripts/app/controllers/artist.coffee
similarity index 100%
rename from public/scripts/app/controllers/artist.coffee
rename to app/scripts/app/controllers/artist.coffee
diff --git a/public/scripts/app/controllers/artists-list.coffee b/app/scripts/app/controllers/artists-list.coffee
similarity index 100%
rename from public/scripts/app/controllers/artists-list.coffee
rename to app/scripts/app/controllers/artists-list.coffee
diff --git a/public/scripts/app/controllers/artists.coffee b/app/scripts/app/controllers/artists.coffee
similarity index 100%
rename from public/scripts/app/controllers/artists.coffee
rename to app/scripts/app/controllers/artists.coffee
diff --git a/public/scripts/app/controllers/dashboard.coffee b/app/scripts/app/controllers/dashboard.coffee
similarity index 100%
rename from public/scripts/app/controllers/dashboard.coffee
rename to app/scripts/app/controllers/dashboard.coffee
diff --git a/public/scripts/app/controllers/favourites-albums.coffee b/app/scripts/app/controllers/favourites-albums.coffee
similarity index 100%
rename from public/scripts/app/controllers/favourites-albums.coffee
rename to app/scripts/app/controllers/favourites-albums.coffee
diff --git a/public/scripts/app/controllers/favourites-playlists.coffee b/app/scripts/app/controllers/favourites-playlists.coffee
similarity index 100%
rename from public/scripts/app/controllers/favourites-playlists.coffee
rename to app/scripts/app/controllers/favourites-playlists.coffee
diff --git a/public/scripts/app/controllers/favourites-tracks.coffee b/app/scripts/app/controllers/favourites-tracks.coffee
similarity index 100%
rename from public/scripts/app/controllers/favourites-tracks.coffee
rename to app/scripts/app/controllers/favourites-tracks.coffee
diff --git a/public/scripts/app/controllers/home.coffee b/app/scripts/app/controllers/home.coffee
similarity index 100%
rename from public/scripts/app/controllers/home.coffee
rename to app/scripts/app/controllers/home.coffee
diff --git a/public/scripts/app/controllers/login.coffee b/app/scripts/app/controllers/login.coffee
similarity index 100%
rename from public/scripts/app/controllers/login.coffee
rename to app/scripts/app/controllers/login.coffee
diff --git a/public/scripts/app/controllers/playlist-form.coffee b/app/scripts/app/controllers/playlist-form.coffee
similarity index 100%
rename from public/scripts/app/controllers/playlist-form.coffee
rename to app/scripts/app/controllers/playlist-form.coffee
diff --git a/public/scripts/app/controllers/playlist.coffee b/app/scripts/app/controllers/playlist.coffee
similarity index 100%
rename from public/scripts/app/controllers/playlist.coffee
rename to app/scripts/app/controllers/playlist.coffee
diff --git a/public/scripts/app/controllers/playlists-list.coffee b/app/scripts/app/controllers/playlists-list.coffee
similarity index 100%
rename from public/scripts/app/controllers/playlists-list.coffee
rename to app/scripts/app/controllers/playlists-list.coffee
diff --git a/public/scripts/app/controllers/playlists.coffee b/app/scripts/app/controllers/playlists.coffee
similarity index 100%
rename from public/scripts/app/controllers/playlists.coffee
rename to app/scripts/app/controllers/playlists.coffee
diff --git a/public/scripts/app/controllers/sidebar.coffee b/app/scripts/app/controllers/sidebar.coffee
similarity index 100%
rename from public/scripts/app/controllers/sidebar.coffee
rename to app/scripts/app/controllers/sidebar.coffee
diff --git a/public/scripts/app/controllers/track.coffee b/app/scripts/app/controllers/track.coffee
similarity index 100%
rename from public/scripts/app/controllers/track.coffee
rename to app/scripts/app/controllers/track.coffee
diff --git a/public/scripts/app/controllers/tracks-list.coffee b/app/scripts/app/controllers/tracks-list.coffee
similarity index 100%
rename from public/scripts/app/controllers/tracks-list.coffee
rename to app/scripts/app/controllers/tracks-list.coffee
diff --git a/public/scripts/app/controllers/tracks.coffee b/app/scripts/app/controllers/tracks.coffee
similarity index 100%
rename from public/scripts/app/controllers/tracks.coffee
rename to app/scripts/app/controllers/tracks.coffee
diff --git a/public/scripts/app/controllers/uploader.coffee b/app/scripts/app/controllers/uploader.coffee
similarity index 100%
rename from public/scripts/app/controllers/uploader.coffee
rename to app/scripts/app/controllers/uploader.coffee
diff --git a/public/scripts/app/directives/albums-list.coffee b/app/scripts/app/directives/albums-list.coffee
similarity index 100%
rename from public/scripts/app/directives/albums-list.coffee
rename to app/scripts/app/directives/albums-list.coffee
diff --git a/public/scripts/app/directives/comments.coffee b/app/scripts/app/directives/comments.coffee
similarity index 100%
rename from public/scripts/app/directives/comments.coffee
rename to app/scripts/app/directives/comments.coffee
diff --git a/public/scripts/app/directives/eat-click.coffee b/app/scripts/app/directives/eat-click.coffee
similarity index 100%
rename from public/scripts/app/directives/eat-click.coffee
rename to app/scripts/app/directives/eat-click.coffee
diff --git a/public/scripts/app/directives/favouriteButton.coffee b/app/scripts/app/directives/favouriteButton.coffee
similarity index 100%
rename from public/scripts/app/directives/favouriteButton.coffee
rename to app/scripts/app/directives/favouriteButton.coffee
diff --git a/public/scripts/app/directives/image-upload.coffee b/app/scripts/app/directives/image-upload.coffee
similarity index 100%
rename from public/scripts/app/directives/image-upload.coffee
rename to app/scripts/app/directives/image-upload.coffee
diff --git a/public/scripts/app/directives/player.coffee b/app/scripts/app/directives/player.coffee
similarity index 100%
rename from public/scripts/app/directives/player.coffee
rename to app/scripts/app/directives/player.coffee
diff --git a/public/scripts/app/directives/playlists-list.coffee b/app/scripts/app/directives/playlists-list.coffee
similarity index 100%
rename from public/scripts/app/directives/playlists-list.coffee
rename to app/scripts/app/directives/playlists-list.coffee
diff --git a/public/scripts/app/directives/popup.coffee b/app/scripts/app/directives/popup.coffee
similarity index 100%
rename from public/scripts/app/directives/popup.coffee
rename to app/scripts/app/directives/popup.coffee
diff --git a/public/scripts/app/directives/progress-bar.coffee b/app/scripts/app/directives/progress-bar.coffee
similarity index 100%
rename from public/scripts/app/directives/progress-bar.coffee
rename to app/scripts/app/directives/progress-bar.coffee
diff --git a/public/scripts/app/directives/scroll-recorder.coffee b/app/scripts/app/directives/scroll-recorder.coffee
similarity index 100%
rename from public/scripts/app/directives/scroll-recorder.coffee
rename to app/scripts/app/directives/scroll-recorder.coffee
diff --git a/public/scripts/app/directives/share-buttons.coffee b/app/scripts/app/directives/share-buttons.coffee
similarity index 100%
rename from public/scripts/app/directives/share-buttons.coffee
rename to app/scripts/app/directives/share-buttons.coffee
diff --git a/public/scripts/app/directives/src-loader.coffee b/app/scripts/app/directives/src-loader.coffee
similarity index 100%
rename from public/scripts/app/directives/src-loader.coffee
rename to app/scripts/app/directives/src-loader.coffee
diff --git a/public/scripts/app/directives/track-player.coffee b/app/scripts/app/directives/track-player.coffee
similarity index 100%
rename from public/scripts/app/directives/track-player.coffee
rename to app/scripts/app/directives/track-player.coffee
diff --git a/public/scripts/app/directives/tracks-list.coffee b/app/scripts/app/directives/tracks-list.coffee
similarity index 100%
rename from public/scripts/app/directives/tracks-list.coffee
rename to app/scripts/app/directives/tracks-list.coffee
diff --git a/public/scripts/app/directives/uploader.coffee b/app/scripts/app/directives/uploader.coffee
similarity index 100%
rename from public/scripts/app/directives/uploader.coffee
rename to app/scripts/app/directives/uploader.coffee
diff --git a/public/scripts/app/filters/length.coffee b/app/scripts/app/filters/length.coffee
similarity index 100%
rename from public/scripts/app/filters/length.coffee
rename to app/scripts/app/filters/length.coffee
diff --git a/public/scripts/app/filters/moment-from-now.coffee b/app/scripts/app/filters/moment-from-now.coffee
similarity index 100%
rename from public/scripts/app/filters/moment-from-now.coffee
rename to app/scripts/app/filters/moment-from-now.coffee
diff --git a/public/scripts/app/filters/newlines.coffee b/app/scripts/app/filters/newlines.coffee
similarity index 100%
rename from public/scripts/app/filters/newlines.coffee
rename to app/scripts/app/filters/newlines.coffee
diff --git a/public/scripts/app/filters/noHTML.coffee b/app/scripts/app/filters/noHTML.coffee
similarity index 100%
rename from public/scripts/app/filters/noHTML.coffee
rename to app/scripts/app/filters/noHTML.coffee
diff --git a/public/scripts/app/filters/pfm-date.js b/app/scripts/app/filters/pfm-date.js
similarity index 100%
rename from public/scripts/app/filters/pfm-date.js
rename to app/scripts/app/filters/pfm-date.js
diff --git a/public/scripts/app/filters/seconds-display.coffee b/app/scripts/app/filters/seconds-display.coffee
similarity index 100%
rename from public/scripts/app/filters/seconds-display.coffee
rename to app/scripts/app/filters/seconds-display.coffee
diff --git a/public/scripts/app/filters/trust.coffee b/app/scripts/app/filters/trust.coffee
similarity index 100%
rename from public/scripts/app/filters/trust.coffee
rename to app/scripts/app/filters/trust.coffee
diff --git a/public/scripts/app/services/account-albums.coffee b/app/scripts/app/services/account-albums.coffee
similarity index 100%
rename from public/scripts/app/services/account-albums.coffee
rename to app/scripts/app/services/account-albums.coffee
diff --git a/public/scripts/app/services/account-tracks.coffee b/app/scripts/app/services/account-tracks.coffee
similarity index 100%
rename from public/scripts/app/services/account-tracks.coffee
rename to app/scripts/app/services/account-tracks.coffee
diff --git a/public/scripts/app/services/albums.coffee b/app/scripts/app/services/albums.coffee
similarity index 100%
rename from public/scripts/app/services/albums.coffee
rename to app/scripts/app/services/albums.coffee
diff --git a/public/scripts/app/services/artists.coffee b/app/scripts/app/services/artists.coffee
similarity index 100%
rename from public/scripts/app/services/artists.coffee
rename to app/scripts/app/services/artists.coffee
diff --git a/public/scripts/app/services/auth.coffee b/app/scripts/app/services/auth.coffee
similarity index 100%
rename from public/scripts/app/services/auth.coffee
rename to app/scripts/app/services/auth.coffee
diff --git a/public/scripts/app/services/comments.coffee b/app/scripts/app/services/comments.coffee
similarity index 100%
rename from public/scripts/app/services/comments.coffee
rename to app/scripts/app/services/comments.coffee
diff --git a/public/scripts/app/services/dashboard.coffee b/app/scripts/app/services/dashboard.coffee
similarity index 100%
rename from public/scripts/app/services/dashboard.coffee
rename to app/scripts/app/services/dashboard.coffee
diff --git a/public/scripts/app/services/favourites.coffee b/app/scripts/app/services/favourites.coffee
similarity index 100%
rename from public/scripts/app/services/favourites.coffee
rename to app/scripts/app/services/favourites.coffee
diff --git a/public/scripts/app/services/follow.coffee b/app/scripts/app/services/follow.coffee
similarity index 100%
rename from public/scripts/app/services/follow.coffee
rename to app/scripts/app/services/follow.coffee
diff --git a/public/scripts/app/services/images.coffee b/app/scripts/app/services/images.coffee
similarity index 100%
rename from public/scripts/app/services/images.coffee
rename to app/scripts/app/services/images.coffee
diff --git a/public/scripts/app/services/lightbox.coffee b/app/scripts/app/services/lightbox.coffee
similarity index 100%
rename from public/scripts/app/services/lightbox.coffee
rename to app/scripts/app/services/lightbox.coffee
diff --git a/public/scripts/app/services/player.coffee b/app/scripts/app/services/player.coffee
similarity index 100%
rename from public/scripts/app/services/player.coffee
rename to app/scripts/app/services/player.coffee
diff --git a/public/scripts/app/services/playlists.coffee b/app/scripts/app/services/playlists.coffee
similarity index 100%
rename from public/scripts/app/services/playlists.coffee
rename to app/scripts/app/services/playlists.coffee
diff --git a/public/scripts/app/services/taxonomies.coffee b/app/scripts/app/services/taxonomies.coffee
similarity index 100%
rename from public/scripts/app/services/taxonomies.coffee
rename to app/scripts/app/services/taxonomies.coffee
diff --git a/public/scripts/app/services/tracks.coffee b/app/scripts/app/services/tracks.coffee
similarity index 100%
rename from public/scripts/app/services/tracks.coffee
rename to app/scripts/app/services/tracks.coffee
diff --git a/public/scripts/app/services/upload.coffee b/app/scripts/app/services/upload.coffee
similarity index 100%
rename from public/scripts/app/services/upload.coffee
rename to app/scripts/app/services/upload.coffee
diff --git a/public/scripts/base/angular-ui-date.js b/app/scripts/base/angular-ui-date.js
similarity index 100%
rename from public/scripts/base/angular-ui-date.js
rename to app/scripts/base/angular-ui-date.js
diff --git a/public/scripts/base/angular-ui-router.js b/app/scripts/base/angular-ui-router.js
similarity index 100%
rename from public/scripts/base/angular-ui-router.js
rename to app/scripts/base/angular-ui-router.js
diff --git a/public/scripts/base/angular-ui-sortable.js b/app/scripts/base/angular-ui-sortable.js
similarity index 100%
rename from public/scripts/base/angular-ui-sortable.js
rename to app/scripts/base/angular-ui-sortable.js
diff --git a/public/scripts/base/angular.js b/app/scripts/base/angular.js
similarity index 100%
rename from public/scripts/base/angular.js
rename to app/scripts/base/angular.js
diff --git a/public/scripts/base/angularytics.js b/app/scripts/base/angularytics.js
similarity index 100%
rename from public/scripts/base/angularytics.js
rename to app/scripts/base/angularytics.js
diff --git a/public/scripts/base/bindonce.js b/app/scripts/base/bindonce.js
similarity index 100%
rename from public/scripts/base/bindonce.js
rename to app/scripts/base/bindonce.js
diff --git a/public/scripts/base/jquery-2.0.2.js b/app/scripts/base/jquery-2.0.2.js
similarity index 100%
rename from public/scripts/base/jquery-2.0.2.js
rename to app/scripts/base/jquery-2.0.2.js
diff --git a/public/scripts/base/jquery-ui.js b/app/scripts/base/jquery-ui.js
similarity index 100%
rename from public/scripts/base/jquery-ui.js
rename to app/scripts/base/jquery-ui.js
diff --git a/public/scripts/base/jquery.colorbox.js b/app/scripts/base/jquery.colorbox.js
similarity index 100%
rename from public/scripts/base/jquery.colorbox.js
rename to app/scripts/base/jquery.colorbox.js
diff --git a/public/scripts/base/jquery.cookie.js b/app/scripts/base/jquery.cookie.js
similarity index 100%
rename from public/scripts/base/jquery.cookie.js
rename to app/scripts/base/jquery.cookie.js
diff --git a/public/scripts/base/jquery.timeago.js b/app/scripts/base/jquery.timeago.js
similarity index 100%
rename from public/scripts/base/jquery.timeago.js
rename to app/scripts/base/jquery.timeago.js
diff --git a/public/scripts/base/jquery.viewport.js b/app/scripts/base/jquery.viewport.js
similarity index 100%
rename from public/scripts/base/jquery.viewport.js
rename to app/scripts/base/jquery.viewport.js
diff --git a/public/scripts/base/moment.js b/app/scripts/base/moment.js
similarity index 100%
rename from public/scripts/base/moment.js
rename to app/scripts/base/moment.js
diff --git a/public/scripts/base/soundmanager2-nodebug.js b/app/scripts/base/soundmanager2-nodebug.js
similarity index 100%
rename from public/scripts/base/soundmanager2-nodebug.js
rename to app/scripts/base/soundmanager2-nodebug.js
diff --git a/public/scripts/base/tumblr.js b/app/scripts/base/tumblr.js
similarity index 100%
rename from public/scripts/base/tumblr.js
rename to app/scripts/base/tumblr.js
diff --git a/public/scripts/base/ui-bootstrap-tpls-0.4.0.js b/app/scripts/base/ui-bootstrap-tpls-0.4.0.js
similarity index 100%
rename from public/scripts/base/ui-bootstrap-tpls-0.4.0.js
rename to app/scripts/base/ui-bootstrap-tpls-0.4.0.js
diff --git a/public/scripts/base/underscore.js b/app/scripts/base/underscore.js
similarity index 100%
rename from public/scripts/base/underscore.js
rename to app/scripts/base/underscore.js
diff --git a/public/scripts/debug/prettify.js b/app/scripts/debug/prettify.js
similarity index 100%
rename from public/scripts/debug/prettify.js
rename to app/scripts/debug/prettify.js
diff --git a/public/scripts/debug/profiler.coffee b/app/scripts/debug/profiler.coffee
similarity index 100%
rename from public/scripts/debug/profiler.coffee
rename to app/scripts/debug/profiler.coffee
diff --git a/public/scripts/embed/favourite.coffee b/app/scripts/embed/favourite.coffee
similarity index 100%
rename from public/scripts/embed/favourite.coffee
rename to app/scripts/embed/favourite.coffee
diff --git a/public/scripts/embed/player.coffee b/app/scripts/embed/player.coffee
similarity index 100%
rename from public/scripts/embed/player.coffee
rename to app/scripts/embed/player.coffee
diff --git a/public/scripts/shared/init.coffee b/app/scripts/shared/init.coffee
similarity index 100%
rename from public/scripts/shared/init.coffee
rename to app/scripts/shared/init.coffee
diff --git a/public/scripts/shared/jquery-extensions.js b/app/scripts/shared/jquery-extensions.js
similarity index 100%
rename from public/scripts/shared/jquery-extensions.js
rename to app/scripts/shared/jquery-extensions.js
diff --git a/public/scripts/shared/layout.coffee b/app/scripts/shared/layout.coffee
similarity index 100%
rename from public/scripts/shared/layout.coffee
rename to app/scripts/shared/layout.coffee
diff --git a/public/scripts/shared/underscore-extensions.js b/app/scripts/shared/underscore-extensions.js
similarity index 100%
rename from public/scripts/shared/underscore-extensions.js
rename to app/scripts/shared/underscore-extensions.js
diff --git a/public/styles/account-content.less b/app/styles/account-content.less
similarity index 100%
rename from public/styles/account-content.less
rename to app/styles/account-content.less
diff --git a/public/styles/animations.less b/app/styles/animations.less
similarity index 100%
rename from public/styles/animations.less
rename to app/styles/animations.less
diff --git a/public/styles/app.less b/app/styles/app.less
similarity index 100%
rename from public/styles/app.less
rename to app/styles/app.less
diff --git a/public/styles/base/bootstrap/accordion.less b/app/styles/base/bootstrap/accordion.less
similarity index 100%
rename from public/styles/base/bootstrap/accordion.less
rename to app/styles/base/bootstrap/accordion.less
diff --git a/public/styles/base/bootstrap/alerts.less b/app/styles/base/bootstrap/alerts.less
similarity index 100%
rename from public/styles/base/bootstrap/alerts.less
rename to app/styles/base/bootstrap/alerts.less
diff --git a/public/styles/base/bootstrap/bootstrap.less b/app/styles/base/bootstrap/bootstrap.less
similarity index 100%
rename from public/styles/base/bootstrap/bootstrap.less
rename to app/styles/base/bootstrap/bootstrap.less
diff --git a/public/styles/base/bootstrap/breadcrumbs.less b/app/styles/base/bootstrap/breadcrumbs.less
similarity index 100%
rename from public/styles/base/bootstrap/breadcrumbs.less
rename to app/styles/base/bootstrap/breadcrumbs.less
diff --git a/public/styles/base/bootstrap/button-groups.less b/app/styles/base/bootstrap/button-groups.less
similarity index 100%
rename from public/styles/base/bootstrap/button-groups.less
rename to app/styles/base/bootstrap/button-groups.less
diff --git a/public/styles/base/bootstrap/buttons.less b/app/styles/base/bootstrap/buttons.less
similarity index 100%
rename from public/styles/base/bootstrap/buttons.less
rename to app/styles/base/bootstrap/buttons.less
diff --git a/public/styles/base/bootstrap/carousel.less b/app/styles/base/bootstrap/carousel.less
similarity index 100%
rename from public/styles/base/bootstrap/carousel.less
rename to app/styles/base/bootstrap/carousel.less
diff --git a/public/styles/base/bootstrap/close.less b/app/styles/base/bootstrap/close.less
similarity index 100%
rename from public/styles/base/bootstrap/close.less
rename to app/styles/base/bootstrap/close.less
diff --git a/public/styles/base/bootstrap/code.less b/app/styles/base/bootstrap/code.less
similarity index 100%
rename from public/styles/base/bootstrap/code.less
rename to app/styles/base/bootstrap/code.less
diff --git a/public/styles/base/bootstrap/component-animations.less b/app/styles/base/bootstrap/component-animations.less
similarity index 100%
rename from public/styles/base/bootstrap/component-animations.less
rename to app/styles/base/bootstrap/component-animations.less
diff --git a/public/styles/base/bootstrap/dropdowns.less b/app/styles/base/bootstrap/dropdowns.less
similarity index 100%
rename from public/styles/base/bootstrap/dropdowns.less
rename to app/styles/base/bootstrap/dropdowns.less
diff --git a/public/styles/base/bootstrap/forms.less b/app/styles/base/bootstrap/forms.less
similarity index 100%
rename from public/styles/base/bootstrap/forms.less
rename to app/styles/base/bootstrap/forms.less
diff --git a/public/styles/base/bootstrap/grid.less b/app/styles/base/bootstrap/grid.less
similarity index 100%
rename from public/styles/base/bootstrap/grid.less
rename to app/styles/base/bootstrap/grid.less
diff --git a/public/styles/base/bootstrap/hero-unit.less b/app/styles/base/bootstrap/hero-unit.less
similarity index 100%
rename from public/styles/base/bootstrap/hero-unit.less
rename to app/styles/base/bootstrap/hero-unit.less
diff --git a/public/styles/base/bootstrap/labels-badges.less b/app/styles/base/bootstrap/labels-badges.less
similarity index 100%
rename from public/styles/base/bootstrap/labels-badges.less
rename to app/styles/base/bootstrap/labels-badges.less
diff --git a/public/styles/base/bootstrap/layouts.less b/app/styles/base/bootstrap/layouts.less
similarity index 100%
rename from public/styles/base/bootstrap/layouts.less
rename to app/styles/base/bootstrap/layouts.less
diff --git a/public/styles/base/bootstrap/media.less b/app/styles/base/bootstrap/media.less
similarity index 100%
rename from public/styles/base/bootstrap/media.less
rename to app/styles/base/bootstrap/media.less
diff --git a/public/styles/base/bootstrap/mixins.less b/app/styles/base/bootstrap/mixins.less
similarity index 100%
rename from public/styles/base/bootstrap/mixins.less
rename to app/styles/base/bootstrap/mixins.less
diff --git a/public/styles/base/bootstrap/modals.less b/app/styles/base/bootstrap/modals.less
similarity index 100%
rename from public/styles/base/bootstrap/modals.less
rename to app/styles/base/bootstrap/modals.less
diff --git a/public/styles/base/bootstrap/navbar.less b/app/styles/base/bootstrap/navbar.less
similarity index 100%
rename from public/styles/base/bootstrap/navbar.less
rename to app/styles/base/bootstrap/navbar.less
diff --git a/public/styles/base/bootstrap/navs.less b/app/styles/base/bootstrap/navs.less
similarity index 100%
rename from public/styles/base/bootstrap/navs.less
rename to app/styles/base/bootstrap/navs.less
diff --git a/public/styles/base/bootstrap/pager.less b/app/styles/base/bootstrap/pager.less
similarity index 100%
rename from public/styles/base/bootstrap/pager.less
rename to app/styles/base/bootstrap/pager.less
diff --git a/public/styles/base/bootstrap/pagination.less b/app/styles/base/bootstrap/pagination.less
similarity index 100%
rename from public/styles/base/bootstrap/pagination.less
rename to app/styles/base/bootstrap/pagination.less
diff --git a/public/styles/base/bootstrap/popovers.less b/app/styles/base/bootstrap/popovers.less
similarity index 100%
rename from public/styles/base/bootstrap/popovers.less
rename to app/styles/base/bootstrap/popovers.less
diff --git a/public/styles/base/bootstrap/progress-bars.less b/app/styles/base/bootstrap/progress-bars.less
similarity index 100%
rename from public/styles/base/bootstrap/progress-bars.less
rename to app/styles/base/bootstrap/progress-bars.less
diff --git a/public/styles/base/bootstrap/reset.less b/app/styles/base/bootstrap/reset.less
similarity index 100%
rename from public/styles/base/bootstrap/reset.less
rename to app/styles/base/bootstrap/reset.less
diff --git a/public/styles/base/bootstrap/responsive-1200px-min.less b/app/styles/base/bootstrap/responsive-1200px-min.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive-1200px-min.less
rename to app/styles/base/bootstrap/responsive-1200px-min.less
diff --git a/public/styles/base/bootstrap/responsive-767px-max.less b/app/styles/base/bootstrap/responsive-767px-max.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive-767px-max.less
rename to app/styles/base/bootstrap/responsive-767px-max.less
diff --git a/public/styles/base/bootstrap/responsive-768px-979px.less b/app/styles/base/bootstrap/responsive-768px-979px.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive-768px-979px.less
rename to app/styles/base/bootstrap/responsive-768px-979px.less
diff --git a/public/styles/base/bootstrap/responsive-navbar.less b/app/styles/base/bootstrap/responsive-navbar.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive-navbar.less
rename to app/styles/base/bootstrap/responsive-navbar.less
diff --git a/public/styles/base/bootstrap/responsive-utilities.less b/app/styles/base/bootstrap/responsive-utilities.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive-utilities.less
rename to app/styles/base/bootstrap/responsive-utilities.less
diff --git a/public/styles/base/bootstrap/responsive.less b/app/styles/base/bootstrap/responsive.less
similarity index 100%
rename from public/styles/base/bootstrap/responsive.less
rename to app/styles/base/bootstrap/responsive.less
diff --git a/public/styles/base/bootstrap/scaffolding.less b/app/styles/base/bootstrap/scaffolding.less
similarity index 100%
rename from public/styles/base/bootstrap/scaffolding.less
rename to app/styles/base/bootstrap/scaffolding.less
diff --git a/public/styles/base/bootstrap/sprites.less b/app/styles/base/bootstrap/sprites.less
similarity index 100%
rename from public/styles/base/bootstrap/sprites.less
rename to app/styles/base/bootstrap/sprites.less
diff --git a/public/styles/base/bootstrap/tables.less b/app/styles/base/bootstrap/tables.less
similarity index 100%
rename from public/styles/base/bootstrap/tables.less
rename to app/styles/base/bootstrap/tables.less
diff --git a/public/styles/base/bootstrap/thumbnails.less b/app/styles/base/bootstrap/thumbnails.less
similarity index 100%
rename from public/styles/base/bootstrap/thumbnails.less
rename to app/styles/base/bootstrap/thumbnails.less
diff --git a/public/styles/base/bootstrap/tooltip.less b/app/styles/base/bootstrap/tooltip.less
similarity index 100%
rename from public/styles/base/bootstrap/tooltip.less
rename to app/styles/base/bootstrap/tooltip.less
diff --git a/public/styles/base/bootstrap/type.less b/app/styles/base/bootstrap/type.less
similarity index 100%
rename from public/styles/base/bootstrap/type.less
rename to app/styles/base/bootstrap/type.less
diff --git a/public/styles/base/bootstrap/utilities.less b/app/styles/base/bootstrap/utilities.less
similarity index 100%
rename from public/styles/base/bootstrap/utilities.less
rename to app/styles/base/bootstrap/utilities.less
diff --git a/public/styles/base/bootstrap/variables.less b/app/styles/base/bootstrap/variables.less
similarity index 100%
rename from public/styles/base/bootstrap/variables.less
rename to app/styles/base/bootstrap/variables.less
diff --git a/public/styles/base/bootstrap/wells.less b/app/styles/base/bootstrap/wells.less
similarity index 100%
rename from public/styles/base/bootstrap/wells.less
rename to app/styles/base/bootstrap/wells.less
diff --git a/public/styles/base/colorbox.css b/app/styles/base/colorbox.css
similarity index 100%
rename from public/styles/base/colorbox.css
rename to app/styles/base/colorbox.css
diff --git a/public/styles/base/font-awesome/bootstrap.less b/app/styles/base/font-awesome/bootstrap.less
similarity index 100%
rename from public/styles/base/font-awesome/bootstrap.less
rename to app/styles/base/font-awesome/bootstrap.less
diff --git a/public/styles/base/font-awesome/core.less b/app/styles/base/font-awesome/core.less
similarity index 100%
rename from public/styles/base/font-awesome/core.less
rename to app/styles/base/font-awesome/core.less
diff --git a/public/styles/base/font-awesome/extras.less b/app/styles/base/font-awesome/extras.less
similarity index 100%
rename from public/styles/base/font-awesome/extras.less
rename to app/styles/base/font-awesome/extras.less
diff --git a/public/styles/base/font-awesome/font-awesome-ie7.less b/app/styles/base/font-awesome/font-awesome-ie7.less
similarity index 100%
rename from public/styles/base/font-awesome/font-awesome-ie7.less
rename to app/styles/base/font-awesome/font-awesome-ie7.less
diff --git a/public/styles/base/font-awesome/font-awesome.less b/app/styles/base/font-awesome/font-awesome.less
similarity index 100%
rename from public/styles/base/font-awesome/font-awesome.less
rename to app/styles/base/font-awesome/font-awesome.less
diff --git a/public/styles/base/font-awesome/icons.less b/app/styles/base/font-awesome/icons.less
similarity index 100%
rename from public/styles/base/font-awesome/icons.less
rename to app/styles/base/font-awesome/icons.less
diff --git a/public/styles/base/font-awesome/mixins.less b/app/styles/base/font-awesome/mixins.less
similarity index 100%
rename from public/styles/base/font-awesome/mixins.less
rename to app/styles/base/font-awesome/mixins.less
diff --git a/public/styles/base/font-awesome/path.less b/app/styles/base/font-awesome/path.less
similarity index 100%
rename from public/styles/base/font-awesome/path.less
rename to app/styles/base/font-awesome/path.less
diff --git a/public/styles/base/font-awesome/variables.less b/app/styles/base/font-awesome/variables.less
similarity index 100%
rename from public/styles/base/font-awesome/variables.less
rename to app/styles/base/font-awesome/variables.less
diff --git a/public/styles/base/images/animated-overlay.gif b/app/styles/base/images/animated-overlay.gif
similarity index 100%
rename from public/styles/base/images/animated-overlay.gif
rename to app/styles/base/images/animated-overlay.gif
diff --git a/public/styles/base/images/border.png b/app/styles/base/images/border.png
similarity index 100%
rename from public/styles/base/images/border.png
rename to app/styles/base/images/border.png
diff --git a/public/styles/base/images/controls.png b/app/styles/base/images/controls.png
similarity index 100%
rename from public/styles/base/images/controls.png
rename to app/styles/base/images/controls.png
diff --git a/public/styles/base/images/loading.gif b/app/styles/base/images/loading.gif
similarity index 100%
rename from public/styles/base/images/loading.gif
rename to app/styles/base/images/loading.gif
diff --git a/public/styles/base/images/loading_background.png b/app/styles/base/images/loading_background.png
similarity index 100%
rename from public/styles/base/images/loading_background.png
rename to app/styles/base/images/loading_background.png
diff --git a/public/styles/base/images/overlay.png b/app/styles/base/images/overlay.png
similarity index 100%
rename from public/styles/base/images/overlay.png
rename to app/styles/base/images/overlay.png
diff --git a/public/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/app/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png
similarity index 100%
rename from public/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png
rename to app/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png
diff --git a/public/styles/base/images/ui-bg_flat_75_ffffff_40x100.png b/app/styles/base/images/ui-bg_flat_75_ffffff_40x100.png
similarity index 100%
rename from public/styles/base/images/ui-bg_flat_75_ffffff_40x100.png
rename to app/styles/base/images/ui-bg_flat_75_ffffff_40x100.png
diff --git a/public/styles/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/app/styles/base/images/ui-bg_glass_55_fbf9ee_1x400.png
similarity index 100%
rename from public/styles/base/images/ui-bg_glass_55_fbf9ee_1x400.png
rename to app/styles/base/images/ui-bg_glass_55_fbf9ee_1x400.png
diff --git a/public/styles/base/images/ui-bg_glass_65_ffffff_1x400.png b/app/styles/base/images/ui-bg_glass_65_ffffff_1x400.png
similarity index 100%
rename from public/styles/base/images/ui-bg_glass_65_ffffff_1x400.png
rename to app/styles/base/images/ui-bg_glass_65_ffffff_1x400.png
diff --git a/public/styles/base/images/ui-bg_glass_75_dadada_1x400.png b/app/styles/base/images/ui-bg_glass_75_dadada_1x400.png
similarity index 100%
rename from public/styles/base/images/ui-bg_glass_75_dadada_1x400.png
rename to app/styles/base/images/ui-bg_glass_75_dadada_1x400.png
diff --git a/public/styles/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/app/styles/base/images/ui-bg_glass_75_e6e6e6_1x400.png
similarity index 100%
rename from public/styles/base/images/ui-bg_glass_75_e6e6e6_1x400.png
rename to app/styles/base/images/ui-bg_glass_75_e6e6e6_1x400.png
diff --git a/public/styles/base/images/ui-bg_glass_95_fef1ec_1x400.png b/app/styles/base/images/ui-bg_glass_95_fef1ec_1x400.png
similarity index 100%
rename from public/styles/base/images/ui-bg_glass_95_fef1ec_1x400.png
rename to app/styles/base/images/ui-bg_glass_95_fef1ec_1x400.png
diff --git a/public/styles/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/app/styles/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
similarity index 100%
rename from public/styles/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
rename to app/styles/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
diff --git a/public/styles/base/images/ui-icons_222222_256x240.png b/app/styles/base/images/ui-icons_222222_256x240.png
similarity index 100%
rename from public/styles/base/images/ui-icons_222222_256x240.png
rename to app/styles/base/images/ui-icons_222222_256x240.png
diff --git a/public/styles/base/images/ui-icons_2e83ff_256x240.png b/app/styles/base/images/ui-icons_2e83ff_256x240.png
similarity index 100%
rename from public/styles/base/images/ui-icons_2e83ff_256x240.png
rename to app/styles/base/images/ui-icons_2e83ff_256x240.png
diff --git a/public/styles/base/images/ui-icons_454545_256x240.png b/app/styles/base/images/ui-icons_454545_256x240.png
similarity index 100%
rename from public/styles/base/images/ui-icons_454545_256x240.png
rename to app/styles/base/images/ui-icons_454545_256x240.png
diff --git a/public/styles/base/images/ui-icons_888888_256x240.png b/app/styles/base/images/ui-icons_888888_256x240.png
similarity index 100%
rename from public/styles/base/images/ui-icons_888888_256x240.png
rename to app/styles/base/images/ui-icons_888888_256x240.png
diff --git a/public/styles/base/images/ui-icons_cd0a0a_256x240.png b/app/styles/base/images/ui-icons_cd0a0a_256x240.png
similarity index 100%
rename from public/styles/base/images/ui-icons_cd0a0a_256x240.png
rename to app/styles/base/images/ui-icons_cd0a0a_256x240.png
diff --git a/public/styles/base/jquery-ui.css b/app/styles/base/jquery-ui.css
similarity index 100%
rename from public/styles/base/jquery-ui.css
rename to app/styles/base/jquery-ui.css
diff --git a/public/styles/body.less b/app/styles/body.less
similarity index 98%
rename from public/styles/body.less
rename to app/styles/body.less
index 50814aed..874b8040 100644
--- a/public/styles/body.less
+++ b/app/styles/body.less
@@ -14,8 +14,7 @@ a {
padding: 10px;
h1 {
- margin: 0px;
- margin-bottom: 5px;
+ margin: 1px 1px 5px;
font-size: 15pt;
color: #C2889C;
line-height: normal;
diff --git a/public/styles/components.less b/app/styles/components.less
similarity index 100%
rename from public/styles/components.less
rename to app/styles/components.less
diff --git a/public/styles/content.less b/app/styles/content.less
similarity index 100%
rename from public/styles/content.less
rename to app/styles/content.less
diff --git a/public/styles/dashboard.less b/app/styles/dashboard.less
similarity index 97%
rename from public/styles/dashboard.less
rename to app/styles/dashboard.less
index d4950057..5cec0732 100644
--- a/public/styles/dashboard.less
+++ b/app/styles/dashboard.less
@@ -6,8 +6,7 @@
color: #fff;
font-size: 10pt;
padding: 5px;
- margin: 0px;
- margin-bottom: 5px;
+ margin: 0px 0px 5px;
}
}
diff --git a/public/styles/embed.less b/app/styles/embed.less
similarity index 100%
rename from public/styles/embed.less
rename to app/styles/embed.less
diff --git a/public/styles/forms.less b/app/styles/forms.less
similarity index 100%
rename from public/styles/forms.less
rename to app/styles/forms.less
diff --git a/public/styles/layout.less b/app/styles/layout.less
similarity index 100%
rename from public/styles/layout.less
rename to app/styles/layout.less
diff --git a/public/styles/mixins.less b/app/styles/mixins.less
similarity index 100%
rename from public/styles/mixins.less
rename to app/styles/mixins.less
diff --git a/public/styles/player.less b/app/styles/player.less
similarity index 100%
rename from public/styles/player.less
rename to app/styles/player.less
diff --git a/public/styles/prettify.css b/app/styles/prettify.css
similarity index 100%
rename from public/styles/prettify.css
rename to app/styles/prettify.css
diff --git a/public/styles/profiler.less b/app/styles/profiler.less
similarity index 100%
rename from public/styles/profiler.less
rename to app/styles/profiler.less
diff --git a/public/styles/uploader.less b/app/styles/uploader.less
similarity index 100%
rename from public/styles/uploader.less
rename to app/styles/uploader.less
diff --git a/public/styles/variables.less b/app/styles/variables.less
similarity index 100%
rename from public/styles/variables.less
rename to app/styles/variables.less
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 00000000..d3b3f892
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,140 @@
+var gulp = require("gulp"),
+ coffee = require("gulp-coffee"),
+ concat = require("gulp-concat"),
+ sourcemaps = require("gulp-sourcemaps"),
+ cached = require("gulp-cached"),
+ plumber = require("gulp-plumber"),
+ notify = require("gulp-notify"),
+ order = require("gulp-order"),
+ argv = require("yargs").argv,
+ gulpif = require("gulp-if"),
+ uglify = require("gulp-uglify"),
+ less = require("gulp-less"),
+ minifyCss = require('gulp-minify-css');
+
+var plumberOptions = {
+ errorHandler: notify.onError("Error: <%= error.message %>")
+};
+
+gulp.task("scripts-app", function() {
+ var paths = [
+ "app/scripts/app/**/*.{coffee,js}",
+ "app/scripts/base/**/*.{coffee,js}",
+ "app/scripts/shared/**/*.{coffee,js}"
+ ];
+
+ if (!argv.production) {
+ paths.push("app/scripts/debug/**/*.{coffee,js}");
+
+ // we also want to add the embed stuff, since we're in development mode
+ // we want to watch embed files and re-compile them. However, we want
+ // to leave this path out in production so that embed files are not bloating
+ // the js file
+ paths.push("app/scripts/embed/**/*.{coffee,js}");
+ }
+
+ return argv.production
+ // Production pipeline
+ ? gulp.src(paths, {base: "app/scripts"})
+ .pipe(plumber(plumberOptions))
+ .pipe(order([
+ "app/scripts/base/jquery-2.0.2.js",
+ "app/scripts/base/angular.js",
+ "app/scripts/base/*.{coffee,js}",
+ "app/scripts/shared/*.{coffee,js}",
+ "app/scripts/app/*.{coffee,js}",
+ "app/scripts/app/services/*.{coffee,js}",
+ "app/scripts/app/filters/*.{coffee,js}",
+ "app/scripts/app/directives/*.{coffee,js}",
+ "app/scripts/app/controllers/*.{coffee,js}",
+ "app/scripts/**/*.{coffee,js}"
+ ], {base: "."}))
+ .pipe(gulpif(/\.coffee/, coffee()))
+ .pipe(concat("app.js"))
+// .pipe(uglify())
+ .pipe(gulp.dest("public/build/scripts"))
+ // Development/watch pipeline
+ : gulp.src(paths, {base: "app/scripts"})
+ .pipe(plumber(plumberOptions))
+ .pipe(cached('scripts'))
+ .pipe(sourcemaps.init())
+ .pipe(gulpif(/\.coffee/, coffee()))
+ .pipe(sourcemaps.write())
+ .pipe(gulp.dest("public/build/scripts"));
+});
+
+gulp.task("scripts-embed", function() {
+ // note that this task should really only ever be invoked for production
+ // since development-mode watches and builds include the embed scripts
+ // already
+
+ var includedScripts = [
+ "app/scripts/base/jquery-2.0.2.js",
+ "app/scripts/base/jquery.viewport.js",
+ "app/scripts/base/underscore.js",
+ "app/scripts/base/moment.js",
+ "app/scripts/base/jquery.timeago.js",
+ "app/scripts/base/soundmanager2-nodebug.js",
+ "app/scripts/embed/*.coffee"
+ ];
+
+ return gulp.src(includedScripts, {base: "app/scripts"})
+ .pipe(plumber(plumberOptions))
+ .pipe(gulpif(/\.coffee/, coffee()))
+ .pipe(order(includedScripts, {base: "."}))
+ .pipe(concat("embed.js"))
+ .pipe(uglify())
+ .pipe(gulp.dest("public/build/scripts"));
+});
+
+gulp.task("styles-app", function() {
+ var includedStyles = [
+ "app/styles/base/jquery-ui.css",
+ "app/styles/base/colorbox.css",
+ "app/styles/app.less"
+ ];
+
+ if (!argv.production) {
+ includedStyles.push("app/styles/profiler.less");
+ includedStyles.push("app/styles/prettify.css");
+
+ // we also want to add the embed stuff, since we're in development mode
+ // we want to watch embed files and re-compile them. However, we want
+ // to leave this path out in production so that embed files are not bloating
+ // the css file
+ includedStyles.push("app/styles/embed.css");
+ }
+
+ return argv.production
+ // Production pipeline
+ ? gulp.src(includedStyles, {base: "app/styles"})
+ .pipe(plumber(plumberOptions))
+ .pipe(gulpif(/\.less/, less()))
+ .pipe(concat("app.css"))
+ .pipe(minifyCss())
+ .pipe(gulp.dest("public/build/styles"))
+ // Development pipeline
+ : gulp.src(includedStyles, {base: "app/styles"})
+ .pipe(plumber(plumberOptions))
+ .pipe(sourcemaps.init())
+ .pipe(gulpif(/\.less/, less()))
+ .pipe(sourcemaps.write())
+ .pipe(gulp.dest("public/build/styles"));
+});
+
+gulp.task("styles-embed", function() {
+ // note that this task should really only ever be invoked for production
+ // since development-mode watches and builds include the embed styles
+ // already
+
+ return gulp.src(["app/styles/embed.less"], {base: "app/styles"})
+ .pipe(less())
+ .pipe(concat("embed.css"))
+ .pipe(minifyCss())
+ .pipe(gulp.dest("public/build/styles"));
+});
+
+gulp.task("watch", function() {
+ gulp.watch("app/scripts/**/*.{coffee,js}", ["scripts-app"]);
+ gulp.watch("app/styles/**/*.{css,less}", ["styles-app"]);
+});
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..6f3133ad
--- /dev/null
+++ b/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "pony.fm",
+ "version": "1.0.0",
+ "repository": {
+ "type": "git",
+ "url": "ssh://git@phabricator.poniverse.net/diffusion/PF/pony-fm.git"
+ },
+ "packages": {},
+ "dependencies": {},
+ "devDependencies": {
+ "gulp": "^3.8.11",
+ "gulp-cached": "^1.0.4",
+ "gulp-coffee": "^2.3.1",
+ "gulp-concat": "^2.5.2",
+ "gulp-if": "^1.2.5",
+ "gulp-less": "^3.0.3",
+ "gulp-minify-css": "^1.1.0",
+ "gulp-notify": "^2.2.0",
+ "gulp-order": "^1.1.1",
+ "gulp-plumber": "^1.0.0",
+ "gulp-sourcemaps": "^1.5.1",
+ "gulp-uglify": "^1.2.0",
+ "gulp-util": "^3.0.4",
+ "yargs": "^3.7.2"
+ }
+}
diff --git a/pony.fm.iml b/pony.fm.iml
index 80cc7391..0a89f1ca 100644
--- a/pony.fm.iml
+++ b/pony.fm.iml
@@ -2,7 +2,10 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/public/asset.php b/public/asset.php
deleted file mode 100644
index ce56ef1c..00000000
--- a/public/asset.php
+++ /dev/null
@@ -1,71 +0,0 @@
-ensureFilter(new UglifyJs2Filter(Config::get('app.uglify-js'), Config::get('app.node')));
- $bundle->setTargetPath('scripts');
- } else {
- $filePath = trim($_GET['file'], '/');
- $bundle = new AssetCollection([new FileAsset($filePath)], [new CoffeeScriptFilter(Config::get('app.coffee'), Config::get('app.node'))]);
- $bundle->setTargetPath($filePath);
- }
-
- $bundle = new AssetCache($bundle, new FilesystemCache("$cacheDirectory/scripts"));
- } else if ($_GET['type'] == 'less') {
- header('Content-Type: text/css');
-
- if (!isset($_GET['file']) || !Config::get('app.debug')) {
- $bundle = Assets::styleAssetCollection($_GET['area']);
- $bundle->ensureFilter(new UglifyCssFilter(Config::get('app.uglify-css'), Config::get('app.node')));
- $bundle->setTargetPath('styles');
- } else {
- $node = Config::get('app.node');
- if ($node == null)
- $node = 'node';
-
- $filePath = trim($_GET['file'], '/');
- $lastModifiedCollection = new AssetCollection([new GlobAsset("styles/*.less")]);
- $bundle = new AssetCollection([new FileAsset($filePath), new CacheBusterAsset($lastModifiedCollection->getLastModified())],
- [new LessFilter($node, Config::get('app.node_paths'))]);
- $bundle->setTargetPath($filePath);
- }
-
- $bundle = new AssetCache($bundle, new FilesystemCache("$cacheDirectory/styles"));
- } else {
- exit();
- }
-
- $time = gmdate($bundle->getLastModified());
-
- if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $time == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
- header('HTTP/1.0 304 Not Modified');
- exit();
- }
-
- header('Last-Modified: ' . $time);
- header('Cache-Control: max-age=' . (60 * 60 * 24 * 7));
-
- echo $bundle->dump();
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 6b855257..d8690152 100644
--- a/readme.md
+++ b/readme.md
@@ -1,9 +1,28 @@
-## Requirements
+# Starting a dev environment
+To begin development, you must do two things:
+1. Ensure that you have the following hosts entries:
+> 192.168.33.11 pony.fm.local
+> 192.168.33.11 api.pony.fm.local
- - node.js must be installed, and the following modules must be installed globally:
- > npm -g install uglifycss
- > npm -g install uglify-js
- > npm -g install coffee-script
- > npm -g install less
+2. Run "vagrant up" from the folder in which you cloned the repository
- - you must specify a coffeescript, uglifycss and uglify-js path in your configuration file. If using the Windows installer, these will typically be found under "C:\Users\{{user}}\AppData\Roaming\npm"
\ No newline at end of file
+Once everything is up and running, you'll be able to access the site at http://pony.fm.local. You can access the MySQL database by logging into **192.168.33.11:3306** with the username of **homestead** and the password of **secret**. The pony.fm database is named **homestead**.
+
+# Asset pipeline
+Pony.fm uses gulp to mange its asset piepline. **Important** due to everything being awful, you must run npm and gulp from your host machine and not the VM. You must first have it installed globally:
+> npm install -g gulp
+
+And then install all of the required local packages by invoking:
+> npm install
+
+During development, you should make a point to run "gulp watch". You can do this simply by executing:
+> gulp watch
+
+This will watch and compile the .less and .coffee files in real time.
+
+# Configuring the servers
+Pony.fm uses nginx, php-fpm, redis, and MySQL. You can modify the configuration of these services by locating the appropriate config file in the "vagrant" folder. Once modified, you must reload the configuration by running the appropriate shell script (**reload-config.sh**) or bat files (**reload-config.bat** and **reload-config.vmware.bat**). These scripts simply tell Vagrant to run "copy-and-restart-config.sh" on the VM.
+
+If you need to change any other configuration file on the VM - copy the entire file over into the vagrant folder, make your changes, and update the "copy-and-restart-config.sh" script to copy the modified config back into the proper folder. All potential configuration requirements should be represented in the vagrant folder **and never only on the VM itself** as changes will not be preserved.
+
+**NOTE:** currently, Redis's configuration is not reloaded by the "copy-and-restart-config.sh"
\ No newline at end of file
diff --git a/vagrant/install.sh b/vagrant/install.sh
index 6de1240b..f3b2f637 100644
--- a/vagrant/install.sh
+++ b/vagrant/install.sh
@@ -6,12 +6,6 @@ cd /vagrant
/usr/local/bin/composer self-update
composer install
-sudo npm install -g bower
-sudo npm install -g coffee-script
-sudo npm install -g less
-
-bower install --allow-root
-
cp -r /vagrant/vagrant/config/* "/vagrant/app/config/local"
php artisan migrate
diff --git a/vagrant/pony.fm.nginx.site.config b/vagrant/pony.fm.nginx.site.config
index 8654d7e0..9786ef9e 100644
--- a/vagrant/pony.fm.nginx.site.config
+++ b/vagrant/pony.fm.nginx.site.config
@@ -33,9 +33,6 @@ server {
expires off;
- rewrite ^/(.*\.(?:coffee))$ /asset.php?type=coffee&file=/$1 break;
- rewrite ^/(.*\.(?:less))$ /asset.php?type=less&file=/$1 break;
-
error_page 404 /index.php;
error_page 403 /403.html;