Add login and home page

This commit is contained in:
2025-12-10 18:28:07 +05:30
parent df595e4f19
commit 27aac4da8c
13 changed files with 239 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="{% static "notes/stylesheets/style.css" %}" type="text/css">
<title>{% block title %}{% endblock %} | Appunti</title>
</head>
<body>
<header>
<a href="{% url "home" %}" class="home">Appunti</a>
<a href="#">
<img src="{% static "notes/images/icons/post-a-note.png" %}" alt="Post a note" title="Post a note" />
</a>
<a href="#">
<img src="{% static "notes/images/icons/profile.png" %}" alt="Profile" title="Profile" />
</a>
</header>
<main>
{% block body %}
{% endblock %}
</main>
</body>
</html>

View File

@@ -0,0 +1,22 @@
{% extends "notes/base.html" %}
{% block title %}Dashboard{% endblock %}
{% block body %}
<h1>Dashboard</h1>
<h2>Notes for you</h2>
{% if notes %}
<div class="notes">
{% for note in notes %}
<div class="note">
<p>{{ note.note }}</p>
<p class="note-from">From {{ note.from_user.visible_name }}</p>
<p class="note-at">{{ note.created_at|date:"j M, H:i"}}</p>
</div>
{% endfor %}
</div>
{% else %}
<div class="card">No Notes found</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,19 @@
{% extends "notes/base.html" %}
{% block title %}Login{% endblock %}
{% block body %}
<div id="header">
<h1>Appunti Login Screen</h1>
</div>
<div class="body">
<div class="login">
<form action="{% url 'login' %}" method="POST">
{% csrf_token %}
<h2>Welcome!</h2>
<p>Please login to continue</p>
{{ form.as_p }}
<button type="submit">Login</button>
</form>
</div>
</div>
{% endblock %}