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 name="viewport" content="width=device-width" />
|
||||
<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>
|
||||
<body class="has-navbar-fixed-top">
|
||||
<nav class="navbar is-fixed-top" aria-label="main navigation">
|
||||
|
@ -14,35 +18,55 @@
|
|||
<img src="{% static "media/logo.png" %}" alt="Logo d'hackens"/>
|
||||
</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>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-menu is-active">
|
||||
<div class="navbar-menu" id="main-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="#" >
|
||||
<a class="navbar-item" href="{% url "frontend:budget" %}" >
|
||||
Budget
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="https://www.eleves.ens.fr/pads/p/HackensCourses" >
|
||||
Liste de courses
|
||||
</a>
|
||||
{% if user.is_staff %}
|
||||
<a class="navbar-item" href="{% url "admin:index" %}" >
|
||||
Admin
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<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>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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 %}
|
||||
<script src="{% static "js/bulma-utils.js" %}" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,10 +1,60 @@
|
|||
{% extends "frontend/base.html" %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
|
||||
<section class="section content">
|
||||
<section class="section pt-2 content">
|
||||
<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 %}
|
||||
<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">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -12,22 +62,51 @@
|
|||
<th>Libellé</th>
|
||||
<th>Montant</th>
|
||||
<th>Ajouté par</th>
|
||||
{% if perms.budget.can_view_facture %}
|
||||
<th>Facture</th>
|
||||
{% endif %}
|
||||
{% if perms.budget.change_budgetline %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in budgetGroup.budgetline_set.all %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
<tr id="tableline-{{ line.id }}">
|
||||
<td>{{ line.date }}</td>
|
||||
<td>{{ line.title }}</td>
|
||||
<td>{{ line.amount }}€</td>
|
||||
<td>{{ line.author.name }}</td>
|
||||
{% if perms.budget.can_view_facture %}
|
||||
<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>
|
||||
{% endfor %}
|
||||
{% if forloop.last %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% empty %}
|
||||
<p class="has-text-centered">Ce budget est vide</p>
|
||||
{% endfor %}
|
||||
<div class="divider"></div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
{% if perms.budget.delete_budgetline %}
|
||||
<script src="{% static "js/budget_list.js" %}" defer></script>
|
||||
{% endif %}
|
||||
{% 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