Suyeon Jung

Modify views : split pages into components

......@@ -235,7 +235,7 @@ router.get('/food', function(req, res) {
fast_food_stores.push(fast_food_store);
}
}
res.render('food_result', { stores: stores, fast_food_stores: fast_food_stores });
res.render('result', { category: 'food', stores: stores, fast_food_stores: fast_food_stores, userLocation: userLocation });
}
})
......@@ -280,7 +280,7 @@ router.get('/school', function(req, res) {
institutes.push(institute);
}
}
res.render('school_result', { librarys: librarys, institutes: institutes });
res.render('result', { category: 'school', librarys: librarys, institutes: institutes, userLocation: userLocation });
}
})
}
......@@ -306,16 +306,8 @@ router.get('/park', function(req, res) {
city_parks.push(city_park);
}
}
res.render('park_result', { city_parks: city_parks });
res.render('result', { category: 'park', city_parks: city_parks, userLocation: userLocation });
}
// if (park_result.CityPark[0].head[1].RESULT.CODE == 'INFO-000') {
// cityparknum = park_result.CityPark[0].head[0].list_total_count;
// console.log(cityparknum + "개의 도시공원이 존재합니다.");
// res.send(String(cityparknum) + "개의 도시공원이 존재합니다.");
// } else {
// res.send("도시공원이 없습니다.");
// }
})
});
......@@ -360,7 +352,7 @@ router.get('/transport', function(req, res) {
}
console.log(busStations);
console.log('subwayStaions', subwayStations);
res.render('transport_result', { busStations: busStations, subwayStations: subwayStations })
res.render('result', { category: 'transport', busStations: busStations, subwayStations: subwayStations, userLocation: userLocation })
}
})
......@@ -403,7 +395,7 @@ router.get('/safe', function(req, res) {
lights.push(light);
}
}
res.render('safe_result', { cctvs: cctvs, lights: lights });
res.render('result', { category: 'safe', cctvs: cctvs, lights: lights, userLocation: userLocation });
}
})
}
......@@ -431,7 +423,7 @@ router.get('/culture', function(req, res) {
sings.push(sing);
}
}
res.render('culture_result', { sings: sings });
res.render('result', { category: 'culture', sings: sings, userLocation: userLocation });
}
});
});
......@@ -456,7 +448,7 @@ router.get('/shop', function(req, res) {
shops.push(shop);
}
}
res.render('shop_result', { shops: shops });
res.render('result', { category: 'shop', shops: shops, userLocation: userLocation });
}
})
......@@ -481,7 +473,7 @@ router.get('/gym', function(req, res) {
gyms.push(gym);
}
}
res.render('gym_result', { gyms: gyms });
res.render('result', { category: 'gym', gyms: gyms, userLocation: userLocation });
}
})
});
......
......@@ -15,80 +15,10 @@
<body>
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h3>
🔎 검색한 동네 :
<%=userLocation%>
</h3>
</div>
</div>
<div class="row">
<div class="card" style="width: 18rem;">
<img src="/img/restaurant.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">음식</h5>
<p class="card-text">주변 음식점의 수</p>
<a href="/category/food" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/school.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">학군</h5>
<p class="card-text">주변 학원 및 도서관 현황</p>
<a href="/category/school" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/park.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">공원</h5>
<p class="card-text">주변 공원</p>
<a href="/category/park" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/transport.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">대중교통</h5>
<p class="card-text">대중교통 편리도</p>
<a href="/category/transport" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/safe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">안전</h5>
<p class="card-text">주변 경찰서, 범죄자 인근~</p>
<a href="/category/safe" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/cultural_life.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">여가</h5>
<p class="card-text">주변 문화시설</p>
<a href="/category/culture" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/shopping.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">쇼핑</h5>
<p class="card-text">주변 백화점, 마트, 재래시장</p>
<a href="/category/shop" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/gym.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">운동</h5>
<p class="card-text">주변 운동시설</p>
<a href="/category/gym" class="btn btn-primary">검사!</a>
</div>
</div>
</div>
<%- include('components/locationJumbotron') -%>
<%- include('components/category') -%>
</body>
......
<div class="row">
<div class="card" style="width: 18rem;">
<img src="/img/restaurant.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">음식</h5>
<p class="card-text">주변 음식점의 수</p>
<a href="/category/food" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/school.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">학군</h5>
<p class="card-text">주변 학원 및 도서관 현황</p>
<a href="/category/school" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/park.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">공원</h5>
<p class="card-text">주변 공원</p>
<a href="/category/park" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/transport.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">대중교통</h5>
<p class="card-text">대중교통 편리도</p>
<a href="/category/transport" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/safe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">안전</h5>
<p class="card-text">주변 경찰서, 범죄자 인근~</p>
<a href="/category/safe" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/cultural_life.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">여가</h5>
<p class="card-text">주변 문화시설</p>
<a href="/category/culture" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/shopping.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">쇼핑</h5>
<p class="card-text">주변 백화점, 마트, 재래시장</p>
<a href="/category/shop" class="btn btn-primary">검사!</a>
</div>
</div>
<div class="card" style="width: 18rem;">
<img src="/img/gym.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">운동</h5>
<p class="card-text">주변 운동시설</p>
<a href="/category/gym" class="btn btn-primary">검사!</a>
</div>
</div>
</div>
\ No newline at end of file
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-grid.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-reboot.min.css' />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Sunflower:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css">
<title>🏡 어떤 동네가 좋은 동네일까?</title>
<style>
img {
display: block;
margin: 0px auto;
}
</style>
</head>
\ No newline at end of file
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h3>
🔎 검색한 동네 :
<%=userLocation%>
</h3>
</div>
</div>
\ No newline at end of file
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <link rel="stylesheet" href="/css/style.css"> -->
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-grid.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-reboot.min.css' />
<title>🏡 How about the Village?</title>
</head>
<body>
<%- include('components/header') -%>
<body>
<img class="gyeonggi" src="/img/logo.png">
<form action="/category" method="post" name="location">
<!-- <input type="text" id="userLocation" name="userLocation" placeholder="당신의 동네 주소를 입력해주세요(시/구/동)">
<input type="submit" id="search" value="검색"> -->
<div class="form-group">
<label for="exampleFormControlInput1">당신이 조사하고 싶은 동네의 주소를 입력하세요!</label>
<input type="text" class="form-control" id="exampleFormControlInput1" name="sigun" placeholder="시/군을 입력하세요">
......@@ -25,6 +16,6 @@
</div>
<button type="submit" class="btn btn-primary">검색</button>
</form>
</body>
</body>
</html>
\ No newline at end of file
......
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-grid.min.css' />
<link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-reboot.min.css' />
<link rel='stylesheet' href='/css/category.css'>
<title>📝 결과</title>
</head>
<body>
<%- include('components/locationJumbotron') -%>
<%- include(`results/${category}`) -%>
</body>
</html>
\ No newline at end of file