mirror of
https://github.com/fergalmoran/roboto-promoto.git
synced 2025-12-22 01:30:36 +00:00
Routes scaffolding figured out
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp', [
|
||||
angular.module('robotoPromotoApp', [
|
||||
'ngCookies',
|
||||
'ngResource',
|
||||
'ngSanitize',
|
||||
@@ -25,6 +25,10 @@ angular.module('robotoApp', [
|
||||
controller: 'SettingsCtrl',
|
||||
authenticate: true
|
||||
})
|
||||
.when('/promotions', {
|
||||
templateUrl: 'partials/promotions',
|
||||
controller: 'PromotionsCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/'
|
||||
});
|
||||
@@ -55,4 +59,4 @@ angular.module('robotoApp', [
|
||||
$location.path('/login');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.controller('LoginCtrl', function ($scope, Auth, $location) {
|
||||
$scope.user = {};
|
||||
$scope.errors = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.controller('MainCtrl', function ($scope, $http) {
|
||||
$http.get('/api/awesomeThings').success(function(awesomeThings) {
|
||||
$scope.awesomeThings = awesomeThings;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.controller('NavbarCtrl', function ($scope, $location, Auth) {
|
||||
$scope.menu = [{
|
||||
'title': 'Home',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.controller('SettingsCtrl', function ($scope, User, Auth) {
|
||||
$scope.errors = {};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.controller('SignupCtrl', function ($scope, Auth, $location) {
|
||||
$scope.user = {};
|
||||
$scope.errors = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
|
||||
/**
|
||||
* Removes server error when user updates input
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.factory('Auth', function Auth($location, $rootScope, Session, User, $cookieStore) {
|
||||
|
||||
// Get currentUser from cookie
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.factory('Session', function ($resource) {
|
||||
return $resource('/api/session/');
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('robotoApp')
|
||||
angular.module('robotoPromotoApp')
|
||||
.factory('User', function ($resource) {
|
||||
return $resource('/api/users/:id', {
|
||||
id: '@id'
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
<!-- endbuild -->
|
||||
<!-- build:css({.tmp,app}) styles/main.css -->
|
||||
<link rel="stylesheet" href="styles/main.css">
|
||||
<link rel="stylesheet" href="bower_components/ng-grid/ng-grid.min.css"></link>
|
||||
<!-- endbuild -->
|
||||
</head>
|
||||
<body ng-app="robotoApp">
|
||||
<body ng-app="robotoPromotoApp">
|
||||
<!--[if lt IE 7]>
|
||||
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
||||
<![endif]-->
|
||||
@@ -57,6 +58,7 @@
|
||||
<script src="scripts/app.js"></script>
|
||||
<script src="scripts/controllers/main.js"></script>
|
||||
<script src="scripts/controllers/navbar.js"></script>
|
||||
<script src="scripts/controllers/promotions.js"></script>
|
||||
<script src="scripts/controllers/login.js"></script>
|
||||
<script src="scripts/controllers/signup.js"></script>
|
||||
<script src="scripts/controllers/settings.js"></script>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
|
||||
<a ng-href="{{item.link}}">{{item.title}}</a>
|
||||
</li>
|
||||
<li ng-hide="currentUser" ng-class="{active: isActive('/promotions')}"><a href="/promotions">Promotions</a></li>
|
||||
<li ng-hide="currentUser" ng-class="{active: isActive('/login')}"><a href="/login">Login</a></li>
|
||||
<li ng-hide="currentUser" ng-class="{active: isActive('/signup')}"><a href="/signup">Sign up</a></li>
|
||||
<li ng-show="currentUser" ng-class="{active: isActive('/logout')}"><a href="" ng-click="logout()">Logout</a></li>
|
||||
|
||||
@@ -19,8 +19,8 @@ User.find({}).remove(function() {
|
||||
);
|
||||
});
|
||||
|
||||
console.log("Creating promotions");
|
||||
Promotion.find({}).remove(function(){
|
||||
console.log("Creating promotions");
|
||||
Promotion.create({
|
||||
title: 'Dev prom 1',
|
||||
user: user
|
||||
@@ -30,7 +30,7 @@ Promotion.find({}).remove(function(){
|
||||
}, {
|
||||
title: 'Dev prom 3',
|
||||
user: user
|
||||
}, function(){
|
||||
}, function(err){
|
||||
console.log('finished populating promotions');
|
||||
});
|
||||
});
|
||||
|
||||
8
lib/config/env/development.js
vendored
8
lib/config/env/development.js
vendored
@@ -1,8 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
env: 'development',
|
||||
mongo: {
|
||||
uri: 'mongodb://localhost/roboto-dev'
|
||||
}
|
||||
env: 'development',
|
||||
mongo: {
|
||||
uri: 'mongodb://localhost/roboto-dev'
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user