Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cd562d5
Merge pull request #10 from NoshSpot/bowerRefactor
dng-vcnt Sep 21, 2016
b1d8ce3
Save
dng-vcnt Sep 21, 2016
3a750c4
Clean up customer
dng-vcnt Sep 22, 2016
163eff1
Merge branch 'dev' into style
dng-vcnt Sep 22, 2016
7890055
Merge pull request #11 from NoshSpot/style
Sep 22, 2016
9bbce1c
Integrate stripe with the frontend
Sep 22, 2016
cc24e1e
Merge pull request #12 from NoshSpot/stripeIntegration
rdowdy Sep 22, 2016
f7719f2
Avg. reviews / Add reviews / Removed cart
superfastshoes Sep 23, 2016
3aa30c2
Add order/orderitem factories. Create new order when customer checks out
rdowdy Sep 23, 2016
6b91a43
Get customerId from stateParams
rdowdy Sep 23, 2016
f1bda9d
Login page update
superfastshoes Sep 23, 2016
2f5883d
Merge conflicts
rdowdy Sep 23, 2016
aaa37db
Pass around customerId stateParams. Change default state to login
rdowdy Sep 23, 2016
4bd6f29
Merge pull request #13 from NoshSpot/customerReview
superfastshoes Sep 23, 2016
e0c44b3
Post a payment to the database
rdowdy Sep 23, 2016
2b425a4
resolve merge conflict
rdowdy Sep 23, 2016
604b134
Merge pull request #14 from NoshSpot/postorder
rdowdy Sep 23, 2016
1376483
Add stripe and menu items to order history
dng-vcnt Sep 23, 2016
6829814
Fixed merge conflicts
dng-vcnt Sep 23, 2016
0d9494b
Merge conflict
dng-vcnt Sep 23, 2016
24cc4a1
Merge pull request #15 from NoshSpot/orderhistory
rdowdy Sep 23, 2016
9da8780
add new customer form
dng-vcnt Sep 23, 2016
ab46425
Merge branch 'dev' of https://github.com/NoshSpot/Customer into addcu…
dng-vcnt Sep 23, 2016
0c938e4
Merge pull request #16 from NoshSpot/addcustomer
dng-vcnt Sep 23, 2016
a70cc6c
Designed the Customer User Interface
mkempinsky Sep 23, 2016
3c04033
fixed merge conflict
mkempinsky Sep 23, 2016
9c8a045
Merge pull request #17 from NoshSpot/customerDesign
DreuStepanik Sep 23, 2016
d1deb33
style updates
mkempinsky Sep 24, 2016
d5c6c91
style updates
mkempinsky Sep 24, 2016
036be43
style
mkempinsky Sep 24, 2016
bf58976
style
mkempinsky Sep 24, 2016
19733f6
Merge pull request #18 from NoshSpot/customerDesign
mkempinsky Sep 24, 2016
190e959
Merge branch 'dev' into customerDesign
DreuStepanik Sep 25, 2016
0368504
Added Extra Details to the Customer User Interface
DreuStepanik Sep 25, 2016
4249b07
Merge pull request #19 from NoshSpot/customerDesign
DreuStepanik Sep 25, 2016
ac9f31a
Disable buy button if the order is no longer valid
rdowdy Sep 26, 2016
bc92b37
Add customerId parameter to all pages, and make sure it's being used …
rdowdy Sep 26, 2016
25d9af8
Fix addReview
rdowdy Sep 26, 2016
787b4b0
Merge pull request #20 from NoshSpot/morebugfixes
rdowdy Sep 26, 2016
f533f70
style
mkempinsky Sep 26, 2016
5e73cfd
Merge pull request #21 from NoshSpot/customerDesign
mkempinsky Sep 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
410 changes: 408 additions & 2 deletions app/css/custom.css

Large diffs are not rendered by default.

Binary file added app/img/city.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/foodImage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/fooddelivery.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/gathering.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/goodQuality.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/mainFoodBackground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/personTexting.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/pizza.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 32 additions & 21 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,54 @@
<head>
<meta charset="UTF-8">
<title>NoshSpot - Customer</title>
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/angular-toastr/dist/angular-toastr.css" />
<link rel="stylesheet" href="bower_components/bulma/css/bulma.css" />
<!-- endbower -->
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<!-- inject:css -->
<link rel="stylesheet" href="css/custom.css">
<!-- endinject -->
</head>
<body>
<nav class="nav">
<div class="nav-left">
<a id="navName" class="nav-item is-brand" >
NoshSpot
</a>
</div>

<span class="nav-toggle">
<span></span>
<span></span>
<span></span>
</span>
<div class="nav-right nav-menu">
<a class="nav-item nav-link" ui-sref="restaurants.list">Restuarants</a>
</div>
</nav>
<hr>
<main>
<div ui-view></div>
</main>

<footer class="footer">
<div class="container">
<div class="content has-text-centered">
<p>
<strong>NoshSpot Creators:</strong> Dreu Stepanik, Michele Kempinsky, Ryan Dowdy, Herberto Basulto, Cole Logan, Jason Land, Reggie Sibbley, Christian Nagal, Vincent Duong
</p>
</div>
</div>
</footer>

<!-- stripe CDN -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-toastr/dist/angular-toastr.tpls.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angular-stripe-checkout/angular-stripe-checkout.js"></script>
<!-- endbower -->

<!-- inject:js -->
<script src="../node_modules/angular/angular.js"></script>
<script src="../node_modules/angular-ui-router/release/angular-ui-router.js"></script>
<script src="../node_modules/angular-toastr/dist/angular-toastr.js"></script>
<script src="../node_modules/angular-toastr/dist/angular-toastr.tpls.js"></script>
<script src="js/app.module.js"></script>
<script src="js/core/crud.factory.js"></script>
<script src="js/core/customer.factory.js"></script>
<script src="js/core/order.factory.js"></script>
<script src="js/core/orderItem.factory.js"></script>
<script src="js/core/payment.factory.js"></script>
<script src="js/core/restaurant.factory.js"></script>
<script src="js/core/review.factory.js"></script>
<script src="js/orders/orders.controller.js"></script>
<script src="js/core/stripePayment.factory.js"></script>
<script src="js/login/login.controller.js"></script>
<script src="js/orders/orders.controller.js"></script>
<script src="js/restaurant/restaurant.detail.controller.js"></script>
<script src="js/restaurant/restaurant.list.controller.js"></script>
<!-- endinject -->
Expand Down
52 changes: 28 additions & 24 deletions app/js/app.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,47 @@
'use strict';

angular
.module('app', ['ui.router', 'toastr'])
.module('app', ['ui.router', 'toastr', 'stripe.checkout'])
.value('apiUrl', 'http://localhost:61815/api')
.config(appConfig);

appConfig.$inject = ['$urlRouterProvider', '$stateProvider'];
appConfig.$inject = ['$urlRouterProvider', '$stateProvider', 'StripeCheckoutProvider'];

function appConfig($urlRouterProvider, $stateProvider) {
function appConfig($urlRouterProvider, $stateProvider, StripeCheckoutProvider) {

$urlRouterProvider.otherwise('/restaurants');
StripeCheckoutProvider.defaults({
key: 'pk_test_XE4OKSyJR5b8YXIX41XXEsN6'
});

$stateProvider
.state('restaurants', {
url: '/restaurants',
abstract: true,
template: '<div ui-view></div>'
})
$urlRouterProvider.otherwise('/login');

$stateProvider
.state('restaurants', {
url: '/restaurants',
abstract: true,
template: '<div ui-view></div>'
})
.state('restaurants.list', {
url: '/list',
url: '/list?customerId',
controller: 'RestaurantListController as restaurantList',
templateUrl: 'js/restaurant/restaurantList.html'
})
.state('restaurants.detail', {
url: '/detail?restaurantId',
url: '/detail?restaurantId?customerId',
controller: 'RestaurantDetailController as restaurantDetail',
templateUrl: 'js/restaurant/restaurant.detail.html'//Make sure this works
templateUrl: 'js/restaurant/restaurant.detail.html' //Make sure this works
})
.state('login', {
url: '/login',
controller: 'LoginController as login',
templateUrl: 'js/login/login.html'
})
.state('login', {
url: '/login',
controller: 'LoginController as login',
templateUrl: 'js/login/login.html'
})
.state('orders', {
url: '/orders',
controller: 'OrdersController as orders',
templateUrl: 'js/orders/orders.html'
})
.state('orders', {
url: '/orders?customerId',
controller: 'OrdersController as orders',
templateUrl: 'js/orders/orders.html'
});

}

})();
})();
26 changes: 13 additions & 13 deletions app/js/core/crud.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@

////////////////

function getAll() {
var deferred = $q.defer();

$http.get(endpoint)
.success(function(data) {
deferred.resolve(data);
})
.error(function(error) {
console.log(error);
deferred.reject('There was a problem fetching ' + entityName.toLowerCase() + 's.');
});

return deferred.promise;
function getAll() {
var deferred = $q.defer();

$http.get(endpoint)
.success(function(data) {
deferred.resolve(data);
})
.error(function(error) {
console.log(error);
deferred.reject('There was a problem fetching ' + entityName.toLowerCase() + 's.');
});

return deferred.promise;
}

function getById(id) {
Expand Down
14 changes: 14 additions & 0 deletions app/js/core/order.factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function() {
'use strict';

angular
.module('app')
.factory('OrderFactory', OrderFactory);

OrderFactory.$inject = ['$http', '$q', 'CRUDFactory', 'apiUrl'];

/* @ngInject */
function OrderFactory($http, $q, CRUDFactory, apiUrl) {
return CRUDFactory(apiUrl + '/orders', 'order');
}
})();
14 changes: 14 additions & 0 deletions app/js/core/orderItem.factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function() {
'use strict';

angular
.module('app')
.factory('OrderItemFactory', OrderItemFactory);

OrderItemFactory.$inject = ['$http', '$q', 'CRUDFactory', 'apiUrl'];

/* @ngInject */
function OrderItemFactory($http, $q, CRUDFactory, apiUrl) {
return CRUDFactory(apiUrl + '/orderItems', 'orderItem');
}
})();
14 changes: 14 additions & 0 deletions app/js/core/payment.factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function() {
'use strict';

angular
.module('app')
.factory('PaymentFactory', PaymentFactory);

PaymentFactory.$inject = ['$http', '$q', 'CRUDFactory', 'apiUrl'];

/* @ngInject */
function PaymentFactory($http, $q, CRUDFactory, apiUrl) {
return CRUDFactory(apiUrl + '/payments', 'payment');
}
})();
14 changes: 14 additions & 0 deletions app/js/core/stripePayment.factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function() {
'use strict';

angular
.module('app')
.factory('StripePaymentFactory', StripePaymentFactory);

StripePaymentFactory.$inject = ['$http', '$q', 'CRUDFactory', 'apiUrl'];

/* @ngInject */
function StripePaymentFactory($http, $q, CRUDFactory, apiUrl) {
return CRUDFactory(apiUrl + '/payments/charge', 'payment');
}
})();
38 changes: 35 additions & 3 deletions app/js/login/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,55 @@
.module('app')
.controller('LoginController', LoginController);

LoginController.$inject = ['$state', '$stateParams'];
LoginController.$inject = ['$state', '$stateParams', 'customerFactory'];

/* @ngInject */
function LoginController($state, $stateParams) {
function LoginController($state, $stateParams, customerFactory) {
var vm = this;
vm.title = 'LoginController';
vm.loginInfo = {};
vm.customers;
vm.newCustomer = {};
vm.expand = false;

vm.loginCustomer = loginCustomer;
vm.addNewCustomer = addNewCustomer;

allCustomers();
////////////////

function allCustomers() {
customerFactory.getAll().then(
function(data){
vm.customers = data;
}
);
}

function addNewCustomer(newCustomer){
if (vm.password === vm.confirmPassword) {
customerFactory.add(newCustomer).then(
function(data){
console.log(data);
$state.go('restaurants.list', {customerId: data.customerId});
},
function(error){
console.log(error);
}
);
}
else {
alert("Passwords do not match");
}
}

function loginCustomer() {
if(vm.loginInfo.password != 'butts') {
alert("You entered the wrong password");
}
else
{
$state.go('restaurants.list');
$state.go('restaurants.list', {customerId: vm.selectedCustomer});
}
}
}
Expand Down
Loading