diff --git a/Dockerfile b/Dockerfile index 18865b9..64dd2d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ #FROM digitallyseamless/nodejs-bower-grunt-runtime -FROM fergalmoran/node +FROM node ENV NODE_ENV production diff --git a/Gruntfile.js b/Gruntfile.js index 8c02e20..7585fd6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -436,7 +436,7 @@ module.exports = function (grunt) { dist: [ 'jade', 'less', - 'imagemin', + //'imagemin', 'svgmin' ] }, diff --git a/bower.json b/bower.json index 19423bb..f9ee6c3 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "version": "0.0.0", "dependencies": { "angular": "~1.4.3", - "angular-animate": "*", + "angular-animate": "~1.4.3", "angular-bootstrap": "~0.14.3", "angular-cookies": ">=1.2.*", "angular-deferred-bootstrap": "~0.1.7", @@ -27,8 +27,6 @@ "json3": "~3.3.1", "lodash": "~2.4.1", "moment": "~2.9.0", - "ng-file-upload": "~3.2.4", - "ng-file-upload-shim": "~3.2.4", "notifyjs": "~0.3.2", "oauth-js": "~0.4.3", "remarkable-bootstrap-notify": "~3.1.3", @@ -38,11 +36,13 @@ "satellizer": "~0.13.3", "ngInfiniteScroll": "1.2.1", "angular-socket-io": "^0.7.0", - "socket.io-client": "^1.4.6", "angular-toastr": "^1.7.0", "ngclipboard": "^1.1.1", "clipboard": "^1.5.12", - "soundmanager2": "*" + "soundmanager2": "*", + "socket.io-client": "^1.7.2", + "font-awesome": "fontawesome#^4.7.0", + "ng-file-upload": "^12.2.13" }, "devDependencies": { "angular-mocks": ">=1.2.*", @@ -51,4 +51,4 @@ "resolutions": { "angular": "1.4.*" } -} \ No newline at end of file +} diff --git a/client/app/components/footer/player.css b/client/app/components/footer/player.css index 7f6eac0..649ee43 100644 --- a/client/app/components/footer/player.css +++ b/client/app/components/footer/player.css @@ -279,4 +279,4 @@ .webPlayer.audioPlayer .fullScreenOFF { display: none -} \ No newline at end of file +} diff --git a/client/app/components/navbar/navbar.less b/client/app/components/navbar/navbar.less index 9c52ccd..0ff3cca 100644 --- a/client/app/components/navbar/navbar.less +++ b/client/app/components/navbar/navbar.less @@ -1,3 +1,11 @@ .dropdown-menu.extended { - width: 318px !important; -} \ No newline at end of file + width: 380px !important; +} + +.navbar-podcast-icon{ + color: orangered; +} + +.navbar-playlist-icon{ + color: deepskyblue; +} diff --git a/client/app/directives/audio/audio.player.html b/client/app/directives/audio/audio.player.html index 285f42d..91a0238 100644 --- a/client/app/directives/audio/audio.player.html +++ b/client/app/directives/audio/audio.player.html @@ -13,7 +13,9 @@ {{mix.user.display_name}}
- +
+ +
-
@@ -68,4 +71,4 @@
- \ No newline at end of file + diff --git a/client/app/views/mixes/mixes.controller.js b/client/app/views/mixes/mixes.controller.js index 2a5e96b..8b1e338 100644 --- a/client/app/views/mixes/mixes.controller.js +++ b/client/app/views/mixes/mixes.controller.js @@ -1,18 +1,30 @@ -'use strict'; +"use strict"; -angular.module('dssWebApp') - .controller('MixesCtrl', function ($scope, mixes, MixModel, AudioService) { +angular.module("dssWebApp") + .controller("MixesCtrl", function ($scope, $stateParams, mixes, MixModel) { console.log("MixesCtrl", $scope); + + var infiniteScrollQuery = { + page: $scope.page, + waveform_generated: "True", + is_featured: "True", + limit: 3 + }; + //bit ugly but have to check if we should show breadcrumbs + $scope.breadcrumbs = []; + if ($stateParams.playlist !== undefined) { + $scope.breadcrumbs = [ + {name: 'Playlists', state: 'root.playlists'}, + {name: $stateParams.playlist} + ]; + infiniteScrollQuery['playlist__slug'] = $stateParams.playlist; + } $scope.mixes = mixes; $scope.page = 1; $scope.nextPage = function (e) { $scope.page++; - MixModel.findAll({ - page: $scope.page, - waveform_generated: "True", - is_featured: "True", - limit: 3 - }); + + MixModel.findAll(infiniteScrollQuery); }; - MixModel.bindAll(null, $scope, 'mixes'); + //MixModel.bindAll(null, $scope, "mixes"); }); diff --git a/client/assets/fonts/bootstrap/glyphicons-halflings-regular.eot b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.eot differ diff --git a/client/assets/fonts/bootstrap/glyphicons-halflings-regular.svg b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf differ diff --git a/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff differ diff --git a/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/client/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 differ diff --git a/client/assets/fonts/font-awesome/FontAwesome.otf b/client/assets/fonts/font-awesome/FontAwesome.otf new file mode 100644 index 0000000..d4de13e Binary files /dev/null and b/client/assets/fonts/font-awesome/FontAwesome.otf differ diff --git a/client/assets/fonts/font-awesome/fontawesome-webfont.eot b/client/assets/fonts/font-awesome/fontawesome-webfont.eot new file mode 100644 index 0000000..c7b00d2 Binary files /dev/null and b/client/assets/fonts/font-awesome/fontawesome-webfont.eot differ diff --git a/client/assets/fonts/font-awesome/fontawesome-webfont.svg b/client/assets/fonts/font-awesome/fontawesome-webfont.svg new file mode 100644 index 0000000..8b66187 --- /dev/null +++ b/client/assets/fonts/font-awesome/fontawesome-webfont.svg @@ -0,0 +1,685 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/assets/fonts/font-awesome/fontawesome-webfont.ttf b/client/assets/fonts/font-awesome/fontawesome-webfont.ttf new file mode 100644 index 0000000..f221e50 Binary files /dev/null and b/client/assets/fonts/font-awesome/fontawesome-webfont.ttf differ diff --git a/client/assets/fonts/font-awesome/fontawesome-webfont.woff b/client/assets/fonts/font-awesome/fontawesome-webfont.woff new file mode 100644 index 0000000..6e7483c Binary files /dev/null and b/client/assets/fonts/font-awesome/fontawesome-webfont.woff differ diff --git a/client/assets/fonts/font-awesome/fontawesome-webfont.woff2 b/client/assets/fonts/font-awesome/fontawesome-webfont.woff2 new file mode 100644 index 0000000..7eb74fd Binary files /dev/null and b/client/assets/fonts/font-awesome/fontawesome-webfont.woff2 differ diff --git a/docker_build.sh b/docker_build.sh old mode 100644 new mode 100755 diff --git a/server/.eslintrc b/server/.eslintrc new file mode 100644 index 0000000..849296d --- /dev/null +++ b/server/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc", + "env": { + "node": true + } +} diff --git a/server/api/thing/index.js b/server/api/thing/index.js new file mode 100644 index 0000000..fe0d7b1 --- /dev/null +++ b/server/api/thing/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var express = require('express'); +var controller = require('./thing.controller'); + +var router = express.Router(); + +router.get('/', controller.index); + +module.exports = router; diff --git a/server/api/thing/index.spec.js b/server/api/thing/index.spec.js new file mode 100644 index 0000000..f3ee07a --- /dev/null +++ b/server/api/thing/index.spec.js @@ -0,0 +1,35 @@ +'use strict'; + +var proxyquire = require('proxyquire').noPreserveCache(); + +var thingCtrlStub = { + index: 'thingCtrl.index' +}; + +var routerStub = { + get: sinon.spy() +}; + +// require the index with our stubbed out modules +var thingIndex = proxyquire('./index.js', { + express: { + Router() { + return routerStub; + } + }, + './thing.controller': thingCtrlStub +}); + +describe('Thing API Router:', function() { + it('should return an express router instance', function() { + expect(thingIndex).to.equal(routerStub); + }); + + describe('GET /api/things', function() { + it('should route to thing.controller.index', function() { + expect(routerStub.get + .withArgs('/', 'thingCtrl.index') + ).to.have.been.calledOnce; + }); + }); +}); diff --git a/server/api/thing/thing.controller.js b/server/api/thing/thing.controller.js new file mode 100644 index 0000000..7b567da --- /dev/null +++ b/server/api/thing/thing.controller.js @@ -0,0 +1,11 @@ +/** + * Using Rails-like standard naming convention for endpoints. + * GET /api/things -> index + */ + +'use strict'; + +// Gets a list of Things +export function index(req, res) { + res.json([]); +} diff --git a/server/api/thing/thing.integration.js b/server/api/thing/thing.integration.js new file mode 100644 index 0000000..ea1be8b --- /dev/null +++ b/server/api/thing/thing.integration.js @@ -0,0 +1,28 @@ +'use strict'; + +var app = require('../..'); +import request from 'supertest'; + +describe('Thing API:', function() { + describe('GET /api/things', function() { + var things; + + beforeEach(function(done) { + request(app) + .get('/api/things') + .expect(200) + .expect('Content-Type', /json/) + .end((err, res) => { + if(err) { + return done(err); + } + things = res.body; + done(); + }); + }); + + it('should respond with JSON array', function() { + expect(things).to.be.instanceOf(Array); + }); + }); +}); diff --git a/server/app.js b/server/app.js index 27eeda0..5336fe8 100644 --- a/server/app.js +++ b/server/app.js @@ -8,12 +8,13 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'development'; var express = require('express'); +var session = require('express-session'); var config = require('./config/environment'); + // Setup server var app = express(); - var cookieParser = require('cookie-parser'); -var session = require('cookie-session'); +var cookieSession = require('cookie-session'); var server = require('http').createServer(app); var socketio = require('socket.io')(server, { @@ -31,7 +32,10 @@ app.engine('mustache', mustacheExpress()); app.set('view engine', 'mustache'); app.set('views', __dirname + '/views'); app.use(cookieParser); -app.use(session); +app.use(cookieSession({ + domain: 'www.deepsouthsounds.com', + keys: ['key1', 'key2'], +})); // Start server server.listen(config.port, config.ip, function () { diff --git a/server/config/environment/shared.js b/server/config/environment/shared.js new file mode 100644 index 0000000..64a5eab --- /dev/null +++ b/server/config/environment/shared.js @@ -0,0 +1,6 @@ +'use strict'; + +exports = module.exports = { + // List of user roles + userRoles: ['guest', 'user', 'admin'] +}; diff --git a/server/config/local.env.sample.js b/server/config/local.env.sample.js new file mode 100644 index 0000000..bf4df45 --- /dev/null +++ b/server/config/local.env.sample.js @@ -0,0 +1,14 @@ +'use strict'; + +// Use local.env.js for environment variables that will be set when the server starts locally. +// Use for your api keys, secrets, etc. This file should not be tracked by git. +// +// You will need to set these on the server you deploy to. + +module.exports = { + DOMAIN: 'http://localhost:9000', + SESSION_SECRET: 'dssweb-secret', + + // Control debug level for modules using visionmedia/debug + DEBUG: '' +}; diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..cc279f5 --- /dev/null +++ b/server/index.js @@ -0,0 +1,12 @@ +'use strict'; + +// Set default node environment to development +var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development'; + +if(env === 'development' || env === 'test') { + // Register the Babel require hook + require('babel-register'); +} + +// Export the application +exports = module.exports = require('./app'); diff --git a/server/views/404.html b/server/views/404.html new file mode 100644 index 0000000..ec98e3c --- /dev/null +++ b/server/views/404.html @@ -0,0 +1,157 @@ + + + + + Page Not Found :( + + + +
+

Not found :(

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+ + + +
+ +