diff --git a/app/generator.js b/app/generator.js index 915d5d380..a7d323b91 100644 --- a/app/generator.js +++ b/app/generator.js @@ -86,12 +86,11 @@ export default class Generator extends Base { type: 'list', name: 'script', message: 'What would you like to write scripts with?', - choices: [ 'JavaScript', 'JavaScript + Babel', 'CoffeeScript'], + choices: [ 'JavaScript', 'JavaScript + Babel'], filter: function( val ) { return { 'JavaScript': 'js', - 'JavaScript + Babel': 'babel', - 'CoffeeScript': 'coffee' + 'JavaScript + Babel': 'babel' }[val]; } }, { @@ -340,7 +339,6 @@ export default class Generator extends Base { if(this.filters.ngroute) filters.push('ngroute'); if(this.filters.uirouter) filters.push('uirouter'); if(this.filters.babel) extensions.push('babel'); - if(this.filters.coffee) extensions.push('coffee'); if(this.filters.js) extensions.push('js'); if(this.filters.html) extensions.push('html'); if(this.filters.jade) extensions.push('jade'); diff --git a/app/templates/.buildignore b/app/templates/.buildignore index 3ae6d06a2..e69de29bb 100644 --- a/app/templates/.buildignore +++ b/app/templates/.buildignore @@ -1 +0,0 @@ -*.coffee diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js index e480ee3ea..1168d75b0 100644 --- a/app/templates/Gruntfile.js +++ b/app/templates/Gruntfile.js @@ -106,14 +106,6 @@ module.exports = function (grunt) { jade: { files: ['<%%= yeoman.client %>/{app,components}/**/*.jade'], tasks: ['jade'] - },<% } if (filters.coffee) { %> - coffee: { - files: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec).{coffee,litcoffee,coffee.md}'], - tasks: ['newer:coffee', 'injector:scripts'] - }, - coffeeTest: { - files: ['<%%= yeoman.client %>/{app,components}/**/*.spec.{coffee,litcoffee,coffee.md}'], - tasks: ['karma'] },<% } %> gruntfile: { files: ['Gruntfile.js'] @@ -431,16 +423,14 @@ module.exports = function (grunt) { // Run some tasks in parallel to speed up the build process concurrent: { - server: [<% if(filters.coffee) { %> - 'coffee',<% } if(filters.babel) { %> + server: [<% if(filters.babel) { %> 'newer:babel:client',<% } if(filters.jade) { %> 'jade',<% } if(filters.stylus) { %> 'stylus',<% } if(filters.sass) { %> 'sass',<% } if(filters.less) { %> 'less',<% } %> ], - test: [<% if(filters.coffee) { %> - 'coffee',<% } if(filters.babel) { %> + test: [<% if(filters.babel) { %> 'newer:babel:client',<% } if(filters.jade) { %> 'jade',<% } if(filters.stylus) { %> 'stylus',<% } if(filters.sass) { %> @@ -456,8 +446,7 @@ module.exports = function (grunt) { logConcurrentOutput: true } }, - dist: [<% if(filters.coffee) { %> - 'coffee',<% } if(filters.babel) { %> + dist: [<% if(filters.babel) { %> 'newer:babel:client',<% } if(filters.jade) { %> 'jade',<% } if(filters.stylus) { %> 'stylus',<% } if(filters.sass) { %> @@ -565,23 +554,6 @@ module.exports = function (grunt) { ext: '.html' }] } - },<% } if (filters.coffee) { %> - - // Compiles CoffeeScript to JavaScript - coffee: { - options: { - sourceMap: true, - sourceRoot: '' - }, - server: { - files: [{ - expand: true, - cwd: 'client', - src: ['{app,components}/**/!(*.spec).coffee'], - dest: '.tmp', - ext: '.js' - }] - } },<% } %> // Compiles ES6 to JavaScript using Babel diff --git a/app/templates/_package.json b/app/templates/_package.json index 8017603f3..a53bc8991 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -48,8 +48,7 @@ "grunt-contrib-imagemin": "^0.9.4", "grunt-contrib-jshint": "~0.11.2", "grunt-contrib-uglify": "^0.9.1", - "grunt-contrib-watch": "~0.6.1",<% if (filters.coffee) { %> - "grunt-contrib-coffee": "^0.13.0",<% } %><% if (filters.jade) { %> + "grunt-contrib-watch": "~0.6.1",<% if (filters.jade) { %> "grunt-contrib-jade": "^0.15.0",<% } %><% if (filters.less) { %> "grunt-contrib-less": "^1.0.0",<% } %><% if(filters.babel) { %> "karma-babel-preprocessor": "^5.2.1", @@ -99,7 +98,6 @@ "karma-chrome-launcher": "~0.2.0", "requirejs": "~2.1.11", "karma-requirejs": "~0.2.2", - "karma-coffee-preprocessor": "~0.3.0", "karma-jade-preprocessor": "0.0.11", "karma-phantomjs-launcher": "~0.2.0", "karma": "~0.13.3", diff --git a/app/templates/client/app/account(auth)/account(coffee).coffee b/app/templates/client/app/account(auth)/account(coffee).coffee deleted file mode 100644 index c794d7f04..000000000 --- a/app/templates/client/app/account(auth)/account(coffee).coffee +++ /dev/null @@ -1,59 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -<% if (filters.ngroute) { %>.config ($routeProvider) -> - $routeProvider - .when '/login', - templateUrl: 'app/account/login/login.html' - controller: 'LoginCtrl' - - .when '/logout', - name: 'logout' - referrer: '/' - controller: ($location, $route, Auth) -> - referrer = $route.current.params.referrer or $route.current.referrer or "/" - Auth.logout() - $location.path referrer - - .when '/signup', - templateUrl: 'app/account/signup/signup.html' - controller: 'SignupCtrl' - - .when '/settings', - templateUrl: 'app/account/settings/settings.html' - controller: 'SettingsCtrl' - authenticate: true - -.run ($rootScope) -> - $rootScope.$on '$routeChangeStart', (event, next, current) -> - next.referrer = current.originalPath if next.name is "logout" and current and current.originalPath and not current.authenticate -<% } %><% if (filters.uirouter) { %>.config ($stateProvider) -> - $stateProvider - .state 'login', - url: '/login' - templateUrl: 'app/account/login/login.html' - controller: 'LoginCtrl' - - .state 'logout', - url: '/logout?referrer' - referrer: 'main' - controller: ($state, Auth) -> - referrer = $state.params.referrer or $state.current.referrer or "main" - Auth.logout() - $state.go referrer - - .state 'signup', - url: '/signup' - templateUrl: 'app/account/signup/signup.html' - controller: 'SignupCtrl' - - .state 'settings', - url: '/settings' - templateUrl: 'app/account/settings/settings.html' - controller: 'SettingsCtrl' - authenticate: true - -.run ($rootScope) -> - $rootScope.$on '$stateChangeStart', (event, next, nextParams, current) -> - next.referrer = current.name if next.name is "logout" and current and current.name and not current.authenticate -<% } %> diff --git a/app/templates/client/app/account(auth)/login/login.controller(coffee).coffee b/app/templates/client/app/account(auth)/login/login.controller(coffee).coffee deleted file mode 100644 index 2ba501a42..000000000 --- a/app/templates/client/app/account(auth)/login/login.controller(coffee).coffee +++ /dev/null @@ -1,20 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'LoginCtrl', ($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) -> - $scope.user = {} - $scope.errors = {} - $scope.login = (form) -> - $scope.submitted = true - - if form.$valid - # Logged in, redirect to home - Auth.login - email: $scope.user.email - password: $scope.user.password - - .then -> - <% if (filters.ngroute) { %>$location.path '/'<% } %><% if (filters.uirouter) { %>$state.go 'main'<% } %> - - .catch (err) -> - $scope.errors.other = err.message diff --git a/app/templates/client/app/account(auth)/settings/settings.controller(coffee).coffee b/app/templates/client/app/account(auth)/settings/settings.controller(coffee).coffee deleted file mode 100644 index e058f167e..000000000 --- a/app/templates/client/app/account(auth)/settings/settings.controller(coffee).coffee +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'SettingsCtrl', ($scope, User, Auth) -> - $scope.errors = {} - $scope.changePassword = (form) -> - $scope.submitted = true - - if form.$valid - Auth.changePassword $scope.user.oldPassword, $scope.user.newPassword - .then -> - $scope.message = 'Password successfully changed.' - - .catch -> - form.password.$setValidity 'mongoose', false - $scope.errors.other = 'Incorrect password' - $scope.message = '' diff --git a/app/templates/client/app/account(auth)/signup/signup.controller(coffee).coffee b/app/templates/client/app/account(auth)/signup/signup.controller(coffee).coffee deleted file mode 100644 index 68952a74d..000000000 --- a/app/templates/client/app/account(auth)/signup/signup.controller(coffee).coffee +++ /dev/null @@ -1,33 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'SignupCtrl', ($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) -> - $scope.user = {} - $scope.errors = {} - $scope.register = (form) -> - $scope.submitted = true - - if form.$valid - # Account created, redirect to home - Auth.createUser - name: $scope.user.name - email: $scope.user.email - password: $scope.user.password - - .then -> - <% if (filters.ngroute) { %>$location.path '/'<% } %><% if (filters.uirouter) { %>$state.go 'main'<% } %> - - .catch (err) -> - err = err.data - $scope.errors = {} -<% if (filters.mongooseModels) { %> - # Update validity of form fields that match the mongoose errors - angular.forEach err.errors, (error, field) -> - form[field].$setValidity 'mongoose', false - $scope.errors[field] = error.message<% } - if (filters.sequelizeModels) { %> - # Update validity of form fields that match the sequelize errors - if err.name - angular.forEach err.fields, (field) -> - form[field].$setValidity 'mongoose', false - $scope.errors[field] = err.message<% } %> diff --git a/app/templates/client/app/admin(auth)/admin(coffee).coffee b/app/templates/client/app/admin(auth)/admin(coffee).coffee deleted file mode 100644 index 99b49177f..000000000 --- a/app/templates/client/app/admin(auth)/admin(coffee).coffee +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -<% if (filters.ngroute) { %>.config ($routeProvider) -> - $routeProvider - .when '/admin', - templateUrl: 'app/admin/admin.html' - controller: 'AdminCtrl' -<% } %><% if (filters.uirouter) { %>.config ($stateProvider) -> - $stateProvider - .state 'admin', - url: '/admin' - templateUrl: 'app/admin/admin.html' - controller: 'AdminCtrl' -<% } %> diff --git a/app/templates/client/app/admin(auth)/admin.controller(coffee).coffee b/app/templates/client/app/admin(auth)/admin.controller(coffee).coffee deleted file mode 100644 index 04af43178..000000000 --- a/app/templates/client/app/admin(auth)/admin.controller(coffee).coffee +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'AdminCtrl', ($scope, $http, Auth, User) -> - - $scope.users = User.query() - - $scope.delete = (user) -> - User.remove id: user._id - $scope.users.splice @$index, 1 diff --git a/app/templates/client/app/app(coffee).coffee b/app/templates/client/app/app(coffee).coffee deleted file mode 100644 index 6458ca920..000000000 --- a/app/templates/client/app/app(coffee).coffee +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>', [<%- angularModules %>] -<% if (filters.ngroute) { %>.config ($routeProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) -> - $routeProvider - .otherwise - redirectTo: '/' - - $locationProvider.html5Mode true<% if (filters.auth) { %> - $httpProvider.interceptors.push 'authInterceptor'<% } %> -<% } %><% if (filters.uirouter) { %>.config ($stateProvider, $urlRouterProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) -> - $urlRouterProvider - .otherwise '/' - - $locationProvider.html5Mode true<% if (filters.auth) { %> - $httpProvider.interceptors.push 'authInterceptor'<% } %> -<% } %><% if (filters.auth) { %> -.factory 'authInterceptor', ($rootScope, $q, $cookies<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $injector<% } %>) -> - <% if (filters.uirouter) { %>state = null - <% } %># Add authorization token to headers - request: (config) -> - config.headers = config.headers or {} - config.headers.Authorization = 'Bearer ' + $cookies.get 'token' if $cookies.get 'token' - config - - # Intercept 401s and redirect you to login - responseError: (response) -> - if response.status is 401 - <% if (filters.ngroute) { %>$location.path '/login'<% } if (filters.uirouter) { %>(state || state = $injector.get '$state').go 'login'<% } %> - # remove any stale tokens - $cookies.remove 'token' - - $q.reject response - -.run ($rootScope<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>, Auth) -> - # Redirect to login if route requires auth and the user is not logged in - $rootScope.$on <% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, (event, next) -> - if next.authenticate - Auth.isLoggedIn (loggedIn) -> - if !loggedIn - event.preventDefault() - <% if (filters.ngroute) { %>$location.path '/login'<% } %><% if (filters.uirouter) { %>$state.go 'login'<% }} %> diff --git a/app/templates/client/app/main/main(coffee).coffee b/app/templates/client/app/main/main(coffee).coffee deleted file mode 100644 index 04cd367bb..000000000 --- a/app/templates/client/app/main/main(coffee).coffee +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -<% if (filters.ngroute) { %>.config ($routeProvider) -> - $routeProvider - .when '/', - templateUrl: 'app/main/main.html' - controller: 'MainCtrl' -<% } %><% if (filters.uirouter) { %>.config ($stateProvider) -> - $stateProvider - .state 'main', - url: '/' - templateUrl: 'app/main/main.html' - controller: 'MainCtrl' -<% } %> diff --git a/app/templates/client/app/main/main.controller(coffee).coffee b/app/templates/client/app/main/main.controller(coffee).coffee deleted file mode 100644 index fdd03c644..000000000 --- a/app/templates/client/app/main/main.controller(coffee).coffee +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'MainCtrl', ($scope, $http<% if (filters.socketio) { %>, socket<% } %>) -> - $scope.awesomeThings = [] - - $http.get('/api/things').then (response) -> - $scope.awesomeThings = response.data - <% if (filters.socketio) { %>socket.syncUpdates 'thing', $scope.awesomeThings<% } %> -<% if (filters.models) { %> - $scope.addThing = -> - return if $scope.newThing is '' - $http.post '/api/things', - name: $scope.newThing - - $scope.newThing = '' - - $scope.deleteThing = (thing) -> - $http.delete '/api/things/' + thing._id<% } %><% if (filters.socketio) { %> - - $scope.$on '$destroy', -> - socket.unsyncUpdates 'thing'<% } %> diff --git a/app/templates/client/app/main/main.controller.spec(coffee).coffee b/app/templates/client/app/main/main.controller.spec(coffee).coffee deleted file mode 100644 index 0284253d7..000000000 --- a/app/templates/client/app/main/main.controller.spec(coffee).coffee +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -describe 'Controller: MainCtrl', -> - - # load the controller's module - beforeEach module '<%= scriptAppName %>' <% if (filters.uirouter) {%> - beforeEach module 'stateMock' <% } %><% if (filters.socketio) {%> - beforeEach module 'socketMock' <% } %> - - MainCtrl = undefined - scope = undefined<% if (filters.uirouter) {%> - state = undefined<% } %> - $httpBackend = undefined - - # Initialize the controller and a mock scope - beforeEach inject (_$httpBackend_, $controller, $rootScope<% if (filters.uirouter) {%>, $state<% } %>) -> - $httpBackend = _$httpBackend_ - $httpBackend.expectGET('/api/things').respond [ - 'HTML5 Boilerplate' - 'AngularJS' - 'Karma' - 'Express' - ] - scope = $rootScope.$new()<% if (filters.uirouter) {%> - state = $state<% } %> - MainCtrl = $controller 'MainCtrl', - $scope: scope - - it 'should attach a list of things to the scope', -> - $httpBackend.flush()<% if (filters.jasmine) { %> - expect(scope.awesomeThings.length).toBe 4 <% } if (filters.mocha) { %> - <%= expect() %>scope.awesomeThings.length<%= to() %>.equal 4<% } %> diff --git a/app/templates/client/components/auth(auth)/auth.service(coffee).coffee b/app/templates/client/components/auth(auth)/auth.service(coffee).coffee deleted file mode 100644 index 2892d04ed..000000000 --- a/app/templates/client/components/auth(auth)/auth.service(coffee).coffee +++ /dev/null @@ -1,150 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.factory 'Auth', ($http, User, $cookies, $q) -> - currentUser = if $cookies.get 'token' then User.get() else {} - - ### - Authenticate user and save token - - @param {Object} user - login info - @param {Function} callback - optional, function(error, user) - @return {Promise} - ### - login: (user, callback) -> - $http.post '/auth/local', - email: user.email - password: user.password - - .then (res) -> - $cookies.put 'token', res.data.token - currentUser = User.get() - currentUser.$promise - - .then (user) -> - callback? null, user - user - - .catch (err) => - @logout() - callback? err.data - $q.reject err.data - - - ### - Delete access token and user info - ### - logout: -> - $cookies.remove 'token' - currentUser = {} - return - - - ### - Create a new user - - @param {Object} user - user info - @param {Function} callback - optional, function(error, user) - @return {Promise} - ### - createUser: (user, callback) -> - User.save user, - (data) -> - $cookies.put 'token', data.token - currentUser = User.get() - callback? null, user - - , (err) => - @logout() - callback? err - - .$promise - - - ### - Change password - - @param {String} oldPassword - @param {String} newPassword - @param {Function} callback - optional, function(error, user) - @return {Promise} - ### - changePassword: (oldPassword, newPassword, callback) -> - User.changePassword - id: currentUser._id - , - oldPassword: oldPassword - newPassword: newPassword - - , () -> - callback? null - - , (err) -> - callback? err - - .$promise - - - ### - Gets all available info on a user - (synchronous|asynchronous) - - @param {Function|*} callback - optional, funciton(user) - @return {Object|Promise} - ### - getCurrentUser: (callback) -> - return currentUser if arguments.length is 0 - - value = if (currentUser.hasOwnProperty("$promise")) then currentUser.$promise else currentUser - $q.when value - - .then (user) -> - callback? user - user - - , -> - callback? {} - {} - - - ### - Check if a user is logged in - (synchronous|asynchronous) - - @param {Function|*} callback - optional, function(is) - @return {Bool|Promise} - ### - isLoggedIn: (callback) -> - return currentUser.hasOwnProperty("role") if arguments.length is 0 - - @getCurrentUser null - - .then (user) -> - is_ = user.hasOwnProperty("role") - callback? is_ - is_ - - - ### - Check if a user is an admin - (synchronous|asynchronous) - - @param {Function|*} callback - optional, function(is) - @return {Bool|Promise} - ### - isAdmin: (callback) -> - return currentUser.role is "admin" if arguments.length is 0 - - @getCurrentUser null - - .then (user) -> - is_ = user.role is "admin" - callback? is_ - is_ - - - ### - Get auth token - ### - getToken: -> - $cookies.get 'token' diff --git a/app/templates/client/components/auth(auth)/user.service(coffee).coffee b/app/templates/client/components/auth(auth)/user.service(coffee).coffee deleted file mode 100644 index e0dc2e839..000000000 --- a/app/templates/client/components/auth(auth)/user.service(coffee).coffee +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.factory 'User', ($resource) -> - $resource '/api/users/:id/:controller', - id: '@_id' - , - changePassword: - method: 'PUT' - params: - controller: 'password' - - get: - method: 'GET' - params: - id: 'me' - diff --git a/app/templates/client/components/footer/footer.directive(coffee).coffee b/app/templates/client/components/footer/footer.directive(coffee).coffee deleted file mode 100644 index 467006759..000000000 --- a/app/templates/client/components/footer/footer.directive(coffee).coffee +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.directive 'footer', -> - templateUrl: 'components/footer/footer.html' - restrict: 'E', - link: (scope, element) -> - element.addClass('footer') diff --git a/app/templates/client/components/modal(uibootstrap)/modal.service(coffee).coffee b/app/templates/client/components/modal(uibootstrap)/modal.service(coffee).coffee deleted file mode 100644 index eae01f69f..000000000 --- a/app/templates/client/components/modal(uibootstrap)/modal.service(coffee).coffee +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.factory 'Modal', ($rootScope, $modal) -> - - ### - Opens a modal - @param {Object} scope - an object to be merged with modal's scope - @param {String} modalClass - (optional) class(es) to be applied to the modal - @return {Object} - the instance $modal.open() returns - ### - openModal = (scope, modalClass) -> - modalScope = $rootScope.$new() - scope = scope or {} - modalClass = modalClass or 'modal-default' - angular.extend modalScope, scope - $modal.open - templateUrl: 'components/modal/modal.html' - windowClass: modalClass - scope: modalScope - - - # Public API here - - # Confirmation modals - confirm: - - ### - Create a function to open a delete confirmation modal (ex. ng-click='myModalFn(name, arg1, arg2...)') - @param {Function} del - callback, ran when delete is confirmed - @return {Function} - the function to open the modal (ex. myModalFn) - ### - delete: (del) -> - del = del or angular.noop - - ### - Open a delete confirmation modal - @param {String} name - name or info to show on modal - @param {All} - any additional args are passed staight to del callback - ### - -> - args = Array::slice.call arguments - name = args.shift() - deleteModal = undefined - deleteModal = openModal( - modal: - dismissable: true - title: 'Confirm Delete' - html: '
Are you sure you want to delete ' + name + ' ?
' - buttons: [ - { - classes: 'btn-danger' - text: 'Delete' - click: (e) -> - deleteModal.close e - return - } - { - classes: 'btn-default' - text: 'Cancel' - click: (e) -> - deleteModal.dismiss e - return - } - ] - , 'modal-danger') - deleteModal.result.then (event) -> - del.apply event, args - return - - return diff --git a/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive(coffee).coffee b/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive(coffee).coffee deleted file mode 100644 index cf0e1ccf0..000000000 --- a/app/templates/client/components/mongoose-error(auth)/mongoose-error.directive(coffee).coffee +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -### -Removes server error when user updates input -### -angular.module '<%= scriptAppName %>' -.directive 'mongooseError', -> - restrict: 'A' - require: 'ngModel' - link: (scope, element, attrs, ngModel) -> - element.on 'keydown', -> - ngModel.$setValidity 'mongoose', true diff --git a/app/templates/client/components/navbar/navbar.controller(coffee).coffee b/app/templates/client/components/navbar/navbar.controller(coffee).coffee deleted file mode 100644 index 98eaf2213..000000000 --- a/app/templates/client/components/navbar/navbar.controller(coffee).coffee +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.controller 'NavbarCtrl', ($scope<% if(!filters.uirouter) { %>, $location<% } %><% if (filters.auth) {%>, Auth<% } %>) -> - $scope.menu = [ - title: 'Home' - <% if (filters.uirouter) { %>state: 'main'<% } else { %>link: '/'<% } %> - ] - $scope.isCollapsed = true<% if (filters.auth) {%> - $scope.isLoggedIn = Auth.isLoggedIn - $scope.isAdmin = Auth.isAdmin - $scope.getCurrentUser = Auth.getCurrentUser<% } %><% if(!filters.uirouter) { %> - - $scope.isActive = (route) -> - route is $location.path()<% } %> diff --git a/app/templates/client/components/navbar/navbar.directive(coffee).coffee b/app/templates/client/components/navbar/navbar.directive(coffee).coffee deleted file mode 100644 index bea476822..000000000 --- a/app/templates/client/components/navbar/navbar.directive(coffee).coffee +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -angular.module '<%= scriptAppName %>' -.directive 'navbar', -> - templateUrl: 'components/navbar/navbar.html' - restrict: 'E' - controller: 'NavbarCtrl' diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller(coffee).coffee b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller(coffee).coffee deleted file mode 100644 index 4dca2832f..000000000 --- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller(coffee).coffee +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -angular.module('<%= scriptAppName %>') -.controller 'OauthButtonsCtrl', ($window) -> - @loginOauth = (provider) -> - $window.location.href = '/auth/' + provider - return; diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec(coffee).coffee b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec(coffee).coffee deleted file mode 100644 index 59b4dd9e4..000000000 --- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.controller.spec(coffee).coffee +++ /dev/null @@ -1,20 +0,0 @@ -'use strict' - -describe 'Controller: OauthButtonsCtrl', -> - # load the controller's module - beforeEach module('<%= scriptAppName %>') - - OauthButtonsCtrl = null - $window = null - - # Initialize the controller and a mock $window - beforeEach inject ($controller) -> - $window = location: {} - OauthButtonsCtrl = $controller 'OauthButtonsCtrl', $window: $window - return - - it 'should attach loginOauth', -><% if (filters.jasmine) { %> - expect(OauthButtonsCtrl.loginOauth).toEqual jasmine.any Function<% } if (filters.mocha) { %> - <%= expect() %>OauthButtonsCtrl.loginOauth<%= to() %>.be.a 'function' <% } %> - return - return diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive(coffee).coffee b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive(coffee).coffee deleted file mode 100644 index f009e5b1d..000000000 --- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive(coffee).coffee +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -angular.module('<%= scriptAppName %>') -.directive 'oauthButtons', -> - templateUrl: 'components/oauth-buttons/oauth-buttons.html' - restrict: 'EA' - controller: 'OauthButtonsCtrl' - controllerAs: 'OauthButtons' - scope: classes: '@' diff --git a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec(coffee).coffee b/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec(coffee).coffee deleted file mode 100644 index 903d05476..000000000 --- a/app/templates/client/components/oauth-buttons(oauth)/oauth-buttons.directive.spec(coffee).coffee +++ /dev/null @@ -1,51 +0,0 @@ -'use strict' - -describe 'Directive: oauthButtons', -> - # load the directive's module and view - beforeEach module('<%= scriptAppName %>') - beforeEach module('components/oauth-buttons/oauth-buttons.html') - - element = null - parentScope = null - elementScope = null - - compileDirective = (template) -> - inject ($compile) -> - element = angular.element template - element = $compile(element) parentScope - parentScope.$digest() - elementScope = element.isolateScope() - - beforeEach inject ($rootScope) -> - parentScope = $rootScope.$new() - - it 'should contain anchor buttons', -> - compileDirective '