Skip to content

Commit

Permalink
added extra details
Browse files Browse the repository at this point in the history
  • Loading branch information
gane5hvarma committed Aug 8, 2018
1 parent c397a85 commit 92a1511
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/passport-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var express=require("express")
var User=require("../models/userLog.js")
var credentials=require("./credentials.js")
const moment=require("moment")
const _=require("underscore");


//google auth
Expand All @@ -14,8 +15,7 @@ passport.use(new googleStrategy({
clientSecret: process.env.google_clientSecret || credentials.google.clientSecret,
callbackURL: process.env.google_callbackURL || credentials.google.callbackURL
},function(accessToken,refreshToken,profile,done){

if(profile._json.domain==="hyderabad.bits-pilani.ac.in"){
if(!_.isEmpty(profile._json)){
if(profile.emails[0].value==="f20150284@hyderabad.bits-pilani.ac.in"){
done(null,"admin");
}
Expand Down
20 changes: 19 additions & 1 deletion controllers/cart.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const cartHelper = require('./../helpers/cart.helper');
const path=require("path")
const path=require("path");
const _ =require("underscore")

const getCartItems = (req, res) => {
cartHelper.getCartItems(req.session.email).then((data)=>{
Expand All @@ -18,6 +19,7 @@ const saveCartItem=(req,res)=>{

const viewCartItems=(req,res)=>{
cartHelper.getCartItems(req.session.email).then((data)=>{
if(!_.isEmpty(data)){
cartHelper.getCartQuantity(req.session.email).then((cartQuantity) => {
res.render(path.join(__dirname, "../views/cart.handlebars"),{
cartItems:data.items,
Expand All @@ -29,6 +31,22 @@ const viewCartItems=(req,res)=>{
}).catch((err)=>{
res.status(500).send("error in viewing cart items");
})
}
else{
res.render(path.join(__dirname, "../views/cart.handlebars"), {
cartQuantity:0,
userEmail: req.session.email,
username: req.session.username,
userDisplayPicture: req.session.displayPictureUrl
})
}
}).catch((err)=>{
res.render(path.join(__dirname, "../views/cart.handlebars"), {
userEmail: req.session.email,
username: req.session.username,
userDisplayPicture: req.session.displayPictureUrl
})

})
}
const removeItemInCart = (req, res) => {
Expand Down
1 change: 0 additions & 1 deletion controllers/orders.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const orderSuccess=(req,res)=>{
const getOrders=(req,res)=>{
ordersHelper.getOrder(req.session.email).then((data)=>{
cartHelper.getCartQuantity(req.session.email).then((cartQuantity)=>{
console.log(data)
res.render(path.join(__dirname, "../views/orders.handlebars"), {
orders: data.orders,
cartQuantity:cartQuantity,
Expand Down
5 changes: 4 additions & 1 deletion views/cart.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,11 @@
<button class="flex-c-m sizefull bg1 bo-rad-23 hov1 s-text1 trans-0-4" id="confirm-button">
Proceed to Checkout
</button>


</div>

<p style="padding-top:30px;">We take orders till 7:30 pm,Incase if you order after 7:30 pm msessge to 7095237775 we will refund the money without delivery cost and gst, in three business days</p>
</div>
</div>
</section>
Expand All @@ -324,7 +327,7 @@

<div>
<p class="s-text7 w-size27">
Any issuses? Let us know ph.no 9100878305
Any issuses? Let us know ph.no 7095237775
</p>

<div class="flex-m p-t-30">
Expand Down
2 changes: 1 addition & 1 deletion views/items.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

<div>
<p class="s-text7 w-size27">
Any issuses? Let us know ph.no 9100878305
Any issuses? Let us know ph.no 7095237775
</p>

<div class="flex-m p-t-30">
Expand Down
2 changes: 1 addition & 1 deletion views/orders.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

<div>
<p class="s-text7 w-size27">
Any issuses? Let us know ph.no 9100878305
Any issuses? Let us know ph.no 7095237775
</p>

<div class="flex-m p-t-30">
Expand Down
2 changes: 1 addition & 1 deletion views/restaurants.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@

<div>
<p class="s-text7 w-size27">
Any issuses? Let us know ph.no 9100878305
Any issuses? Let us know ph.no 7095237775
</p>

<div class="flex-m p-t-30">
Expand Down

0 comments on commit 92a1511

Please sign in to comment.