Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강상위
/
my-broadcasting
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강상위
2018-12-12 21:22:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7147ec3c9a33ebba9c3fcfa6aec309e054cace20
7147ec3c
1 parent
b49bd93d
Add Time Table List Page
-timetable 수정을 위한 페이지 추가
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletions
server_db/app.js
server_db/routing.js
server_db/views/contents_ttlist.ejs
server_db/views/ttlist.ejs
server_db/app.js
View file @
7147ec3
...
...
@@ -6,7 +6,7 @@ var mongoose = require('mongoose');
var
passport
=
require
(
'passport'
);
//DB연결
mongoose
.
connect
(
'mongodb://00:00@00
0/0
00'
);
mongoose
.
connect
(
'mongodb://00:00@00
/
00'
);
mongoose
.
Promise
=
global
.
Promise
;
var
db
=
mongoose
.
connection
;
...
...
server_db/routing.js
View file @
7147ec3
...
...
@@ -206,6 +206,44 @@ module.exports = function(app, Users, Timetables)
else
res
.
redirect
(
"/"
);
});
// 나만의 시간표 수정 - 로그인 필수
app
.
route
(
"/ttlist"
)
// GET - List로 보여주기
.
get
(
function
(
req
,
res
)
{
if
(
req
.
isAuthenticated
())
{
// Timetables에서 리스트로 유저에게 보여주기
Timetables
.
find
({
user_id
:
req
.
user
},
function
(
err
,
programs
)
{
if
(
err
)
{
console
.
log
(
err
);
res
.
send
(
"Error!"
);
}
else
{
console
.
log
(
"Show Programs"
);
res
.
render
(
"ttlist"
,
{
pl
:
programs
});
}
});
}
// 로그인 중이 아니라면
else
res
.
redirect
(
"/"
);
})
.
post
(
function
(
req
,
res
)
{
if
(
req
.
isAuthenticated
())
{
}
// 로그인 중이 아니라면
else
res
.
redirect
(
"/"
);
});
}
...
...
server_db/views/contents_ttlist.ejs
0 → 100644
View file @
7147ec3
<div class="contents_main">
<h1>ttlist</h1>
<% pl.forEach(val => { %>
<div>
<li><%=val.pname%></li>
<li><%=val.pweekday%></li>
<li><%=val.start_hour%>시 <%=val.start_min%>분</li>
</div>
<% }); %>
</div>
\ No newline at end of file
server_db/views/ttlist.ejs
0 → 100644
View file @
7147ec3
<html>
<head>
<title>
TTList
</title>
</head>
<body>
<
% include ./navigation_main.ejs %>
<
% include ./contents_ttlist.ejs %>
</body>
</html>
\ No newline at end of file
Please
register
or
login
to post a comment