initial commit
This commit is contained in:
43
core/templates/core/base.html
Normal file
43
core/templates/core/base.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% load bootstrap4 staticfiles %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{% bootstrap_css %}
|
||||
{% bootstrap_javascript jquery=True %}
|
||||
</head>
|
||||
<body>
|
||||
<!-- Navbar //-->
|
||||
<nav class="navbar sticky-top navbar-expand-lg navbar-dark bg-dark justify-content-between">
|
||||
<a class="navbar-brand mb-0 col-2" href="{% url "index" %}">
|
||||
<img src="{% static "activity.svg" %}" height="30" width="30"/>
|
||||
Cresus
|
||||
</a>
|
||||
<span class="navbar-text col-8 text-center">{% block page_title %}Titre{% endblock %}</span>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMenu" aria-controls="navbarMenu" aria-expanded="false" aria-label="Toggle Navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse col-2" id="navbarMenu">
|
||||
<div class="btn-group btn-group-sm mx-2" role="group" aria-label="Etiquettes">
|
||||
<a class="btn btn-dark" href="{% url "etiquette-add" %}">
|
||||
<img src="{% static "plus.svg" %}" height="18" width="18" />
|
||||
</a>
|
||||
<a href="{% url "etiquette-list" %}" class="btn btn-dark px-2">
|
||||
<img src="{% static "tag.svg" %}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm mx-2" role="group" aria-label="Enregistrements récurrents">
|
||||
<a class="btn btn-dark" href="{% url "recursif-add" %}"><img src="{% static "plus.svg" %}" height="18" width="18" /></a>
|
||||
<a class="btn btn-dark" href="{% url "recursif-list" %}"><img src="{% static "repeat.svg" %}" /></a>
|
||||
</div> </div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<!-- Content //-->
|
||||
{% block body_content %}
|
||||
Page vide.
|
||||
{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
12
core/templates/core/confirm_delete.html
Normal file
12
core/templates/core/confirm_delete.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block page_title %}
|
||||
Suppression de {{ object}}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-3">{% csrf_token %}
|
||||
<p>Êtes-vous sûr de vouloir supprimer définitivement {{ object }} ?</p>
|
||||
<input type="submit" value="Confirm" class="btn btn-block btn-dark" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
37
core/templates/core/enregistrement_add.html
Normal file
37
core/templates/core/enregistrement_add.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 staticfiles %}
|
||||
|
||||
{% block page_title %}
|
||||
Ajouter une écriture
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="POST" class="mt-3">
|
||||
{% csrf_token %}
|
||||
<div class="form-row">
|
||||
<div class="form-group col-4">
|
||||
<label class="control-label" for="id_montant">Montant</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<img src="{% static "minus-square.svg"%}" />{{ form.est_negatif}}
|
||||
</span>
|
||||
<input class="form-control" type="number" id="id_montant" name="montant" required />
|
||||
</div>
|
||||
</div>
|
||||
{% bootstrap_field form.description form_group_class="form-group col-8" %}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-4">
|
||||
<label class="control-label" for="id_date">Date</label>
|
||||
<div class="form-inline align-items-center">{{ form.date }}</div>
|
||||
</div>
|
||||
<div class="form-group col-8">
|
||||
<label class="control-label" for="id_etiquette">Étiquette</label>
|
||||
{{ form.etiquette }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row mt-3">
|
||||
<button type="submit" class="btn btn-block btn-dark"><img src="{% static "plus.svg" %}" /> Ajouter</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
14
core/templates/core/enregistrement_update_form.html
Normal file
14
core/templates/core/enregistrement_update_form.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 %}
|
||||
|
||||
{% block page_title %}
|
||||
Mise à jour de {{ object }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-2">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button type="submit" class="btn btn-block btn-dark">Enregistrer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
14
core/templates/core/enregistrementrecursif_add_form.html
Normal file
14
core/templates/core/enregistrementrecursif_add_form.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 %}
|
||||
|
||||
{% block page_title %}
|
||||
Ajouter un enregistrement récursif
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-2">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button type="submit" class="btn btn-block btn-dark">Enregistrer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
14
core/templates/core/enregistrementrecursif_update_form.html
Normal file
14
core/templates/core/enregistrementrecursif_update_form.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 %}
|
||||
|
||||
{% block page_title %}
|
||||
Mise à jour de {{ object }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-2">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button type="submit" class="btn btn-block btn-dark">Enregistrer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
14
core/templates/core/etiquette_add_form.html
Normal file
14
core/templates/core/etiquette_add_form.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 %}
|
||||
|
||||
{% block page_title %}
|
||||
Ajouter une étiquette
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-2">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button type="submit" class="btn btn-block btn-dark">Enregistrer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
23
core/templates/core/etiquette_list.html
Normal file
23
core/templates/core/etiquette_list.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block page_title%}
|
||||
Liste des étiquettes
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-inverse">
|
||||
<tr><th>Nom</th><th>Actions</th></tr>
|
||||
<thead>
|
||||
{% for etiquette in object_list %}
|
||||
<tr>
|
||||
<td>{{ etiquette }}</td>
|
||||
<td>
|
||||
<a href="{% url "etiquette-update" pk=etiquette.pk %}"><img src="{% static "edit.svg" %}" /><span class="sr-only">Éditer</span></a>
|
||||
<a href="{% url "etiquette-delete" pk=etiquette.pk %}"><img src="{% static "delete.svg" %}" /><span class="sr-only">Supprimer</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
14
core/templates/core/etiquette_update_form.html
Normal file
14
core/templates/core/etiquette_update_form.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 %}
|
||||
|
||||
{% block page_title %}
|
||||
Mise à jour de "{{ object }}"
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<form action="" method="post" class="mt-2">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button type="submit" class="btn btn-block btn-dark">Enregistrer</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
62
core/templates/core/index.html
Normal file
62
core/templates/core/index.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load bootstrap4 staticfiles %}
|
||||
{% block page_title %}
|
||||
<a href="{{ prev_month_url }}" class="btn btn-dark btn-sm"><img src="{% static "chevrons-left.svg" %}" /></a>
|
||||
Comptes de {{mois}} {{annee}}
|
||||
<a href="{% url "add"%}?year={{year}}&month={{month}}" class="btn btn-dark btn-sm m-0"><img src="{% static "plus.svg" %}" /></a>
|
||||
{% if next_month_url %}
|
||||
<a href="{{ next_month_url}}" class="btn btn-dark btn-sm"><img src="{% static "chevrons-right.svg" %}" /></a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block body_content %}
|
||||
<div class="row">
|
||||
{% bootstrap_messages %}
|
||||
<div class="col-md-9">
|
||||
{% if not object_list %}
|
||||
<p class="alert alert-warning m-3">Aucune donnée</p>
|
||||
{% else %}
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="thead-inverse">
|
||||
<tr>
|
||||
<th width="25%">Date</th>
|
||||
<th width="40%">Description</th>
|
||||
<th width="20%">Etiquette</th>
|
||||
<th width="10%">Montant</th>
|
||||
<th width="5%">Actions</th></tr>
|
||||
</thead>
|
||||
{% for d in object_list %}
|
||||
<tr>
|
||||
<td>{{ d.date }}</td>
|
||||
<td>{{ d.description }}</td>
|
||||
<td>{{ d.etiquette }}</td>
|
||||
<td class="text-{% if d.montant > 0 %}success{% else %}danger{%endif%}">
|
||||
<strong>{{ d.montant }}</strong>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url "update" pk=d.pk %}"><img src="{% static "edit.svg" %}" /></a>
|
||||
<a href="{% url "delete" pk=d.pk %}"><img src="{% static "delete.svg" %}" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-3 mt-3">
|
||||
<h2 class="page-title">Balance
|
||||
<span class="badge float-right badge-{% if data.balance > 0 %}success{% else %}danger{% endif%}">{{ data.balance }} €</span>
|
||||
</h2>
|
||||
<div class="card mt-3" >
|
||||
<div class="card-header">
|
||||
Dépenses
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for label, montant in data.par_etiquette.items %}
|
||||
<li class="list-group-item">{{ label }}
|
||||
<span class="badge badge-dark p-2 align-middle float-right">{{ montant }} €</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
28
core/templates/core/recursif_list.html
Normal file
28
core/templates/core/recursif_list.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "core/base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block page_title %}
|
||||
Enregistrement récursif
|
||||
{% endblock %}
|
||||
|
||||
{% block body_content %}
|
||||
<table class="table">
|
||||
<thead class="thead-inverse">
|
||||
<tr><th>Jour</th>
|
||||
<th>Description</th>
|
||||
<th>Étiquette</th>
|
||||
<th>Montant</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for enr_rec in object_list %}
|
||||
<tr><td>{{ enr_rec.jour }}</td>
|
||||
<td>{{ enr_rec.description }}</td>
|
||||
<td>{{ enr_rec.etiquette }}</td>
|
||||
<td>{{ enr_rec.montant }}</td>
|
||||
<td><a href="{% url "recursif-update" pk=enr_rec.pk %}"><img src="{% static "edit.svg" %}" /><span class="sr-only">Éditer</span></a>
|
||||
<a href="{% url "recursif-delete" pk=enr_rec.pk %}"><img src="{% static "delete.svg" %}" /><span class="sr-only">Supprimer</span></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user