Showing
8 changed files
with
207 additions
and
89 deletions
... | @@ -159,18 +159,27 @@ router.get("/logout", function (req, res) { | ... | @@ -159,18 +159,27 @@ router.get("/logout", function (req, res) { |
159 | res.redirect("/"); | 159 | res.redirect("/"); |
160 | }); | 160 | }); |
161 | 161 | ||
162 | +router.get("/comment", function (req, res) { | ||
163 | + res.render("comment"); | ||
164 | +}); | ||
165 | + | ||
162 | // 카페 후기 등록 | 166 | // 카페 후기 등록 |
163 | router.post("/comment", function (req, res) { | 167 | router.post("/comment", function (req, res) { |
164 | - var cafeId = req.body.cafeId; | 168 | + var cafeId = req.query.cafeId; |
165 | var price = req.body.price; | 169 | var price = req.body.price; |
166 | var kindness = req.body.kindness; | 170 | var kindness = req.body.kindness; |
167 | var noise = req.body.noise; | 171 | var noise = req.body.noise; |
168 | var accessibility = req.body.accessibility; | 172 | var accessibility = req.body.accessibility; |
169 | 173 | ||
174 | + console.log(price); | ||
175 | + console.log(kindness); | ||
176 | + console.log(noise); | ||
177 | + console.log(accessibility); | ||
178 | + | ||
170 | // 입력받지 않은 데이터가 하나라도 존재 (카페아이디는 후기작성시 자동으로 받아옴) | 179 | // 입력받지 않은 데이터가 하나라도 존재 (카페아이디는 후기작성시 자동으로 받아옴) |
171 | - if (!price || !kindness || !noise || !accessibility) { | 180 | + if (!cafeId || !price || !kindness || !noise || !accessibility) { |
172 | console.log("입력받지 않은 데이터 존재"); | 181 | console.log("입력받지 않은 데이터 존재"); |
173 | - return; // 후기작성으로 다시 이동 | 182 | + res.redirect("/comment"); // 후기작성으로 다시 이동 |
174 | } | 183 | } |
175 | 184 | ||
176 | var sql = | 185 | var sql = | ... | ... |
1 | -{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"__lastAccess":1621704357295,"user":{"name":"최정민[학생](소프트웨어융합대학 컴퓨터공학과)","email":"cjm2021401@khu.ac.kr","nickname":"cjm","age":"24","gender":"male"}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"__lastAccess":1621766908867,"user":{"name":"김대철[학생](소프트웨어융합대학 컴퓨터공학과)","email":"kdc9619@khu.ac.kr","nickname":"Meerkat","age":"26","gender":"male"}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"__lastAccess":1621952163379} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
views/comment.ejs
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<head> | ||
3 | + <meta charset="UTF-8"> | ||
4 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
5 | + | ||
6 | + <title>Enroll Comment</title> | ||
7 | + | ||
8 | + <link rel="stylesheet" href="stylesheets/bootstrap.css"> | ||
9 | + <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap" rel="stylesheet"> | ||
10 | + | ||
11 | + <style> | ||
12 | + img{ | ||
13 | + max-width: 100%; | ||
14 | + height: 100% !important; | ||
15 | + } | ||
16 | + h1{font-family: 'Noto Sans KR', sans-serif;} | ||
17 | + h4{font-family: 'Noto Sans KR', sans-serif;} | ||
18 | + h2{font-family: 'Noto Sans KR', sans-serif;} | ||
19 | + h3{font-family: 'Noto Sans KR', sans-serif;} | ||
20 | + h5{font-family: 'Noto Sans KR', sans-serif;} | ||
21 | + .middle{ | ||
22 | + display: inline-block; | ||
23 | + vertical-align: middle; | ||
24 | + } | ||
25 | + </style> | ||
26 | +</head> | ||
27 | +<body> | ||
28 | + | ||
29 | +<hr class="my-2" > | ||
30 | +<section id="carousel-1"> | ||
31 | + <div class="row"> | ||
32 | + <div class="col-2"></div> | ||
33 | + <div class="col-8"> | ||
34 | + <hr class="my-4" style="background-color: white"> | ||
35 | + <form method="post"> | ||
36 | + <div class></div> | ||
37 | + <hr class="my-3" style="background-color: white"> | ||
38 | + <label for="price" class="form-label">가격</label> | ||
39 | + <select class="form-select form-select-lg" id="price" name="price" required> | ||
40 | + <option selected disabled value="">선택하세요</option> | ||
41 | + <option value="5">5</option> | ||
42 | + <option value="4">4</option> | ||
43 | + <option value="3">3</option> | ||
44 | + <option value="2">2</option> | ||
45 | + <option value="1">1</option> | ||
46 | + </select> | ||
47 | + | ||
48 | + <hr class="my-3" style="background-color: white"> | ||
49 | + <label for="kindness" class="form-label">친절도</label> | ||
50 | + <select class="form-select form-select-lg" id="kindness" name="kindness" required> | ||
51 | + <option selected disabled value="">선택하세요</option> | ||
52 | + <option value="5">5</option> | ||
53 | + <option value="4">4</option> | ||
54 | + <option value="3">3</option> | ||
55 | + <option value="2">2</option> | ||
56 | + <option value="1">1</option> | ||
57 | + </select> | ||
58 | + | ||
59 | + <hr class="my-3" style="background-color: white"> | ||
60 | + <label for="noise" class="form-label">소음</label> | ||
61 | + <select class="form-select form-select-lg" id="noise" name="noise" required> | ||
62 | + <option selected disabled value="">선택하세요</option> | ||
63 | + <option value="5">5</option> | ||
64 | + <option value="4">4</option> | ||
65 | + <option value="3">3</option> | ||
66 | + <option value="2">2</option> | ||
67 | + <option value="1">1</option> | ||
68 | + </select> | ||
69 | + | ||
70 | + <hr class="my-3" style="background-color: white"> | ||
71 | + <label for="accessibility" class="form-label">접근성</label> | ||
72 | + <select class="form-select form-select-lg" id="accessibility" name="accessibility" required> | ||
73 | + <option selected disabled value="">선택하세요</option> | ||
74 | + <option value="5">5</option> | ||
75 | + <option value="4">4</option> | ||
76 | + <option value="3">3</option> | ||
77 | + <option value="2">2</option> | ||
78 | + <option value="1">1</option> | ||
79 | + </select> | ||
80 | + | ||
81 | + <hr class="my-4" style="background-color: white"> | ||
82 | + <button type="submit" style="float:right" class="btn btn-primary btn-lg" id="please">Submit</button> | ||
83 | + </form> | ||
84 | + </div> | ||
85 | + <div class="col-2"></div> | ||
86 | + </div> | ||
87 | +</section> | ||
88 | +</body> | ||
89 | +<script src="javascripts/bootstrap.js"></script> | ||
90 | +</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -25,12 +25,8 @@ | ... | @@ -25,12 +25,8 @@ |
25 | } | 25 | } |
26 | </style> | 26 | </style> |
27 | 27 | ||
28 | - | ||
29 | </head> | 28 | </head> |
30 | 29 | ||
31 | - | ||
32 | - | ||
33 | - | ||
34 | <body> | 30 | <body> |
35 | <nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | 31 | <nav class="navbar navbar-expand-lg navbar-dark bg-dark"> |
36 | <a class="navbar-brand" href="/"><img src="images/home.png" width="40" height="40" alt=""> | 32 | <a class="navbar-brand" href="/"><img src="images/home.png" width="40" height="40" alt=""> |
... | @@ -67,28 +63,6 @@ | ... | @@ -67,28 +63,6 @@ |
67 | 63 | ||
68 | 64 | ||
69 | <script> | 65 | <script> |
70 | - function onSignIn(googleUser) { | ||
71 | - var id_token = googleUser.getAuthResponse().id_token; | ||
72 | - console.log(id_token); | ||
73 | - var xhr = new XMLHttpRequest(); | ||
74 | - xhr.open('POST', '/index'); | ||
75 | - xhr.setRequestHeader('Content-Type', 'application/json'); | ||
76 | - xhr.onload = function() { | ||
77 | - console.log('Signed in as: ' + xhr.responseText); | ||
78 | - if(xhr.responseText == 'success'){ | ||
79 | - signOut(); | ||
80 | - location.assign('/login') | ||
81 | - } | ||
82 | - }; | ||
83 | - xhr.send(JSON.stringify({token: id_token})); | ||
84 | - } | ||
85 | - | ||
86 | - function signOut() { | ||
87 | - var auth2 = gapi.auth2.getAuthInstance(); | ||
88 | - auth2.signOut().then(function () { | ||
89 | - console.log('User signed out.'); | ||
90 | - }); | ||
91 | - } | ||
92 | </script> | 66 | </script> |
93 | <script src="javascripts/bootstrap.js"></script> | 67 | <script src="javascripts/bootstrap.js"></script> |
94 | </html> | 68 | </html> | ... | ... |
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | -<head> | 3 | + <head> |
4 | - <meta charset="UTF-8"> | 4 | + <meta charset="UTF-8" /> |
5 | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
6 | 6 | ||
7 | <title>logined</title> | 7 | <title>logined</title> |
8 | 8 | ||
9 | - <link rel="stylesheet" href="stylesheets/bootstrap.css"> | 9 | + <link rel="stylesheet" href="stylesheets/bootstrap.css" /> |
10 | - <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap" rel="stylesheet"> | 10 | + <link |
11 | + href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap" | ||
12 | + rel="stylesheet" | ||
13 | + /> | ||
11 | 14 | ||
12 | <style> | 15 | <style> |
13 | - img{ | 16 | + img { |
14 | max-width: 100%; | 17 | max-width: 100%; |
15 | height: 100% !important; | 18 | height: 100% !important; |
16 | } | 19 | } |
17 | - h1{font-family: 'Noto Sans KR', sans-serif;} | 20 | + h1 { |
18 | - h4{font-family: 'Noto Sans KR', sans-serif;} | 21 | + font-family: "Noto Sans KR", sans-serif; |
19 | - h2{font-family: 'Noto Sans KR', sans-serif;} | 22 | + } |
20 | - h3{font-family: 'Noto Sans KR', sans-serif;} | 23 | + h4 { |
21 | - h5{font-family: 'Noto Sans KR', sans-serif;} | 24 | + font-family: "Noto Sans KR", sans-serif; |
22 | - .middle{ | 25 | + } |
26 | + h2 { | ||
27 | + font-family: "Noto Sans KR", sans-serif; | ||
28 | + } | ||
29 | + h3 { | ||
30 | + font-family: "Noto Sans KR", sans-serif; | ||
31 | + } | ||
32 | + h5 { | ||
33 | + font-family: "Noto Sans KR", sans-serif; | ||
34 | + } | ||
35 | + .middle { | ||
23 | display: inline-block; | 36 | display: inline-block; |
24 | vertical-align: middle; | 37 | vertical-align: middle; |
25 | } | 38 | } |
26 | </style> | 39 | </style> |
27 | -</head> | 40 | + </head> |
28 | -<body> | 41 | + <body> |
29 | -<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | 42 | + <nav class="navbar navbar-expand-lg navbar-dark bg-dark"> |
30 | - <a class="navbar-brand" href="/"><img src="images/home.png" width="40" height="40" alt=""> | 43 | + <a class="navbar-brand" href="/" |
44 | + ><img src="images/home.png" width="40" height="40" alt="" /> | ||
31 | </a> | 45 | </a> |
32 | - <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | 46 | + <button |
47 | + class="navbar-toggler" | ||
48 | + type="button" | ||
49 | + data-toggle="collapse" | ||
50 | + data-target="#navbarSupportedContent" | ||
51 | + aria-controls="navbarSupportedContent" | ||
52 | + aria-expanded="false" | ||
53 | + aria-label="Toggle navigation" | ||
54 | + > | ||
33 | <span class="navbar-toggler-icon"></span> | 55 | <span class="navbar-toggler-icon"></span> |
34 | </button> | 56 | </button> |
35 | <div class="collapse navbar-collapse" id="navbarSupportedContent"> | 57 | <div class="collapse navbar-collapse" id="navbarSupportedContent"> |
36 | - <a class="navbar-brand" href="/" ><strong>Home</strong></a> | 58 | + <a class="navbar-brand" href="/"><strong>Home</strong></a> |
37 | <ul class="navbar-nav mr-auto mt-2 mt-lg-0"> | 59 | <ul class="navbar-nav mr-auto mt-2 mt-lg-0"> |
38 | - | ||
39 | <li class="nav-item active"> | 60 | <li class="nav-item active"> |
40 | - <a class="nav-link" style="color:#ffffff" href="/" onclick="signOut();">Logout<span class="sr-only">(current)</span></a> | 61 | + <a |
62 | + class="nav-link" | ||
63 | + style="color: #ffffff" | ||
64 | + href="/" | ||
65 | + onclick="signOut();" | ||
66 | + >Logout<span class="sr-only">(current)</span></a | ||
67 | + > | ||
41 | </li> | 68 | </li> |
42 | - | ||
43 | </ul> | 69 | </ul> |
44 | </div> | 70 | </div> |
45 | -</nav> | 71 | + </nav> |
46 | -<div class="pricing-header px-3 py-1 pt-md-3 pb-md-1 mx-auto text-center"> | 72 | + <div class="pricing-header px-3 py-1 pt-md-3 pb-md-1 mx-auto text-center"> |
47 | - <h3 class="display-6 font-weight-bold" >Signup</h3> | 73 | + <h3 class="display-6 font-weight-bold">Signup</h3> |
48 | -</div> | 74 | + </div> |
49 | - | ||
50 | 75 | ||
51 | -<hr class="my-2" > | 76 | + <hr class="my-2" /> |
52 | -<section id="carousel-1"> | 77 | + <section id="carousel-1"> |
53 | <div class="row"> | 78 | <div class="row"> |
54 | <div class="col-2"></div> | 79 | <div class="col-2"></div> |
55 | <div class="col-8"> | 80 | <div class="col-8"> |
56 | - <hr class="my-4" style="background-color: white"> | 81 | + <hr class="my-4" style="background-color: white" /> |
57 | <form method="post"> | 82 | <form method="post"> |
58 | - <div class="form-group "> | 83 | + <div class="form-group"> |
59 | <label for="id_input">닉네임을 입력하세요</label> | 84 | <label for="id_input">닉네임을 입력하세요</label> |
60 | - <input type="text" class="form-control form-control-lg" name="nickname" aria-describedby="idHelp" placeholder="ID"> | 85 | + <input |
61 | - <small id="idHelp" class="form-text text-muted">중복이 허용되지 않습니다.</small> | 86 | + type="text" |
87 | + class="form-control form-control-lg" | ||
88 | + name="nickname" | ||
89 | + aria-describedby="idHelp" | ||
90 | + placeholder="ID" | ||
91 | + /> | ||
92 | + <small id="idHelp" class="form-text text-muted" | ||
93 | + >중복이 허용되지 않습니다.</small | ||
94 | + > | ||
62 | </div> | 95 | </div> |
63 | - <hr class="my-3" style="background-color: white"> | 96 | + <hr class="my-3" style="background-color: white" /> |
64 | <div class="form-group"> | 97 | <div class="form-group"> |
65 | <label for="age_input">나이를 입력하세요</label> | 98 | <label for="age_input">나이를 입력하세요</label> |
66 | - <input class="form-control form-control-lg" type="number" name="age"placeholder="Age"> | 99 | + <input |
100 | + class="form-control form-control-lg" | ||
101 | + type="number" | ||
102 | + name="age" | ||
103 | + placeholder="Age" | ||
104 | + /> | ||
67 | </div> | 105 | </div> |
68 | - <hr class="my-3" style="background-color: white"> | 106 | + <hr class="my-3" style="background-color: white" /> |
69 | 107 | ||
70 | - <label for="gender" class="form-label ">성별을 입력하세요</label> | 108 | + <label for="gender" class="form-label">성별을 입력하세요</label> |
71 | - <select class="form-select form-select-lg" id="gender" name="gender" required> | 109 | + <select |
110 | + class="form-select form-select-lg" | ||
111 | + id="gender" | ||
112 | + name="gender" | ||
113 | + required | ||
114 | + > | ||
72 | <option selected disabled value="">Choose...</option> | 115 | <option selected disabled value="">Choose...</option> |
73 | <option value="male">Male</option> | 116 | <option value="male">Male</option> |
74 | <option value="female">Female</option> | 117 | <option value="female">Female</option> |
75 | </select> | 118 | </select> |
76 | 119 | ||
77 | - <hr class="my-4" style="background-color: white"> | 120 | + <hr class="my-4" style="background-color: white" /> |
78 | - <button type="submit" style="float:right" class="btn btn-primary btn-lg" id="please">Submit</button> | 121 | + <button |
79 | - | 122 | + type="submit" |
123 | + style="float: right" | ||
124 | + class="btn btn-primary btn-lg" | ||
125 | + id="please" | ||
126 | + > | ||
127 | + Submit | ||
128 | + </button> | ||
80 | </form> | 129 | </form> |
81 | </div> | 130 | </div> |
82 | <div class="col-2"></div> | 131 | <div class="col-2"></div> |
83 | </div> | 132 | </div> |
84 | -</section> | 133 | + </section> |
85 | 134 | ||
86 | -<a href="/logout" onclick="signOut();">Sign Out</a> | 135 | + <a href="/logout" onclick="signOut();">Sign Out</a> |
87 | -<%if (message=='same nickname'){%> | 136 | + <%if (message=='same nickname'){%> |
88 | <script type="text/javascript"> | 137 | <script type="text/javascript"> |
89 | - | 138 | + alert( |
90 | - alert("입력하신 NICKNAME은 사용하지 못합니다." + | 139 | + "입력하신 NICKNAME은 사용하지 못합니다." + |
91 | - "다른 NICKNAME을 입력하여 주세요"); | 140 | + "다른 NICKNAME을 입력하여 주세요" |
92 | - | 141 | + ); |
93 | </script> | 142 | </script> |
94 | -<%}%> | 143 | + <%}%> |
95 | - | 144 | + </body> |
96 | -</body> | 145 | + <script> |
97 | -<script> | ||
98 | function signOut() { | 146 | function signOut() { |
99 | var auth2 = gapi.auth2.getAuthInstance(); | 147 | var auth2 = gapi.auth2.getAuthInstance(); |
100 | auth2.signOut().then(function () { | 148 | auth2.signOut().then(function () { |
101 | - console.log('User signed out.'); | 149 | + console.log("User signed out."); |
102 | }); | 150 | }); |
103 | } | 151 | } |
104 | function signOut() { | 152 | function signOut() { |
105 | var auth2 = gapi.auth2.getAuthInstance(); | 153 | var auth2 = gapi.auth2.getAuthInstance(); |
106 | auth2.signOut().then(function () { | 154 | auth2.signOut().then(function () { |
107 | - console.log('User signed out.'); | 155 | + console.log("User signed out."); |
108 | }); | 156 | }); |
109 | } | 157 | } |
110 | -</script> | 158 | + </script> |
111 | -<script src="javascripts/bootstrap.js"></script> | 159 | + <script src="javascripts/bootstrap.js"></script> |
112 | </html> | 160 | </html> | ... | ... |
... | @@ -260,8 +260,8 @@ | ... | @@ -260,8 +260,8 @@ |
260 | ' <span class="tel">' + | 260 | ' <span class="tel">' + |
261 | place.phone + | 261 | place.phone + |
262 | "</span>" + | 262 | "</span>" + |
263 | - "</div>" + | 263 | + '<a href="/comment"><button>후기 작성</button>'; |
264 | - '<div class="after"></div>'; | 264 | + "</div>" + '<div class="after"></div>'; |
265 | contentNode.innerHTML = content; | 265 | contentNode.innerHTML = content; |
266 | placeOverlay.setPosition(new kakao.maps.LatLng(place.y, place.x)); | 266 | placeOverlay.setPosition(new kakao.maps.LatLng(place.y, place.x)); |
267 | placeOverlay.setMap(map); | 267 | placeOverlay.setMap(map); | ... | ... |
-
Please register or login to post a comment