templates
This commit is contained in:
parent
9c0da4c17e
commit
4e77270a93
6 changed files with 149 additions and 10 deletions
|
@ -5,7 +5,11 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<link rel="stylesheet" href="{% static "css/bundle.css" %}" type="text/css" media="screen" charset="utf-8">
|
<link rel="stylesheet" href="{% static "css/bundle.css" %}" type="text/css" media="screen" charset="utf-8">
|
||||||
<title>Ernesto-nouveau</title>
|
<link rel="stylesheet" href="{% static "vendor/fontawesome/css/fontawesome.min.css" %}" type="text/css" media="screen" charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="{% static "vendor/fontawesome/css/solid.min.css" %}" type="text/css" media="screen" charset="utf-8">
|
||||||
|
|
||||||
|
<title>Hackens-orga</title>
|
||||||
|
<link rel="shortcut icon" type="image/png" href="{% static 'media/logo.png' %}">
|
||||||
</head>
|
</head>
|
||||||
<body class="has-navbar-fixed-top">
|
<body class="has-navbar-fixed-top">
|
||||||
<nav class="navbar is-fixed-top" aria-label="main navigation">
|
<nav class="navbar is-fixed-top" aria-label="main navigation">
|
||||||
|
@ -14,35 +18,55 @@
|
||||||
<img src="{% static "media/logo.png" %}" alt="Logo d'hackens"/>
|
<img src="{% static "media/logo.png" %}" alt="Logo d'hackens"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
<a role="button" class="navbar-burger" data-target="main-menu" aria-label="menu" aria-expanded="false">
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="navbar-menu is-active">
|
<div class="navbar-menu" id="main-menu">
|
||||||
<div class="navbar-start">
|
<div class="navbar-start">
|
||||||
<a class="navbar-item" href="#" >
|
<a class="navbar-item" href="{% url "frontend:budget" %}" >
|
||||||
Budget
|
Budget
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="navbar-item" href="https://www.eleves.ens.fr/pads/p/HackensCourses" >
|
<a class="navbar-item" href="https://www.eleves.ens.fr/pads/p/HackensCourses" >
|
||||||
Liste de courses
|
Liste de courses
|
||||||
</a>
|
</a>
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<a class="navbar-item" href="{% url "admin:index" %}" >
|
||||||
|
Admin
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
<div class="navbar-item">
|
<div class="navbar-item">
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a class="button is-primary" href="{% url "frontend:budget" %}">
|
{% if user.is_authenticated %}
|
||||||
|
<a class="button is-secondary" href="{% url "authens:logout" %}">
|
||||||
|
<strong>Déconnexion</strong>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="button is-primary" href="{% url "authens:login" %}">
|
||||||
<strong>Connexion</strong>
|
<strong>Connexion</strong>
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<section class="section pt-1 pb-1">
|
||||||
|
{% for m in messages %}
|
||||||
|
<div class="notification {{ m.level_tag }}" id="message-{{ forloop.counter0 }}">
|
||||||
|
<button class="delete" data-target="message-{{ forloop.counter0 }}"></button>
|
||||||
|
{{ m }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</section>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
<script src="{% static "js/bulma-utils.js" %}" defer></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,10 +1,60 @@
|
||||||
{% extends "frontend/base.html" %}
|
{% extends "frontend/base.html" %}
|
||||||
|
{% load static %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<section class="section content">
|
<section class="section pt-2 content">
|
||||||
<h1 class="title is-3">Budget d'hackens</h1>
|
<h1 class="title is-3">Budget d'hackens</h1>
|
||||||
|
<div class="buttons">
|
||||||
|
<a
|
||||||
|
class="button is-dark"
|
||||||
|
href="{% url "frontend:budget-group-create" %}"
|
||||||
|
>
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</span>
|
||||||
|
<span>Nouveau budget</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
{% for budgetGroup in object_list %}
|
{% for budgetGroup in object_list %}
|
||||||
<h2 class="title is-4">Budget {{ budgetGroup.name }}: {{ budgetGroup.get_total }}€</h2>
|
<div class="level is-mobile">
|
||||||
|
<div class="level-left">
|
||||||
|
<h2 class="m-0 title is-4 level-item">
|
||||||
|
Budget {{ budgetGroup.name }}: {{ budgetGroup.get_total }}€
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item buttons">
|
||||||
|
{% if perms.budget.add_budgetline %}
|
||||||
|
<a class="button" href="{% url "frontend:budget-line-create" %}" title="Nouvelle ligne de budget">
|
||||||
|
<span class="is-hidden-mobile icon-text">
|
||||||
|
<span class="icon"><i class="fa-solid fa-circle-plus"></i></span>
|
||||||
|
<span>Nouvelle ligne</span>
|
||||||
|
</span>
|
||||||
|
<span class="is-hidden-tablet icon-text">
|
||||||
|
<span class="icon"><i class="fa-solid fa-circle-plus"></i></span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.budget.change_budgetgroup %}
|
||||||
|
<a
|
||||||
|
class="button"
|
||||||
|
href="{% url "frontend:budget-group-update" budgetGroup.id %}"
|
||||||
|
title="Éditer l'intitulé du budget"
|
||||||
|
>
|
||||||
|
<span class="icon"><i class="fa-regular fa-pen-to-square"></i></span>
|
||||||
|
</a>
|
||||||
|
<button class="button" disabled><span class="icon"><i class="fa-solid fa-box-archive"></i></span></button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% if budgetGroup.description.strip %}
|
||||||
|
<p>
|
||||||
|
<strong>Description:</strong> {{ budgetGroup.description.strip }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
{% for line in budgetGroup.budgetline_set.all|dictsort:"date" %}
|
||||||
|
{% if forloop.first %}
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -12,22 +62,51 @@
|
||||||
<th>Libellé</th>
|
<th>Libellé</th>
|
||||||
<th>Montant</th>
|
<th>Montant</th>
|
||||||
<th>Ajouté par</th>
|
<th>Ajouté par</th>
|
||||||
|
{% if perms.budget.can_view_facture %}
|
||||||
<th>Facture</th>
|
<th>Facture</th>
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.budget.change_budgetline %}
|
||||||
|
<th></th>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for line in budgetGroup.budgetline_set.all %}
|
{% endif %}
|
||||||
<tr>
|
<tr id="tableline-{{ line.id }}">
|
||||||
<td>{{ line.date }}</td>
|
<td>{{ line.date }}</td>
|
||||||
<td>{{ line.title }}</td>
|
<td>{{ line.title }}</td>
|
||||||
<td>{{ line.amount }}€</td>
|
<td>{{ line.amount }}€</td>
|
||||||
<td>{{ line.author.name }}</td>
|
<td>{{ line.author.name }}</td>
|
||||||
|
{% if perms.budget.can_view_facture %}
|
||||||
<td>{{ line.facture }}</td>
|
<td>{{ line.facture }}</td>
|
||||||
|
{% endif %}
|
||||||
|
{% if perms.budget.change_budgetline %}
|
||||||
|
<td>
|
||||||
|
<div class="buttons">
|
||||||
|
<a class="button" href="{% url "frontend:budget-line-update" line.id %}">
|
||||||
|
<span class="icon"><i class="fa-solid fa-pen-to-square"></i></span>
|
||||||
|
</a>
|
||||||
|
{% if perms.budget.delete_budgetline %}
|
||||||
|
<button data-lineid="{{ line.id }}" class="delete-budgetline button">
|
||||||
|
<span class="icon"><i class="fa-solid fa-trash"></i></span>
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% if forloop.last %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
{% endif %}
|
||||||
|
{% empty %}
|
||||||
|
<p class="has-text-centered">Ce budget est vide</p>
|
||||||
|
{% endfor %}
|
||||||
|
<div class="divider"></div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
{% if perms.budget.delete_budgetline %}
|
||||||
|
<script src="{% static "js/budget_list.js" %}" defer></script>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<section class="section content">
|
||||||
|
<h1 class="title is-3">Créer un budget</h1>
|
||||||
|
{% include "forms/common-form.html" with c_size="is-12" errors=True %}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<section class="section content">
|
||||||
|
<h1 class="title is-3">Éditer un budget</h1>
|
||||||
|
{% include "forms/common-form.html" with c_size="is-12" errors=True %}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<section class="section content">
|
||||||
|
<h1 class="title is-3">Créer une ligne de budget</h1>
|
||||||
|
{% include "forms/common-form.html" with c_size="is-12" errors=True %}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<section class="section content">
|
||||||
|
<h1 class="title is-3">Éditer le ligne {{ object.title }}</h1>
|
||||||
|
{% include "forms/common-form.html" with c_size="is-12" errors=True %}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in a new issue