Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Suyeon Jung
2020-12-09 01:30:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2dbdf0efb4c3413e15aa5aaa44791178d16ed62f
2dbdf0ef
1 parent
70810ab9
Add grade component
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
routes/category.js
views/components/grade.ejs
views/result.ejs
routes/category.js
View file @
2dbdf0e
...
...
@@ -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'
});
}
})
});
...
...
views/components/grade.ejs
0 → 100644
View file @
2dbdf0e
<div class="alert alert-danger" role="alert">
<%=grade%>
</div>
\ No newline at end of file
views/result.ejs
View file @
2dbdf0e
...
...
@@ -15,6 +15,7 @@
<body>
<
%- include('components/locationJumbotron') -%>
<
%- include(`results/${category}`) -%>
<
%- include(`components/grade`) -%>
</body>
...
...
Please
register
or
login
to post a comment