Created a base template and added to the others

This commit is contained in:
JKuijperM 2026-02-04 15:01:40 +01:00
parent 9511ea93ba
commit 595ba93e39
16 changed files with 710 additions and 691 deletions

View File

@ -1,3 +1,43 @@
body {
margin: 0;
font-family: system-ui, sans-serif;
background: #f6f7f9;
}
.topbar {
background: #1f2937;
padding: 12px 20px;
}
.nav {
display: flex;
align-items: center;
gap: 16px;
}
.nav a {
color: #e5e7eb;
text-decoration: none;
font-weight: 500;
}
.nav a:hover {
text-decoration: underline;
}
.spacer {
flex: 1;
}
.user {
color: #9ca3af;
margin-right: 8px;
}
.content {
padding: 24px;
}
.dashboard-grid { .dashboard-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 500px)); grid-template-columns: repeat(auto-fit, minmax(300px, 500px));

View File

@ -1,11 +1,6 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE> {% block title %}Eliminar{% endblock %}
<html> {% block content %}
<head>
<title>Eliminar</title>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
</head>
<body>
<h1>Eliminar cuenta</h1> <h1>Eliminar cuenta</h1>
@ -20,5 +15,4 @@
<a href="{% url 'account_list' %}">Cancelar</a> <a href="{% url 'account_list' %}">Cancelar</a>
</form> </form>
</body> {% endblock %}
</html>

View File

@ -1,11 +1,6 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE> {% block title %}Cuenta{% endblock %}
<html> {% block content %}
<head>
<title>Cuenta</title>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
</head>
<body>
<h1> <h1>
{% if form.instance.pk %} {% if form.instance.pk %}
@ -23,5 +18,4 @@
<a href="{% url 'account_list' %}">Cancelar</a> <a href="{% url 'account_list' %}">Cancelar</a>
</form> </form>
</body> {% endblock %}
</html>

View File

@ -1,11 +1,6 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE> {% block title %}Cuentas{% endblock %}
<html> {% block content %}
<head>
<title>Cuentas</title>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
</head>
<body>
<h1>Mis cuentas</h1> <h1>Mis cuentas</h1>
@ -40,5 +35,4 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</body> {% endblock %}
</html>

View File

@ -0,0 +1,36 @@
{% load static %}
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>{% block title %}Expenses manager{% endblock %}</title>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<header class="topbar">
<nav class="nav">
<a href="{% url 'home' %}">Home</a>
<a href="{% url 'dashboard' %}">Dashboard</a>
<a href="{% url 'expense_list' %}">Gastos</a>
<a href="{% url 'account_list' %}">Cuentas</a>
<a href="{% url 'income_list' %}">Ingresos</a>
<a href="{% url 'tag_list' %}">Etiquetas</a>
<span class="spacer"></span>
<span class="user">
{{ request.user.username }}
</span>
<!-- <a href="{ url 'logout' }">Salir</a> -->
</nav>
</header>
<main class="content">
{% block content %}{% endblock %}
</main>
</body>
</html>

View File

@ -1,12 +1,8 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
{% block title %}Dashboard{% endblock %}
<html> {% block content %}
<head>
<title>Dashboard</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<h1> <h1>
@ -254,5 +250,4 @@
<hr> <hr>
</body> {% endblock %}
</html>

View File

@ -1,10 +1,8 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html>
<head>
<title>Borrar gasto</title>
</head>
<body> {% block title %}Borrar gasto{% endblock %}
{% block content %}
<h1>Borrar gasto</h1> <h1>Borrar gasto</h1>
<p> <p>
@ -23,5 +21,4 @@
</form> </form>
<a href="{% url 'expense_list' %}">Cancelar</a> <a href="{% url 'expense_list' %}">Cancelar</a>
</body> {% endblock %}
</html>

View File

@ -1,16 +1,14 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html>
<head> {% block title %}
<title>
{% if form.instance.pk %} {% if form.instance.pk %}
Editar gasto Editar gasto
{% else %} {% else %}
Nuevo gasto Nuevo gasto
{% endif %} {% endif %}
</title> {% endblock %}
</head>
<body> {% block content %}
<h1> <h1>
{% if form.instance.pk %} {% if form.instance.pk %}
Editar gasto Editar gasto
@ -32,5 +30,4 @@
</form> </form>
<a href="{% url 'expense_list' %}">Volver</a> <a href="{% url 'expense_list' %}">Volver</a>
</body> {% endblock %}
</html>

View File

@ -1,11 +1,11 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE html>
<html>
<head> {% block title %}
<title>Gastos</title> Gastos
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}"> {% endblock %}
</head>
<body> {% block content %}
<h1>Mis gastos</h1> <h1>Mis gastos</h1>
<form method="get"> <form method="get">
@ -138,5 +138,4 @@
</span> </span>
</div> </div>
</body> {% endblock %}
</html>

View File

@ -1,13 +1,8 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
</head>
<body> {% block title %}Home{% endblock %}
{% block content %}
<h1>Home</h1> <h1>Home</h1>
@ -65,5 +60,4 @@
</section> </section>
</body> {% endblock %}
</html>

View File

@ -1,10 +1,7 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html> {% block title %}Borrar ingreso{% endblock %}
<head>
<title>Borrar ingreso</title>
</head>
<body> {% block content %}
<h1>Borrar ingreso</h1> <h1>Borrar ingreso</h1>
<p> <p>
@ -23,5 +20,4 @@
</form> </form>
<a href="{% url 'income_list' %}">Cancelar</a> <a href="{% url 'income_list' %}">Cancelar</a>
</body> {% endblock %}
</html>

View File

@ -1,16 +1,13 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html> {% block title %}
<head>
<title>
{% if form.instance.pk %} {% if form.instance.pk %}
Editar ingreso Editar ingreso
{% else %} {% else %}
Nuevo ingreso Nuevo ingreso
{% endif %} {% endif %}
</title> {% endblock %}
</head>
<body> {% block content %}
<h1> <h1>
{% if form.instance.pk %} {% if form.instance.pk %}
Editar ingreso Editar ingreso
@ -32,5 +29,4 @@
</form> </form>
<a href="{% url 'income_list' %}">Volver</a> <a href="{% url 'income_list' %}">Volver</a>
</body> {% endblock %}
</html>

View File

@ -1,11 +1,6 @@
{% load static %} {% extends "expenses/base.html" %}
<!DOCTYPE html> {% block title %}Ingresos{% endblock %}
<html> {% block content %}
<head>
<title>Ingresos</title>
<link rel="stylesheet" href="{% static 'expenses/css/base.css' %}">
</head>
<body>
<h1>Mis ingresos</h1> <h1>Mis ingresos</h1>
<a href="{% url 'income_create' %}"> Nuevo ingreso</a> <a href="{% url 'income_create' %}"> Nuevo ingreso</a>
@ -40,5 +35,4 @@
</tbody> </tbody>
</table> </table>
</body> {% endblock %}
</html>

View File

@ -1,8 +1,6 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html> {% block title %}Etiquetas{% endblock %}
<head> {% block content %}
</head>
<body>
<h1>Eliminar etiqueta</h1> <h1>Eliminar etiqueta</h1>
<form method="post"> <form method="post">
@ -11,5 +9,4 @@
</form> </form>
<a href="{% url 'tag_list' %}">Cancelar</a> <a href="{% url 'tag_list' %}">Cancelar</a>
</body> {% endblock %}
</html>

View File

@ -1,8 +1,6 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html> {% block title %}Etiquetas{% endblock %}
<head> {% block content %}
</head>
<body>
<h1>Etiqueta</h1> <h1>Etiqueta</h1>
<form method="post"> <form method="post">
@ -12,5 +10,4 @@
</form> </form>
<a href="{% url 'tag_list' %}">Volver</a> <a href="{% url 'tag_list' %}">Volver</a>
</body> {% endblock %}
</html>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html> {% extends "expenses/base.html" %}
<html> {% block title %}Etiquetas{% endblock %}
<head> {% block content %}
</head>
<body>
<h1>Etiquetas</h1> <h1>Etiquetas</h1>
<a href="{% url 'tag_create' %}"> Nueva etiqueta</a>
<ul> <ul>
{% for tag in tags %} {% for tag in tags %}
<li> <li>
@ -16,5 +16,4 @@
<li>No hay etiquetas</li> <li>No hay etiquetas</li>
{% endfor %} {% endfor %}
</ul> </ul>
</body> {% endblock %}
</html>