Suyeon Jung

Add grade component

......@@ -235,7 +235,7 @@ router.get('/food', function(req, res) {
fast_food_stores.push(fast_food_store);
}
}
res.render('result', { category: 'food', stores: stores, fast_food_stores: fast_food_stores, userLocation: userLocation });
res.render('result', { category: 'food', stores: stores, fast_food_stores: fast_food_stores, userLocation: userLocation, grade: 'A' });
}
})
......@@ -280,7 +280,7 @@ router.get('/school', function(req, res) {
institutes.push(institute);
}
}
res.render('result', { category: 'school', librarys: librarys, institutes: institutes, userLocation: userLocation });
res.render('result', { category: 'school', librarys: librarys, institutes: institutes, userLocation: userLocation, grade: 'A' });
}
})
}
......@@ -306,7 +306,7 @@ router.get('/park', function(req, res) {
city_parks.push(city_park);
}
}
res.render('result', { category: 'park', city_parks: city_parks, userLocation: userLocation });
res.render('result', { category: 'park', city_parks: city_parks, userLocation: userLocation, grade: 'A' });
}
})
});
......@@ -329,7 +329,7 @@ router.get('/transport', function(req, res) {
if (!err && res.statusCode == 200) {
//console.log("inside");
let bus_result = JSON.parse(body);
console.log('bus_result', bus_result.result.station);
// console.log('bus_result', bus_result.result.station);
let busStations = [];
console.log(bus_result.result)
for (let i = 0; i < bus_result.result.station.length; i++) {
......@@ -352,7 +352,7 @@ router.get('/transport', function(req, res) {
}
console.log(busStations);
console.log('subwayStaions', subwayStations);
res.render('result', { category: 'transport', busStations: busStations, subwayStations: subwayStations, userLocation: userLocation })
res.render('result', { category: 'transport', busStations: busStations, subwayStations: subwayStations, userLocation: userLocation, grade: 'A' })
}
})
......@@ -395,7 +395,7 @@ router.get('/safe', function(req, res) {
lights.push(light);
}
}
res.render('result', { category: 'safe', cctvs: cctvs, lights: lights, userLocation: userLocation });
res.render('result', { category: 'safe', cctvs: cctvs, lights: lights, userLocation: userLocation, grade: 'A' });
}
})
}
......@@ -423,7 +423,7 @@ router.get('/culture', function(req, res) {
movies.push(movie);
}
}
res.render('result', { category: 'culture', movies: movies, userLocation: userLocation });
res.render('result', { category: 'culture', movies: movies, userLocation: userLocation, grade: 'A' });
}
});
});
......@@ -448,7 +448,7 @@ router.get('/shop', function(req, res) {
shops.push(shop);
}
}
res.render('result', { category: 'shop', shops: shops, userLocation: userLocation });
res.render('result', { category: 'shop', shops: shops, userLocation: userLocation, grade: 'A' });
}
})
......@@ -473,7 +473,7 @@ router.get('/gym', function(req, res) {
gyms.push(gym);
}
}
res.render('result', { category: 'gym', gyms: gyms, userLocation: userLocation });
res.render('result', { category: 'gym', gyms: gyms, userLocation: userLocation, grade: 'A' });
}
})
});
......
<div class="alert alert-danger" role="alert">
<%=grade%>
</div>
\ No newline at end of file
......@@ -15,6 +15,7 @@
<body>
<%- include('components/locationJumbotron') -%>
<%- include(`results/${category}`) -%>
<%- include(`components/grade`) -%>
</body>
......