1
1

rewrite frontend and logic in core app

This commit is contained in:
2021-01-10 21:25:43 +01:00
parent 37f698d82b
commit 652cea79ae
10 changed files with 318 additions and 30 deletions

View 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">
&#x1F4CA; finance planner &#x1F4B0;
</div>
<div id="navi">
{% block navi %}{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}
</div>
</body>
</html>

View 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 %}&#x1F5D2;{% else %}&#x1F52E;{% 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 %}

View 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 %}

View 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 %}