Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강연욱
/
myYoutube
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Flare-k
2020-05-19 20:42:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cc2f4806dccd1c7ea6bc18a004971ead505e44e9
cc2f4806
1 parent
0e764ed9
[Modify] Login, Join, Search View
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
62 additions
and
21 deletions
controllers/userController.js
controllers/videoController.js
routers/userRouter.js
views/editProfile.pug
views/home.pug
views/join.pug
views/layouts/main.pug
views/login.pug
views/partials/header.pug
views/partials/socialLogin.pug
views/search.pug
controllers/userController.js
View file @
cc2f480
export
const
join
=
(
req
,
res
)
=>
res
.
render
(
"join"
);
export
const
login
=
(
req
,
res
)
=>
res
.
render
(
"login"
);
export
const
logout
=
(
req
,
res
)
=>
res
.
render
(
"logout"
);
export
const
users
=
(
req
,
res
)
=>
res
.
render
(
"users"
);
export
const
userDetail
=
(
req
,
res
)
=>
res
.
render
(
"userDetail"
);
export
const
editProfile
=
(
req
,
res
)
=>
res
.
render
(
"editProfile"
);
export
const
changePassword
=
(
req
,
res
)
=>
res
.
render
(
"changePassword"
);
\ No newline at end of file
export
const
join
=
(
req
,
res
)
=>
res
.
render
(
"join"
,
{
pageTitle
:
"Join"
});
export
const
login
=
(
req
,
res
)
=>
res
.
render
(
"login"
,
{
pageTitle
:
"Login"
});
export
const
logout
=
(
req
,
res
)
=>
res
.
render
(
"logout"
,
{
pageTitle
:
"Logout"
});
export
const
users
=
(
req
,
res
)
=>
res
.
render
(
"users"
,
{
pageTitle
:
"Users"
});
export
const
userDetail
=
(
req
,
res
)
=>
res
.
render
(
"userDetail"
,
{
pageTitle
:
"User Detail"
});
export
const
editProfile
=
(
req
,
res
)
=>
res
.
render
(
"editProfile"
,
{
pageTitle
:
"Edit Profile"
});
export
const
changePassword
=
(
req
,
res
)
=>
res
.
render
(
"changePassword"
,
{
pageTitle
:
"Change Password"
});
\ No newline at end of file
...
...
controllers/videoController.js
View file @
cc2f480
export
const
home
=
(
req
,
res
)
=>
res
.
render
(
"home"
);
export
const
search
=
(
req
,
res
)
=>
res
.
render
(
"search"
);
export
const
videos
=
(
req
,
res
)
=>
res
.
render
(
"videos"
);
export
const
upload
=
(
req
,
res
)
=>
res
.
render
(
"upload"
);
export
const
videoDetail
=
(
req
,
res
)
=>
res
.
render
(
"videoDetail"
);
export
const
editVideo
=
(
req
,
res
)
=>
res
.
render
(
"editVideo"
);
export
const
deleteVideo
=
(
req
,
res
)
=>
res
.
render
(
"deleteVideo"
);
\ No newline at end of file
export
const
home
=
(
req
,
res
)
=>
res
.
render
(
"home"
,
{
pageTitle
:
"Home"
});
export
const
search
=
(
req
,
res
)
=>
{
const
{
query
:
{
term
:
searchingBy
}
}
=
req
;
// == const searchingBy = req.query.term;
res
.
render
(
"search"
,
{
pageTitle
:
"Search"
,
searchingBy
});
}
export
const
videos
=
(
req
,
res
)
=>
res
.
send
(
"videos"
,
{
pageTitle
:
"Videos"
});
export
const
upload
=
(
req
,
res
)
=>
res
.
render
(
"upload"
,
{
pageTitle
:
"Upload"
});
export
const
videoDetail
=
(
req
,
res
)
=>
res
.
render
(
"videoDetail"
,
{
pageTitle
:
"Video Detail"
});
export
const
editVideo
=
(
req
,
res
)
=>
res
.
render
(
"editVideo"
,
{
pageTitle
:
"Edit Video"
});
export
const
deleteVideo
=
(
req
,
res
)
=>
res
.
render
(
"deleteVideo"
,
{
pageTitle
:
"Delete Video"
});
\ No newline at end of file
...
...
routers/userRouter.js
View file @
cc2f480
...
...
@@ -5,8 +5,8 @@ import { users, userDetail, editProfile, changePassword } from "../controllers/u
const
userRouter
=
express
.
Router
();
userRouter
.
get
(
routes
.
users
,
users
);
userRouter
.
get
(
routes
.
userDetail
,
userDetail
);
userRouter
.
get
(
routes
.
editProfile
,
editProfile
);
userRouter
.
get
(
routes
.
userDetail
,
userDetail
);
userRouter
.
get
(
routes
.
changePassword
,
changePassword
);
export
default
userRouter
;
...
...
views/editProfile.pug
View file @
cc2f480
extends layouts/main
block content
p Hello This is edit Profile
\ No newline at end of file
.form-container
form(action=routes.editProfile, method="post")
label(for="avatar") Avatar
input(type="file", id="avatar", name="avatar")
input(type="text", placeholder="Name", name="name")
input(type="email", placeholder="Email", name="email")
input(type="submit", value="Update Profile")
a.form-container__link(href=routes.changePassword) Change Password
\ No newline at end of file
...
...
views/home.pug
View file @
cc2f480
extends layouts/main
block content
p Hello This is Pug
\ No newline at end of file
.videos
h1 Video
\ No newline at end of file
...
...
views/join.pug
View file @
cc2f480
extends layouts/main
block content
p Hello This is Join
\ No newline at end of file
.form-container
form(action=routes.join, method="post")
input(type="text", name="name", placeholder="Full Name")
input(type="email", name="email", placeholder="Email")
input(type="password", name="password", placeholder="Password")
input(type="password", name="password2", placeholder="Verify Password")
input(type="submit", value="Join Now")
include partials/socialLogin
\ No newline at end of file
...
...
views/layouts/main.pug
View file @
cc2f480
...
...
@@ -4,7 +4,7 @@ doctype html
html
head
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
title | #{siteName}
title
#{pageTitle}
| #{siteName}
body
include ../partials/header
main
...
...
views/login.pug
View file @
cc2f480
extends layouts/main
block content
p Hello This is Login
\ No newline at end of file
.form-container
form(action=routes.login, method="post")
input(type="email", name="email", placeholder="Email")
input(type="password", name="password", placeholder="Password")
input(type="submit", value="Log In")
include partials/socialLogin
\ No newline at end of file
...
...
views/partials/header.pug
View file @
cc2f480
...
...
@@ -3,6 +3,9 @@ header.header
a(href=routes.home)
i.fab.fa-youtube
.header__column
form(action=routes.search, method="get")
input(type="text", placeholder="Search by term...", name="term")
.header__column
ul
li
a(href=routes.join) Join
...
...
views/partials/socialLogin.pug
0 → 100644
View file @
cc2f480
.social-login
button.social-login--github
span
i.fab.fa-github
| Continue with Github
button.social-login--facebook
span
i.fab.fa-facebook
| Continue with Facebook
\ No newline at end of file
views/search.pug
View file @
cc2f480
extends layouts/main
block content
p Hello This is Search
\ No newline at end of file
.search__header
h3 Searching for: #{searchingBy}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment