Flare-k

[Modify] Login, Join, Search View

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
......
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
......
......@@ -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;
......
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
......
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
......
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
......
......@@ -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
......
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
......
......@@ -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
......
.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
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
......