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 21:32:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
666fa726b604ddf8affa259e7816b87d05eefb10
666fa726
1 parent
828eab44
후기 작성 링크 파라미터 수정
map.ejs에서 comment.ejs로 카페고유 아이디값 넘겨주는 작업 진행
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
9 deletions
routes/index.js
sessions/MXP2CmSgUZMQBQpxDdHZMp-WIazumm2B.json
sessions/ZDmDII_a23sx9VaWvB47v1HABYm6QeMN.json
sessions/s0fg_Df0Livu-QHPigJSTtHSwdT1WnTm.json
views/comment.ejs
views/map.ejs
routes/index.js
View file @
666fa72
...
...
@@ -159,13 +159,14 @@ router.get("/logout", function (req, res) {
res
.
redirect
(
"/"
);
});
router
.
get
(
"/comment"
,
function
(
req
,
res
)
{
res
.
render
(
"comment"
);
router
.
get
(
"/comment/:cafeId"
,
function
(
req
,
res
)
{
const
cafeId
=
req
.
params
.
cafeId
;
res
.
render
(
"comment"
,
{
cafeId
:
cafeId
});
});
// 카페 후기 등록
router
.
post
(
"/comment"
,
function
(
req
,
res
)
{
var
cafeId
=
req
.
quer
y
.
cafeId
;
var
cafeId
=
req
.
bod
y
.
cafeId
;
var
price
=
req
.
body
.
price
;
var
kindness
=
req
.
body
.
kindness
;
var
noise
=
req
.
body
.
noise
;
...
...
@@ -179,7 +180,7 @@ router.post("/comment", function (req, res) {
// 입력받지 않은 데이터가 하나라도 존재 (카페아이디는 후기작성시 자동으로 받아옴)
if
(
!
cafeId
||
!
price
||
!
kindness
||
!
noise
||
!
accessibility
)
{
console
.
log
(
"입력받지 않은 데이터 존재"
);
res
.
redirect
(
"/comment"
);
// 후기작성으로 다시 이동
res
.
redirect
(
"/comment
/:cafeId
"
);
// 후기작성으로 다시 이동
}
var
sql
=
...
...
sessions/MXP2CmSgUZMQBQpxDdHZMp-WIazumm2B.json
0 → 100644
View file @
666fa72
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622031757269
}
\ No newline at end of file
sessions/ZDmDII_a23sx9VaWvB47v1HABYm6QeMN.json
0 → 100644
View file @
666fa72
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622032034021
}
\ No newline at end of file
sessions/s0fg_Df0Livu-QHPigJSTtHSwdT1WnTm.json
0 → 100644
View file @
666fa72
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622032180844
}
\ No newline at end of file
views/comment.ejs
View file @
666fa72
...
...
@@ -5,7 +5,7 @@
<title>
Enroll Comment
</title>
<link
rel=
"stylesheet"
href=
"stylesheets/bootstrap.css"
>
<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>
...
...
@@ -32,8 +32,7 @@
<div
class=
"col-2"
></div>
<div
class=
"col-8"
>
<hr
class=
"my-4"
style=
"background-color: white"
>
<form
method=
"post"
>
<div
class
></div>
<form
action=
"/comment"
method=
"post"
>
<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
>
...
...
@@ -86,5 +85,4 @@
</div>
</section>
</body>
<script
src=
"javascripts/bootstrap.js"
></script>
</html>
\ No newline at end of file
...
...
views/map.ejs
View file @
666fa72
...
...
@@ -227,6 +227,7 @@
return
marker
;
}
function
displayPlaceInfo
(
place
)
{
console
.
log
(
place
);
var
content
=
'<div class="placeinfo">'
+
' <a class="title" href="'
+
...
...
@@ -260,7 +261,7 @@
' <span class="tel">'
+
place
.
phone
+
"</span>"
+
'<a href="/comment"><button>후기 작성</button>'
;
`<a href="/comment/
${
place
.
id
}
"><button>후기 작성</button>`
;
"</div>"
+
'<div class="after"></div>'
;
contentNode
.
innerHTML
=
content
;
placeOverlay
.
setPosition
(
new
kakao
.
maps
.
LatLng
(
place
.
y
,
place
.
x
));
...
...
Please
register
or
login
to post a comment