rewrite frontend and logic in core app
This commit is contained in:
26
core/templates/core/base.html
Normal file
26
core/templates/core/base.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8">
|
||||
<title>finance planner</title>
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'core/style.css' %}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="title">
|
||||
📊 finance planner 💰
|
||||
</div>
|
||||
|
||||
<div id="navi">
|
||||
{% block navi %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
45
core/templates/core/subjects.html
Normal file
45
core/templates/core/subjects.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block navi %}
|
||||
<a href="{% url 'admin:index' %}">admin</a>
|
||||
|
|
||||
<a href="{% url 'logout' %}">logout</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>current subjects</h1>
|
||||
|
||||
{% if prediction_list %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="subject-cell">subject</td>
|
||||
<td class="date-cell">date</td>
|
||||
<td class="amount-cell">€</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for subject, transactions, info in prediction_list %}
|
||||
{% for transaction in transactions %}
|
||||
<tr>
|
||||
{% if forloop.counter == 1 %}
|
||||
<td rowspan="{{ transactions|length }}" class="subject-cell">{{ subject.name }}</td>
|
||||
{% endif %}
|
||||
<td class="date-cell">
|
||||
{% if transaction.pk %}🗒{% else %}🔮{% endif %}
|
||||
{{ transaction.booking_date|date:"d.m.y" }}
|
||||
</td>
|
||||
<td class="amount-cell">{{ transaction.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>
|
||||
no data to show :/
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
11
core/templates/registration/logged_out.html
Normal file
11
core/templates/registration/logged_out.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block navi %}
|
||||
<a href="{% url 'admin:index' %}">admin</a>
|
||||
|
|
||||
<a href="{% url 'login' %}">login</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
You have been logged out.
|
||||
{% endblock %}
|
||||
22
core/templates/registration/login.html
Normal file
22
core/templates/registration/login.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block navi %}
|
||||
<a href="{% url 'admin:index' %}">admin</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form id="login-form" method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<label for="id_username">username</label>
|
||||
<input id="id_username" name="username" type="text" placeholder="username">
|
||||
<label for="id_password">password</label>
|
||||
<input id="id_password" name="password" type="password" placeholder="password">
|
||||
{% if form.errors %}
|
||||
<div id="login-warning">
|
||||
nope.
|
||||
</div>
|
||||
{% endif %}
|
||||
<input id="login-button" type="submit" value="login"/>
|
||||
<input type="hidden" name="next" value="{{ next }}"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user