First commit
This commit is contained in:
23
app/app_template/templates/base.html
Normal file
23
app/app_template/templates/base.html
Normal file
@ -0,0 +1,23 @@
|
||||
{% load static %}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<title>Example website</title>
|
||||
<link rel="stylesheet" href="{% static 'css/main.css' %}">
|
||||
<script defer src="{% static 'js/index.js' %}"></script>
|
||||
</head>
|
||||
<body
|
||||
data-host="{{ request.get_host }}"
|
||||
data-scheme="{{ request.scheme }}"
|
||||
>
|
||||
<div class="container">
|
||||
<header>
|
||||
<nav id="nav" class="nav">{% include 'components/_nav.html' %}</nav>
|
||||
</header>
|
||||
<main id="main">{% include page %}</main>
|
||||
<footer class="footer">My footer</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
app/app_template/templates/components/_nav.html
Normal file
54
app/app_template/templates/components/_nav.html
Normal file
@ -0,0 +1,54 @@
|
||||
<ul class="nav__ul" data-controller="navbar">
|
||||
{# Links always visible #}
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
class="nav__link nav__link--page{% if active_nav == "home" %} active{% endif %}"
|
||||
data-target="home"
|
||||
>
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
{% if user.is_authenticated %}
|
||||
{# Links only if identified #}
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
class="nav__link nav__link--page{% if active_nav == "profile" %} active{% endif %}"
|
||||
data-target="profile"
|
||||
>
|
||||
Profile
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
class="nav__link"
|
||||
id="logout"
|
||||
>
|
||||
Logout
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
{# Links only if not identified #}
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
class="nav__link nav__link--page{% if active_nav == "login" %} active{% endif %}"
|
||||
data-target="login"
|
||||
>
|
||||
Login
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
class="nav__link nav__link--page{% if active_nav == "signup" %} active{% endif %}"
|
||||
data-target="signup"
|
||||
data-action="click->message#displayUpdateForm"
|
||||
>
|
||||
Signup
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
3
app/app_template/templates/components/_tasks.html
Normal file
3
app/app_template/templates/components/_tasks.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% for task in tasks %}
|
||||
<li>{{ task }}</li>
|
||||
{% endfor %}
|
1
app/app_template/templates/pages/404.html
Normal file
1
app/app_template/templates/pages/404.html
Normal file
@ -0,0 +1 @@
|
||||
<h1>404</h1>
|
17
app/app_template/templates/pages/home.html
Normal file
17
app/app_template/templates/pages/home.html
Normal file
@ -0,0 +1,17 @@
|
||||
<section>
|
||||
<h1>Welcome to an example of browsing with WebSockets over the Wire</h1>
|
||||
<p>You will be able to experience a simple structure with a registration, a login and a private page.</p>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Laps</h2>
|
||||
<p>
|
||||
<button id="add-lap">Add lap</button>
|
||||
</p>
|
||||
<ul id="laps"></ul>
|
||||
</section>
|
||||
<section>
|
||||
<h2>TODO</h2>
|
||||
<input type="text" id="task">
|
||||
<button id="add-task">Add task</button>
|
||||
<ul id="todo"></ul>
|
||||
</section>
|
8
app/app_template/templates/pages/login.html
Normal file
8
app/app_template/templates/pages/login.html
Normal file
@ -0,0 +1,8 @@
|
||||
<h1>Login</h1>
|
||||
<form id="login-form">
|
||||
{% if user_does_not_exist %}
|
||||
<h2>The user does not exist or the password is wrong.</h2>
|
||||
{% endif %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" class="button" value="Login">
|
||||
</form>
|
5
app/app_template/templates/pages/profile.html
Normal file
5
app/app_template/templates/pages/profile.html
Normal file
@ -0,0 +1,5 @@
|
||||
<h1>Profile</h1>
|
||||
<h2>Username</h2>
|
||||
<p>{{ user.username }}</p>
|
||||
<h2>Email</h2>
|
||||
<p>{{ user.email }}</p>
|
11
app/app_template/templates/pages/signup.html
Normal file
11
app/app_template/templates/pages/signup.html
Normal file
@ -0,0 +1,11 @@
|
||||
<h1>Signup</h1>
|
||||
<form id="signup-form">
|
||||
{% if user_exist %}
|
||||
<p>Email already exist</p>
|
||||
{% endif %}
|
||||
{% if passwords_do_not_match %}
|
||||
<p>Passwords do not match.</p>
|
||||
{% endif %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" class="button" value="Signup">
|
||||
</form>
|
Reference in New Issue
Block a user