This commit is contained in:
AndrewTrieu
2023-03-11 18:19:16 +02:00
parent ee0936c8b1
commit f14618b7cc
16 changed files with 70 additions and 59 deletions

View File

@@ -1,15 +1,15 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>MCQ Application</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta charset="utf-8">
</head>
<body>
<div class="container paper">
<%~ it.body %>
</div>
</body>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://unpkg.com/papercss@1.8.2/dist/paper.min.css">
<title>Quizzy Application</title>
</head>
<body>
<div class="paper container">
<%~ it.body %>
</div>
</body>
</html>

View File

@@ -1,5 +1,7 @@
<% layout("./layouts/layout.eta") %>
<a href="/">Home</a>
<h1>Login</h1>
<form method="POST" action="/auth/login">
@@ -10,9 +12,13 @@
<input type="submit" value="Login" />
</form>
<% if(it.error){ %>
<b><%= it.error %></b>
<br/>
<% if (it.errors) { %>
<% Object.keys(it.errors).forEach((error) => { %>
<% Object.values(it.errors[error]).forEach((err) => { %>
<%= err %>
<% }); %>
<% }); %>
<% } %>
<br/>
<a href="/auth/register">Are you a new user?</a>
<a href="/auth/register">Are you a new user?</a>

View File

@@ -13,7 +13,7 @@
<h2>Statistics</h2>
<p>Total number of:</p>
<ul>
<li>Topics: <%= it.topics %></li>
<li>Questions: <%= it.questions %></li>
<li>Answers: <%= it.answers %></li>
<li>Topics: <%= it.totalTopics %></li>
<li>Questions: <%= it.totalQuestions %></li>
<li>Answers: <%= it.totalAnswers %></li>
</ul>

View File

@@ -1,5 +1,7 @@
<% layout("./layouts/layout.eta") %>
<a href="/">Home</a>
<h1>New user registration</h1>
<form method="POST" action="/auth/register">
@@ -18,4 +20,5 @@
<% }); %>
<% } %>
<br/>
<a href="/auth/login">Are you already registered?</a>
<a href="/auth/login">Are you already registered?</a>

View File

@@ -21,8 +21,9 @@
<p>No available topics.</p>
<% } %>
<% if (it.errors) { %>
<h2>Add a Topic</h2>
<% if (it.errors) { %>
<ul>
<% Object.keys(it.errors).forEach((error) => { %>
<% Object.values(it.errors[error]).forEach((err) => { %>