Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added partials #58

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/views/course-create.ejs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="../css/course-create.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<title>Create Course</title>
</head>

<body>
<%- include('partials/header.ejs', {title:"Create Course", style: "course-create"}) %>
<section class="wizard-section">
<div class="row no-gutters">
<div class="col-lg-6 col-md-6">
Expand Down Expand Up @@ -236,6 +226,4 @@
});
});
</script>
</body>

</html>
<%- include('partials/footer.ejs') %>
15 changes: 4 additions & 11 deletions src/views/course.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../css/course.css" />
<title>Courses</title>
</head>
<body>

<%- include('partials/header.ejs', {title:"Courses", style: "course"}) %>

<div class="course-container">
<h1>Courses</h1>
<form action="/search-course" method="POST">
Expand Down Expand Up @@ -34,5 +28,4 @@
</ul>
</div>
</div>
</body>
</html>
<%- include('partials/footer.ejs') %>
55 changes: 23 additions & 32 deletions src/views/login.ejs
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/login.css"> <!-- Include your CSS file -->
<title>Login</title>
</head>
<body>
<div class="login-container">
<h1>Login</h1>

<!-- Display error flash message if available -->
<% if (messages && messages.length > 0) { %>
<%- include('partials/header.ejs', {title:"Login", style: "login"}) %>
<div class="login-container">
<h1>Login</h1>

<!-- Display error flash message if available -->
<% if (messages && messages.length> 0) { %>
<div class="alert alert-danger">
<%= messages[0] %>
</div>
<% } %>

<form action="/login" method="POST">
<input type="hidden" name="_csrf" value="<%= locals.csrfToken %>">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<button type="submit">Login</button>
</div>
</form>
<p>Don't have an account? <a href="/register">Register here</a></p>
</div>
</body>
</html>
<form action="/login" method="POST">
<input type="hidden" name="_csrf" value="<%= locals.csrfToken %>">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<button type="submit">Login</button>
</div>
</form>
<p>Don't have an account? <a href="/register">Register here</a></p>
</div>
<%- include('partials/footer.ejs') %>
2 changes: 2 additions & 0 deletions src/views/partials/footer.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
</body>
</html>
12 changes: 12 additions & 0 deletions src/views/partials/header.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/<%= style %>.css"> <!-- Include your CSS file -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<title><%- title %></title>
</head>
<body>
13 changes: 2 additions & 11 deletions src/views/profile.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Profile</title>
<link rel="stylesheet" href="/css/profile.css">
</head>
<body>

<%- include('partials/header.ejs', {title:"Profile", style: "profile"}) %>
<div class="container">
<div class="profile-container">
<h1>Welcome, <%= user.username %>!</h1>
Expand Down Expand Up @@ -128,5 +120,4 @@
<% } %>
</div>
</div>

</body>
<%- include('partials/footer.ejs') %>
13 changes: 2 additions & 11 deletions src/views/register.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/register.css"> <!-- Include your CSS file -->
<title>Registration</title>
</head>
<body>
<%- include('partials/header.ejs', {title:"Register", style: "register"}) %>
<div class="registration-container">
<h1>Registration</h1>

Expand Down Expand Up @@ -45,5 +37,4 @@
</form>
<p>Already have an account? <a href="/login">Login here</a></p>
</div>
</body>
</html>
<%- include('partials/footer.ejs') %>