Mukho

Update Title

...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
26 </div> 26 </div>
27 </nav> 27 </nav>
28 <div class="container px-5 my-5"> 28 <div class="container px-5 my-5">
29 + <h2>로그인</h2>
29 <form action="/login" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN"> 30 <form action="/login" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN">
30 <div class="form-floating mb-3"> 31 <div class="form-floating mb-3">
31 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" /> 32 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" />
......
...@@ -24,4 +24,4 @@ DB 구조(*ID, password, type) -> 형식에 맞게 추가<br> ...@@ -24,4 +24,4 @@ DB 구조(*ID, password, type) -> 형식에 맞게 추가<br>
24 LF 오류시 git config --global core.autocrlf true 입력<br><br> 24 LF 오류시 git config --global core.autocrlf true 입력<br><br>
25 25
26 26
27 -최종 수정: 2021-11-15 21:30
...\ No newline at end of file ...\ No newline at end of file
27 +최종 수정: 2021-11-16 14:03
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -13,8 +13,9 @@ router.get('/:page', function(req, res, next) { ...@@ -13,8 +13,9 @@ router.get('/:page', function(req, res, next) {
13 13
14 board.query(sql, function(err,rows) { 14 board.query(sql, function(err,rows) {
15 if (err) console.error("err : " + err); 15 if (err) console.error("err : " + err);
16 - res.render('list.ejs', {title: '게시판 리스트', rows: rows}) 16 + var id = req.user;
17 - 17 + if(!id) id = "수정예정"
18 + res.render('list.ejs', {'ID':id, title: '게시판 리스트', rows: rows})
18 }) 19 })
19 }); 20 });
20 21
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 - <title><%= title %></title> 4 + <title>묵호 - 놀이터</title>
5 + <!-- Favicon-->
6 + <link rel="icon" type="image/x-icon" href="../assets/favicon.ico" />
5 <link rel='stylesheet' href='/stylesheets/style.css'/> 7 <link rel='stylesheet' href='/stylesheets/style.css'/>
6 </head> 8 </head>
7 <body> 9 <body>
8 -<h1><%= title %></h1> 10 + <!-- Navigation-->
9 -<a href="/board/write">글쓰기</a> 11 + <nav class="navbar navbar-light bg-light static-top">
10 -<table border="1"> 12 + <div class="container">
11 - <tr> 13 + <a class="navbar-brand" href="http://localhost:3000/main">묵호의 놀이터</a>
12 - <td>번호</td> 14 + <div class="user">
13 - <td>작성자</td> 15 + <a> <%= ID %> 님 안녕하세요 </section></a>
14 - <td>제목</td> 16 + <a class="btn btn-primary" href="http://localhost:3000/logout">로그아웃</a>
15 - <td>조회수</td> 17 + </div>
16 - <td>수정일</td> 18 + </div>
17 - <td>등록일</td> 19 + </nav>
18 - </tr> 20 + <h1><%= title %></h1>
19 - <% 21 + <a href="/board/write">글쓰기</a>
20 - for(var i=0; i<rows.length; i++) 22 + <table border="1">
21 - { 23 + <tr>
22 - var data = rows[i]; 24 + <td>번호</td>
23 - %> 25 + <td>작성자</td>
24 - <tr> 26 + <td>제목</td>
25 - <td><%=data.idx%></td> 27 + <td>조회수</td>
26 - <td><%=data.name%></td> 28 + <td>수정일</td>
27 - <td><a href="/board/read/<%=data.idx%>"><%=data.title%></a></td> 29 + <td>등록일</td>
28 - <td><%=data.hit%></td> 30 + </tr>
29 - <td><%=data.modidate%></td> 31 + <%
30 - <td><%=data.regdate%></td> 32 + for(var i=0; i<rows.length; i++)
31 - </tr> 33 + {
32 - <%}%> 34 + var data = rows[i];
33 -</table> 35 + %>
36 + <tr>
37 + <td><%=data.idx%></td>
38 + <td><%=data.name%></td>
39 + <td><a href="/board/read/<%=data.idx%>"><%=data.title%></a></td>
40 + <td><%=data.hit%></td>
41 + <td><%=data.modidate%></td>
42 + <td><%=data.regdate%></td>
43 + </tr>
44 + <%}%>
45 + </table>
34 </body> 46 </body>
35 </html> 47 </html>
36 48
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
26 </div> 26 </div>
27 </nav> 27 </nav>
28 <div class="container px-5 my-5"> 28 <div class="container px-5 my-5">
29 + <h2>로그인</h2>
29 <form action="/login" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN"> 30 <form action="/login" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN">
30 <div class="form-floating mb-3"> 31 <div class="form-floating mb-3">
31 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" /> 32 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" />
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <div class="container"> 21 <div class="container">
22 <a class="navbar-brand" href="http://localhost:3000/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="http://localhost:3000/main">묵호의 놀이터</a>
23 <div class="user"> 23 <div class="user">
24 - <a> <%= ID %> 님 안녕하세요 </section></a> 24 + <a> <%= ID %> 님 안녕하세요 </a>
25 <a class="btn btn-primary" href="http://localhost:3000/logout">로그아웃</a> 25 <a class="btn btn-primary" href="http://localhost:3000/logout">로그아웃</a>
26 </div> 26 </div>
27 </div> 27 </div>
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
26 </div> 26 </div>
27 </nav> 27 </nav>
28 <div class="container px-5 my-5"> 28 <div class="container px-5 my-5">
29 + <h2>회원가입</h2>
29 <form action="/register" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN"> 30 <form action="/register" method="post" id="contactForm" data-sb-form-api-token="API_TOKEN">
30 <div class="form-floating mb-3"> 31 <div class="form-floating mb-3">
31 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" /> 32 <input class="form-control" name="ID" id="ID" type="text" required minlength='1' maxlength='20' placeholder="ID" data-sb-validations="required" />
......