Showing
11 changed files
with
62 additions
and
21 deletions
1 | -export const join = (req, res) => res.render("join"); | ||
2 | -export const login = (req, res) => res.render("login"); | ||
3 | -export const logout = (req, res) => res.render("logout"); | ||
4 | -export const users = (req, res) => res.render("users"); | ||
5 | -export const userDetail = (req, res) => res.render("userDetail"); | ||
6 | -export const editProfile = (req, res) => res.render("editProfile"); | ||
7 | -export const changePassword = (req, res) => res.render("changePassword"); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +export const join = (req, res) => res.render("join", { pageTitle: "Join" }); | ||
2 | +export const login = (req, res) => res.render("login", { pageTitle: "Login" }); | ||
3 | +export const logout = (req, res) => res.render("logout", { pageTitle: "Logout" }); | ||
4 | +export const users = (req, res) => res.render("users", { pageTitle: "Users" }); | ||
5 | +export const userDetail = (req, res) => res.render("userDetail", { pageTitle: "User Detail" }); | ||
6 | +export const editProfile = (req, res) => res.render("editProfile", { pageTitle: "Edit Profile" }); | ||
7 | +export const changePassword = (req, res) => res.render("changePassword", { pageTitle: "Change Password" }); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -export const home = (req, res) => res.render("home"); | ||
2 | -export const search = (req, res) => res.render("search"); | ||
3 | -export const videos = (req, res) => res.render("videos"); | ||
4 | -export const upload = (req, res) => res.render("upload"); | ||
5 | -export const videoDetail = (req, res) => res.render("videoDetail"); | ||
6 | -export const editVideo = (req, res) => res.render("editVideo"); | ||
7 | -export const deleteVideo = (req, res) => res.render("deleteVideo"); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +export const home = (req, res) => res.render("home", { pageTitle: "Home" }); | ||
2 | + | ||
3 | +export const search = (req, res) => { | ||
4 | + const { | ||
5 | + query: { term: searchingBy } | ||
6 | + } = req; // == const searchingBy = req.query.term; | ||
7 | + res.render("search", { pageTitle: "Search", searchingBy }); | ||
8 | +} | ||
9 | + | ||
10 | + | ||
11 | +export const videos = (req, res) => res.send("videos", { pageTitle: "Videos" }); | ||
12 | +export const upload = (req, res) => res.render("upload", { pageTitle: "Upload" }); | ||
13 | +export const videoDetail = (req, res) => res.render("videoDetail", { pageTitle: "Video Detail" }); | ||
14 | +export const editVideo = (req, res) => res.render("editVideo", { pageTitle: "Edit Video" }); | ||
15 | +export const deleteVideo = (req, res) => res.render("deleteVideo", { pageTitle: "Delete Video" }); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -5,8 +5,8 @@ import { users, userDetail, editProfile, changePassword } from "../controllers/u | ... | @@ -5,8 +5,8 @@ import { users, userDetail, editProfile, changePassword } from "../controllers/u |
5 | const userRouter = express.Router(); | 5 | const userRouter = express.Router(); |
6 | 6 | ||
7 | userRouter.get(routes.users, users); | 7 | userRouter.get(routes.users, users); |
8 | -userRouter.get(routes.userDetail, userDetail); | ||
9 | userRouter.get(routes.editProfile, editProfile); | 8 | userRouter.get(routes.editProfile, editProfile); |
9 | +userRouter.get(routes.userDetail, userDetail); | ||
10 | userRouter.get(routes.changePassword, changePassword); | 10 | userRouter.get(routes.changePassword, changePassword); |
11 | 11 | ||
12 | export default userRouter; | 12 | export default userRouter; | ... | ... |
1 | extends layouts/main | 1 | extends layouts/main |
2 | 2 | ||
3 | block content | 3 | block content |
4 | - p Hello This is edit Profile | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
4 | + .form-container | ||
5 | + form(action=routes.editProfile, method="post") | ||
6 | + label(for="avatar") Avatar | ||
7 | + input(type="file", id="avatar", name="avatar") | ||
8 | + input(type="text", placeholder="Name", name="name") | ||
9 | + input(type="email", placeholder="Email", name="email") | ||
10 | + input(type="submit", value="Update Profile") | ||
11 | + a.form-container__link(href=routes.changePassword) Change Password | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | extends layouts/main | 1 | extends layouts/main |
2 | 2 | ||
3 | block content | 3 | block content |
4 | - p Hello This is Join | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
4 | + .form-container | ||
5 | + form(action=routes.join, method="post") | ||
6 | + input(type="text", name="name", placeholder="Full Name") | ||
7 | + input(type="email", name="email", placeholder="Email") | ||
8 | + input(type="password", name="password", placeholder="Password") | ||
9 | + input(type="password", name="password2", placeholder="Verify Password") | ||
10 | + input(type="submit", value="Join Now") | ||
11 | + include partials/socialLogin | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,7 +4,7 @@ doctype html | ... | @@ -4,7 +4,7 @@ doctype html |
4 | html | 4 | html |
5 | head | 5 | head |
6 | <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"> | 6 | <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"> |
7 | - title | #{siteName} | 7 | + title #{pageTitle} | #{siteName} |
8 | body | 8 | body |
9 | include ../partials/header | 9 | include ../partials/header |
10 | main | 10 | main | ... | ... |
1 | extends layouts/main | 1 | extends layouts/main |
2 | 2 | ||
3 | block content | 3 | block content |
4 | - p Hello This is Login | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
4 | + .form-container | ||
5 | + form(action=routes.login, method="post") | ||
6 | + input(type="email", name="email", placeholder="Email") | ||
7 | + input(type="password", name="password", placeholder="Password") | ||
8 | + input(type="submit", value="Log In") | ||
9 | + include partials/socialLogin | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -3,6 +3,9 @@ header.header | ... | @@ -3,6 +3,9 @@ header.header |
3 | a(href=routes.home) | 3 | a(href=routes.home) |
4 | i.fab.fa-youtube | 4 | i.fab.fa-youtube |
5 | .header__column | 5 | .header__column |
6 | + form(action=routes.search, method="get") | ||
7 | + input(type="text", placeholder="Search by term...", name="term") | ||
8 | + .header__column | ||
6 | ul | 9 | ul |
7 | li | 10 | li |
8 | a(href=routes.join) Join | 11 | a(href=routes.join) Join | ... | ... |
views/partials/socialLogin.pug
0 → 100644
-
Please register or login to post a comment