Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대철
/
CafeRecommend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대철
2021-05-26 20:27:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
828eab449fba20c132b650292f60e27cb2318e8f
828eab44
1 parent
0e470a87
후기등록 화면 작성
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
238 additions
and
120 deletions
routes/index.js
sessions/2_Y2SS0T_HIgGmB7EVvpVPY8rL0NfMVX.json
sessions/DQNZIWa3VZ-4oZzo1fxBe5GnOMZPrKB-.json
sessions/wRlxwPEMAGNT6Ml-DrDM4E0r2eY9GPu5.json
views/comment.ejs
views/index.ejs
views/login.ejs
views/map.ejs
routes/index.js
View file @
828eab4
...
...
@@ -159,18 +159,27 @@ router.get("/logout", function (req, res) {
res
.
redirect
(
"/"
);
});
router
.
get
(
"/comment"
,
function
(
req
,
res
)
{
res
.
render
(
"comment"
);
});
// 카페 후기 등록
router
.
post
(
"/comment"
,
function
(
req
,
res
)
{
var
cafeId
=
req
.
bod
y
.
cafeId
;
var
cafeId
=
req
.
quer
y
.
cafeId
;
var
price
=
req
.
body
.
price
;
var
kindness
=
req
.
body
.
kindness
;
var
noise
=
req
.
body
.
noise
;
var
accessibility
=
req
.
body
.
accessibility
;
console
.
log
(
price
);
console
.
log
(
kindness
);
console
.
log
(
noise
);
console
.
log
(
accessibility
);
// 입력받지 않은 데이터가 하나라도 존재 (카페아이디는 후기작성시 자동으로 받아옴)
if
(
!
price
||
!
kindness
||
!
noise
||
!
accessibility
)
{
if
(
!
cafeId
||
!
price
||
!
kindness
||
!
noise
||
!
accessibility
)
{
console
.
log
(
"입력받지 않은 데이터 존재"
);
re
turn
;
// 후기작성으로 다시 이동
re
s
.
redirect
(
"/comment"
)
;
// 후기작성으로 다시 이동
}
var
sql
=
...
...
sessions/2_Y2SS0T_HIgGmB7EVvpVPY8rL0NfMVX.json
deleted
100644 → 0
View file @
0e470a8
{
"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
sessions/DQNZIWa3VZ-4oZzo1fxBe5GnOMZPrKB-.json
deleted
100644 → 0
View file @
0e470a8
{
"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
sessions/wRlxwPEMAGNT6Ml-DrDM4E0r2eY9GPu5.json
deleted
100644 → 0
View file @
0e470a8
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1621952163379
}
\ No newline at end of file
views/comment.ejs
0 → 100644
View file @
828eab4
<!DOCTYPE html>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Enroll Comment
</title>
<link
rel=
"stylesheet"
href=
"stylesheets/bootstrap.css"
>
<link
href=
"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap"
rel=
"stylesheet"
>
<style>
img
{
max-width
:
100%
;
height
:
100%
!important
;
}
h1
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h4
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h2
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h3
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h5
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
.middle
{
display
:
inline-block
;
vertical-align
:
middle
;
}
</style>
</head>
<body>
<hr
class=
"my-2"
>
<section
id=
"carousel-1"
>
<div
class=
"row"
>
<div
class=
"col-2"
></div>
<div
class=
"col-8"
>
<hr
class=
"my-4"
style=
"background-color: white"
>
<form
method=
"post"
>
<div
class
></div>
<hr
class=
"my-3"
style=
"background-color: white"
>
<label
for=
"price"
class=
"form-label"
>
가격
</label>
<select
class=
"form-select form-select-lg"
id=
"price"
name=
"price"
required
>
<option
selected
disabled
value=
""
>
선택하세요
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"1"
>
1
</option>
</select>
<hr
class=
"my-3"
style=
"background-color: white"
>
<label
for=
"kindness"
class=
"form-label"
>
친절도
</label>
<select
class=
"form-select form-select-lg"
id=
"kindness"
name=
"kindness"
required
>
<option
selected
disabled
value=
""
>
선택하세요
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"1"
>
1
</option>
</select>
<hr
class=
"my-3"
style=
"background-color: white"
>
<label
for=
"noise"
class=
"form-label"
>
소음
</label>
<select
class=
"form-select form-select-lg"
id=
"noise"
name=
"noise"
required
>
<option
selected
disabled
value=
""
>
선택하세요
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"1"
>
1
</option>
</select>
<hr
class=
"my-3"
style=
"background-color: white"
>
<label
for=
"accessibility"
class=
"form-label"
>
접근성
</label>
<select
class=
"form-select form-select-lg"
id=
"accessibility"
name=
"accessibility"
required
>
<option
selected
disabled
value=
""
>
선택하세요
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"1"
>
1
</option>
</select>
<hr
class=
"my-4"
style=
"background-color: white"
>
<button
type=
"submit"
style=
"float:right"
class=
"btn btn-primary btn-lg"
id=
"please"
>
Submit
</button>
</form>
</div>
<div
class=
"col-2"
></div>
</div>
</section>
</body>
<script
src=
"javascripts/bootstrap.js"
></script>
</html>
\ No newline at end of file
views/index.ejs
View file @
828eab4
...
...
@@ -25,12 +25,8 @@
}
</style>
</head>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<a
class=
"navbar-brand"
href=
"/"
><img
src=
"images/home.png"
width=
"40"
height=
"40"
alt=
""
>
...
...
@@ -67,28 +63,6 @@
<script>
function
onSignIn
(
googleUser
)
{
var
id_token
=
googleUser
.
getAuthResponse
().
id_token
;
console
.
log
(
id_token
);
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'POST'
,
'/index'
);
xhr
.
setRequestHeader
(
'Content-Type'
,
'application/json'
);
xhr
.
onload
=
function
()
{
console
.
log
(
'Signed in as: '
+
xhr
.
responseText
);
if
(
xhr
.
responseText
==
'success'
){
signOut
();
location
.
assign
(
'/login'
)
}
};
xhr
.
send
(
JSON
.
stringify
({
token
:
id_token
}));
}
function
signOut
()
{
var
auth2
=
gapi
.
auth2
.
getAuthInstance
();
auth2
.
signOut
().
then
(
function
()
{
console
.
log
(
'User signed out.'
);
});
}
</script>
<script
src=
"javascripts/bootstrap.js"
></script>
</html>
...
...
views/login.ejs
View file @
828eab4
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<head>
<meta
charset=
"UTF-8"
/
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/
>
<title>
logined
</title>
<link
rel=
"stylesheet"
href=
"stylesheets/bootstrap.css"
>
<link
href=
"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"stylesheets/bootstrap.css"
/>
<link
href=
"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700&display=swap"
rel=
"stylesheet"
/>
<style>
img
{
max-width
:
100%
;
height
:
100%
!important
;
}
h1
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h4
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h2
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h3
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
h5
{
font-family
:
'Noto Sans KR'
,
sans-serif
;}
.middle
{
display
:
inline-block
;
vertical-align
:
middle
;
}
img
{
max-width
:
100%
;
height
:
100%
!important
;
}
h1
{
font-family
:
"Noto Sans KR"
,
sans-serif
;
}
h4
{
font-family
:
"Noto Sans KR"
,
sans-serif
;
}
h2
{
font-family
:
"Noto Sans KR"
,
sans-serif
;
}
h3
{
font-family
:
"Noto Sans KR"
,
sans-serif
;
}
h5
{
font-family
:
"Noto Sans KR"
,
sans-serif
;
}
.middle
{
display
:
inline-block
;
vertical-align
:
middle
;
}
</style>
</head>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<a
class=
"navbar-brand"
href=
"/"
><img
src=
"images/home.png"
width=
"40"
height=
"40"
alt=
""
>
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
</head>
<body>
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<a
class=
"navbar-brand"
href=
"/"
><img
src=
"images/home.png"
width=
"40"
height=
"40"
alt=
""
/>
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<a
class=
"navbar-brand"
href=
"/"
><strong>
Home
</strong></a>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<a
class=
"navbar-brand"
href=
"/"
><strong>
Home
</strong></a>
<ul
class=
"navbar-nav mr-auto mt-2 mt-lg-0"
>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
style=
"color:#ffffff"
href=
"/"
onclick=
"signOut();"
>
Logout
<span
class=
"sr-only"
>
(current)
</span></a>
</li>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
style=
"color: #ffffff"
href=
"/"
onclick=
"signOut();"
>
Logout
<span
class=
"sr-only"
>
(current)
</span></a
>
</li>
</ul>
</div>
</nav>
<div
class=
"pricing-header px-3 py-1 pt-md-3 pb-md-1 mx-auto text-center"
>
<h3
class=
"display-6 font-weight-bold"
>
Signup
</h3>
</div>
</nav>
<div
class=
"pricing-header px-3 py-1 pt-md-3 pb-md-1 mx-auto text-center"
>
<h3
class=
"display-6 font-weight-bold"
>
Signup
</h3>
</div>
<hr
class=
"my-2"
>
<section
id=
"carousel-1"
>
<div
class=
"row"
>
<hr
class=
"my-2"
/>
<section
id=
"carousel-1"
>
<div
class=
"row"
>
<div
class=
"col-2"
></div>
<div
class=
"col-8"
>
<hr
class=
"my-4"
style=
"background-color: white"
>
<form
method=
"post"
>
<div
class=
"form-group "
>
<label
for=
"id_input"
>
닉네임을 입력하세요
</label>
<input
type=
"text"
class=
"form-control form-control-lg"
name=
"nickname"
aria-describedby=
"idHelp"
placeholder=
"ID"
>
<small
id=
"idHelp"
class=
"form-text text-muted"
>
중복이 허용되지 않습니다.
</small>
</div>
<hr
class=
"my-3"
style=
"background-color: white"
>
<div
class=
"form-group"
>
<label
for=
"age_input"
>
나이를 입력하세요
</label>
<input
class=
"form-control form-control-lg"
type=
"number"
name=
"age"
placeholder=
"Age"
>
</div>
<hr
class=
"my-3"
style=
"background-color: white"
>
<label
for=
"gender"
class=
"form-label "
>
성별을 입력하세요
</label>
<select
class=
"form-select form-select-lg"
id=
"gender"
name=
"gender"
required
>
<option
selected
disabled
value=
""
>
Choose...
</option>
<option
value=
"male"
>
Male
</option>
<option
value=
"female"
>
Female
</option>
</select>
<hr
class=
"my-4"
style=
"background-color: white"
/>
<form
method=
"post"
>
<div
class=
"form-group"
>
<label
for=
"id_input"
>
닉네임을 입력하세요
</label>
<input
type=
"text"
class=
"form-control form-control-lg"
name=
"nickname"
aria-describedby=
"idHelp"
placeholder=
"ID"
/>
<small
id=
"idHelp"
class=
"form-text text-muted"
>
중복이 허용되지 않습니다.
</small
>
</div>
<hr
class=
"my-3"
style=
"background-color: white"
/>
<div
class=
"form-group"
>
<label
for=
"age_input"
>
나이를 입력하세요
</label>
<input
class=
"form-control form-control-lg"
type=
"number"
name=
"age"
placeholder=
"Age"
/>
</div>
<hr
class=
"my-3"
style=
"background-color: white"
/>
<hr
class=
"my-4"
style=
"background-color: white"
>
<button
type=
"submit"
style=
"float:right"
class=
"btn btn-primary btn-lg"
id=
"please"
>
Submit
</button>
<label
for=
"gender"
class=
"form-label"
>
성별을 입력하세요
</label>
<select
class=
"form-select form-select-lg"
id=
"gender"
name=
"gender"
required
>
<option
selected
disabled
value=
""
>
Choose...
</option>
<option
value=
"male"
>
Male
</option>
<option
value=
"female"
>
Female
</option>
</select>
</form>
<hr
class=
"my-4"
style=
"background-color: white"
/>
<button
type=
"submit"
style=
"float: right"
class=
"btn btn-primary btn-lg"
id=
"please"
>
Submit
</button>
</form>
</div>
<div
class=
"col-2"
></div>
</div>
</section>
</div>
</section>
<a
href=
"/logout"
onclick=
"signOut();"
>
Sign Out
</a>
<
%if (message=='same nickname'){%>
<a
href=
"/logout"
onclick=
"signOut();"
>
Sign Out
</a>
<
%if (message=='same nickname'){%>
<script
type=
"text/javascript"
>
alert
(
"입력하신 NICKNAME은 사용하지 못합니다."
+
"다른 NICKNAME을 입력하여 주세요"
);
alert
(
"입력하신 NICKNAME은 사용하지 못합니다."
+
"다른 NICKNAME을 입력하여 주세요"
);
</script>
<
%}%>
</body>
<script>
<
%}%>
</body>
<script>
function
signOut
()
{
var
auth2
=
gapi
.
auth2
.
getAuthInstance
();
auth2
.
signOut
().
then
(
function
()
{
console
.
log
(
'User signed out.'
);
});
var
auth2
=
gapi
.
auth2
.
getAuthInstance
();
auth2
.
signOut
().
then
(
function
()
{
console
.
log
(
"User signed out."
);
});
}
function
signOut
()
{
var
auth2
=
gapi
.
auth2
.
getAuthInstance
();
auth2
.
signOut
().
then
(
function
()
{
console
.
log
(
'User signed out.'
);
});
var
auth2
=
gapi
.
auth2
.
getAuthInstance
();
auth2
.
signOut
().
then
(
function
()
{
console
.
log
(
"User signed out."
);
});
}
</script>
<script
src=
"javascripts/bootstrap.js"
></script>
</html>
\ No newline at end of file
</script>
<script
src=
"javascripts/bootstrap.js"
></script>
</html>
...
...
views/map.ejs
View file @
828eab4
...
...
@@ -260,8 +260,8 @@
' <span class="tel">'
+
place
.
phone
+
"</span>"
+
"</div>"
+
'<div class="after"></div>'
;
'<a href="/comment"><button>후기 작성</button>'
;
"</div>"
+
'<div class="after"></div>'
;
contentNode
.
innerHTML
=
content
;
placeOverlay
.
setPosition
(
new
kakao
.
maps
.
LatLng
(
place
.
y
,
place
.
x
));
placeOverlay
.
setMap
(
map
);
...
...
Please
register
or
login
to post a comment