mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 11:32:38 +02:00
Enhance style
This commit is contained in:
parent
2a1483ece5
commit
9bccd8be25
16 changed files with 197 additions and 137 deletions
|
@ -110,7 +110,7 @@ legend {
|
|||
}
|
||||
|
||||
h1 { font-size: 2.2rem }
|
||||
h2 { font-size: 1.8rem }
|
||||
h2 { font-size: 1rem }
|
||||
h3 { font-size: 1.4rem }
|
||||
h4 { font-size: 1.1rem }
|
||||
|
||||
|
@ -317,6 +317,7 @@ th + td,
|
|||
th + th,
|
||||
td + th {
|
||||
border-left: 1px solid #aaa;
|
||||
padding: 5px;
|
||||
}
|
||||
th {
|
||||
color: #363636;
|
||||
|
@ -335,7 +336,7 @@ th.price {
|
|||
text-align: center;
|
||||
}
|
||||
th.amount {
|
||||
width: 5rem;
|
||||
width: 10rem;
|
||||
}
|
||||
.ref {
|
||||
width: 5rem;
|
||||
|
@ -351,7 +352,7 @@ th.total {
|
|||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #ddd;
|
||||
background-color: #f0efef;
|
||||
}
|
||||
thead tr {
|
||||
background-color: var(--neutral-color);
|
||||
|
@ -362,6 +363,9 @@ thead tr * {
|
|||
thead th + th {
|
||||
border-left: 1px solid white;
|
||||
}
|
||||
th, td {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
tr .producer {
|
||||
border-bottom: 1px solid #aaa;
|
||||
|
@ -376,18 +380,28 @@ article.order {
|
|||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
table.order th.product {
|
||||
|
||||
table th.product {
|
||||
min-width: 10rem;
|
||||
width: inherit;
|
||||
max-width: 25em;
|
||||
overflow: hidden;
|
||||
max-width: 15em;
|
||||
word-wrap: break-word;
|
||||
overflow: auto;
|
||||
white-space: initial;
|
||||
}
|
||||
|
||||
table.order td.quantity {
|
||||
max-width: 10em;
|
||||
word-wrap: break-word;
|
||||
overflow: auto;
|
||||
white-space: initial;
|
||||
}
|
||||
|
||||
td.with-input {
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
td.with-input input {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -566,10 +580,12 @@ details summary {
|
|||
}
|
||||
|
||||
.rupture {
|
||||
background-color: #ff000083 !important;
|
||||
text-decoration: line-through;
|
||||
font-style: italic;
|
||||
background-color: #fbb !important;
|
||||
}
|
||||
|
||||
|
||||
.list-emails {
|
||||
display: block;
|
||||
width: 700px;
|
||||
|
@ -807,3 +823,5 @@ footer {
|
|||
background: #fafafa;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.big-button { margin: 2em;}
|
||||
|
|
54
copanier/static/js/menus.js
Normal file
54
copanier/static/js/menus.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
(function (window, document) {
|
||||
|
||||
// we fetch the elements each time because docusaurus removes the previous
|
||||
// element references on page navigation
|
||||
function getElements() {
|
||||
return {
|
||||
layout: document.getElementById('layout'),
|
||||
menu: document.getElementById('menu'),
|
||||
menuLink: document.getElementById('menuLink')
|
||||
};
|
||||
}
|
||||
|
||||
function toggleClass(element, className) {
|
||||
var classes = element.className.split(/\s+/);
|
||||
var length = classes.length;
|
||||
var i = 0;
|
||||
|
||||
for (; i < length; i++) {
|
||||
if (classes[i] === className) {
|
||||
classes.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// The className is not found
|
||||
if (length === classes.length) {
|
||||
classes.push(className);
|
||||
}
|
||||
|
||||
element.className = classes.join(' ');
|
||||
}
|
||||
|
||||
function toggleAll() {
|
||||
var active = 'active';
|
||||
var elements = getElements();
|
||||
|
||||
toggleClass(elements.layout, active);
|
||||
toggleClass(elements.menu, active);
|
||||
toggleClass(elements.menuLink, active);
|
||||
}
|
||||
|
||||
function handleEvent(e) {
|
||||
var elements = getElements();
|
||||
|
||||
if (e.target.id === elements.menuLink.id) {
|
||||
toggleAll();
|
||||
e.preventDefault();
|
||||
} else if (elements.menu.className.indexOf('active') !== -1) {
|
||||
toggleAll();
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', handleEvent);
|
||||
|
||||
}(this, this.document));
|
|
@ -25,4 +25,7 @@
|
|||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
footer {
|
||||
display: none;
|
||||
}
|
||||
}
|
|
@ -29,25 +29,24 @@ This is the parent `<div>` that contains the menu and the content area.
|
|||
padding-left: 0;
|
||||
}
|
||||
#layout.active #menu {
|
||||
left: 150px;
|
||||
width: 150px;
|
||||
left: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#layout.active .menu-link {
|
||||
left: 150px;
|
||||
left: 200px;
|
||||
}
|
||||
/*
|
||||
The content `<div>` is where all your content goes.
|
||||
*/
|
||||
.content {
|
||||
margin: 0 auto;
|
||||
padding: 0 2em;
|
||||
|
||||
margin-bottom: 50px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
.narrow {
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
|
@ -65,7 +64,7 @@ The content `<div>` is where all your content goes.
|
|||
}
|
||||
.header h2 {
|
||||
font-weight: 300;
|
||||
color: #ccc;
|
||||
color: #777;
|
||||
padding: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
@ -93,7 +92,6 @@ appears on the left side of the page.
|
|||
z-index: 1000; /* so the menu or its navicon stays above all content */
|
||||
background: #191818;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
/*
|
||||
All anchors inside the menu should be styled like this.
|
||||
|
@ -190,6 +188,7 @@ small screens.
|
|||
.menu-link span:before,
|
||||
.menu-link span:after {
|
||||
background-color: #fff;
|
||||
pointer-events: none;
|
||||
width: 100%;
|
||||
height: 0.2em;
|
||||
}
|
||||
|
@ -250,13 +249,3 @@ Hides the menu at `48em`, but modify this based on your app's needs.
|
|||
left: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.pure-menu-item a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#sitename {
|
||||
color: #ccc;
|
||||
display: block;
|
||||
padding-left: 1em;
|
||||
}
|
|
@ -34,23 +34,24 @@
|
|||
{% if request.user %}
|
||||
<div id="menu">
|
||||
<div class="pure-menu">
|
||||
<h1 id="sitename">{{ config.SITE_NAME }}</h1>
|
||||
<h1 id="sitename"><a href="{{ url_for('home') }}">{{ config.SITE_NAME }}</a></h1>
|
||||
{% block additional_menu %}{% endblock %}
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a href="{{ url_for('home') }}"><i class="icon-happy"></i> Voir les distrib</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('archives') }}"><i class="icon-happy"></i> Voir les archives</a>
|
||||
</li>
|
||||
{% if request.user and request.user.is_staff %}
|
||||
<li class="pure-menu-item">
|
||||
<a href="{{ url_for('new_delivery') }}"><i class="icon-hotairballoon"></i> Nouvelle distribution</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('new_delivery') }}"><i class="icon-hotairballoon"></i> Nouvelle distribution</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if request.user and (request.user.is_staff or not config.HIDE_GROUPS_LINK) %}
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ url_for('groups') }}"><i class="icon-globe"></i> Gérer les groupes</a>
|
||||
<a class="pure-menu-link" class="pure-menu-link" href="{{ url_for('groups') }}"><i class="icon-globe"></i> Gérer les groupes</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="pure-menu-item">
|
||||
<a href="{{ url_for('logout') }}"><i class="icon-lock"></i> Se déconnecter</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('logout') }}"><i class="icon-lock"></i> Se déconnecter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -73,6 +74,7 @@
|
|||
|
||||
<script src="{{ url_for('/static/js/flash.min.js') }}"></script>
|
||||
<script src="{{ url_for('/static/js/app.js') }}"></script>
|
||||
<script src="{{ url_for('/static/js/menus.js') }}"></script>
|
||||
{% if message %}
|
||||
<script>
|
||||
new window.FlashMessage("{{ message[0] }}", "{{ message[1] }}", {
|
||||
|
|
|
@ -3,16 +3,6 @@
|
|||
|
||||
<div class="header">
|
||||
<h1>Distributions</h1>
|
||||
</div>
|
||||
{% with deliveries=incoming %}
|
||||
{% include "includes/delivery_list.html" %}
|
||||
{% endwith %}
|
||||
{% if former %}
|
||||
<div class="header">
|
||||
<h1>Distributions passées</h1>
|
||||
</div>
|
||||
{% with deliveries=former %}
|
||||
{% include "includes/delivery_small_list.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock body %}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<tr>
|
||||
<th class="product">Produit</th>
|
||||
<th class="price">Prix</th>
|
||||
{% if delivery.has_packing %}
|
||||
{% if producer.has_packing %}
|
||||
<th class="packing">Conditionnement</th>
|
||||
{% endif %}
|
||||
<th class="amount">Commande</th>
|
||||
|
@ -41,7 +41,7 @@
|
|||
{% endif %}
|
||||
</th>
|
||||
<td>{{ product.price | round(2) }} €</td>
|
||||
{% if delivery.has_packing %}
|
||||
{% if producer.has_packing %}
|
||||
<td {% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>{{ product.packing or "—" }}{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} (manque {{ delivery.product_missing(product) }}){% endif %}</td>
|
||||
{% endif %}
|
||||
<td class="with-input"><input {% if not request.user.is_referent(delivery) and delivery.status != delivery.OPEN or product.rupture %}type="text" readonly{% else%}type="number"{% endif%} min=0 name="wanted:{{ product.ref }}" value="{{ order[product].wanted }}">{% if not (delivery.status == delivery.ADJUSTMENT or force_adjustments) %} x {{ product.unit }}{% endif %}</td>
|
||||
|
|
|
@ -1,35 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
{% block is_wide %}{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
{% if delivery.status == delivery.CLOSED %}
|
||||
<div class="important-message">Une fois la distribution terminée, reviens ici pour <a class="button" href="{{ url_for('hand_over_delivery', id=delivery.id) }}">passer le relai !</a></div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1>{{ delivery.name }}</h1>
|
||||
{% include "includes/delivery_progress.html" %}
|
||||
|
||||
<h4>{% if delivery.products %}
|
||||
{% include "includes/delivery_status.html" %}
|
||||
{% endif %}
|
||||
{% include "includes/order_button.html" %}
|
||||
</h4>
|
||||
<h4>
|
||||
Distribution le <i class="icon-clock"></i> {{ delivery.from_date|date }}, {{ delivery.from_date|time }} - {{ delivery.to_date|time }}, à <i class="icon-streetsign"></i> {{ delivery.where }}.
|
||||
</h4>
|
||||
|
||||
<div class="pure-menu pure-menu-horizontal">
|
||||
{% block additional_menu %}
|
||||
<div class="pure-menu">
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
|
||||
<a href="#" class="pure-menu-link"><i class="icon-printer"></i> Imprimer…</a>
|
||||
<ul class="pure-menu-children">
|
||||
<li class="pure-menu-item"><a href="{{ url_for('list_products', id=delivery.id) }}/produits.pdf" class="pure-menu-link"><i class="icon-ribbon"></i> Commande producteurs⋅rices</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('show_orders_summary', id=delivery.id) }}" class="pure-menu-link"><i class="icon-grid"></i> Résumé de commande par groupe</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('compute_payments', id=delivery.id) }}" class="pure-menu-link"><i class="icon-wallet"></i> Répartition des paiements</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('list_products', id=delivery.id) }}/produits.pdf" class="pure-menu-link"><i class="icon-ribbon"></i> Bons de commande</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('show_orders_summary', id=delivery.id) }}" class="pure-menu-link"><i class="icon-grid"></i> Commandes groupes</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('compute_payments', id=delivery.id) }}" class="pure-menu-link"><i class="icon-wallet"></i> Paiements</a></li>
|
||||
{% if request['user'].email == delivery.contact and delivery.status > delivery.EMPTY %}
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ url_for('show_delivery_toolbox', id=delivery.id) }}"><i class="icon-tools"></i> Boîte à outils</a>
|
||||
|
@ -40,19 +16,39 @@
|
|||
<a class="pure-menu-link" href="{{ url_for('edit_delivery', id=delivery.id) }}"><i class="icon-adjustments"></i> Modifier la distrib</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="{{ url_for('list_products', id=delivery.id) }}"><i class="icon-pricetags"></i> Produits</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('list_products', id=delivery.id) }}"><i class="icon-pricetags"></i> Éditer produits</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
{% if delivery.status == delivery.CLOSED %}
|
||||
<div class="important-message">Une fois la distribution terminée, reviens ici pour <a class="button" href="{{ url_for('hand_over_delivery', id=delivery.id) }}">passer le relai !</a></div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1>{{ delivery.name }}</h1>
|
||||
<h2>
|
||||
Distribution le <i class="icon-clock"></i> {{ delivery.from_date|date }}, {{ delivery.from_date|time }} - {{ delivery.to_date|time }}, à <i class="icon-streetsign"></i> {{ delivery.where }}.
|
||||
</h2>
|
||||
|
||||
<h3>{% if delivery.products %}
|
||||
{% include "includes/delivery_status.html" %}
|
||||
{% endif %}
|
||||
{% include "includes/order_button.html" %}
|
||||
</h3>
|
||||
{% include "includes/delivery_progress.html" %}
|
||||
|
||||
</div>
|
||||
|
||||
<article class="delivery">
|
||||
{% if request['user'].email == delivery.contact %}
|
||||
<div class="placeholder center">
|
||||
Tu es la personne contact pour l'organisation de cette distribution, merci :-) Pour t'aider, tu peux accéder à
|
||||
<a href="{{ url_for('show_delivery_toolbox', id=delivery.id) }}"><i class="icon-tools"></i> la boîte à outils</a> !
|
||||
Hey, jettes un coup d'oeil à
|
||||
<a href="{{ url_for('show_delivery_toolbox', id=delivery.id) }}"> la boîte à outils</a> !
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if delivery.has_products %}
|
||||
|
@ -79,7 +75,6 @@ Tu es la personne contact pour l'organisation de cette distribution, merci :-) P
|
|||
<li><a href="{{ url_for('create_producer', delivery_id=delivery.id) }}">Ajouter les product⋅eurs⋅rices</a> à la main ;</li>
|
||||
<li>Ou bien <a href="{{ url_for('copy_products', id=delivery.id) }}">copier les produits d'une autre distribution</a>.</li>
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
{% block body %}
|
||||
|
||||
<div class="header">
|
||||
<h1>Gestion de la distribution « {{ delivery.name }} »</h1>
|
||||
<h1>{{ delivery.name }}</h1>
|
||||
</div>
|
||||
|
||||
{% set display_counts = True %}
|
||||
{% include "includes/delivery_head.html" %}
|
||||
<i class="icon-lightbulb"></i> <strong>{{ delivery.orders|length }}</strong> groupes, <strong>{{ delivery.products|length }}</strong> produits et <strong>{{ delivery.producers | length}}</strong> fournisseurs. <br /> Total de la commande : <strong>{{ delivery.total }}€</strong></li>
|
||||
|
||||
<h2>Rappel des dates</h2>
|
||||
{% include "includes/delivery_dates_table.html" %}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<table class="pure-table fixed-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Quoi ?</th><th>Dates</th><th>Coordinatrice⋅eur</th><th>Référent⋅e⋅s produits</th>
|
||||
<th></th><th>Dates</th><th>Coord</th><th>Référent⋅e⋅s</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Création de la distribution</th>
|
||||
<td>{{ delivery.dates.creation_date | date}}</td>
|
||||
<td>Rappeler aux référent⋅e⋅s produit de mettre leurs prix à jour, vérifier que tous les producteurs⋅rices sont bien présentes, en ajouter si besoin</td>
|
||||
<td>Rappeler aux référent⋅e⋅s produit de mettre leurs prix à jour, vérifier que tous les produits sont bien présentes, en ajouter si besoin</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -18,27 +18,27 @@
|
|||
<td>Les référent⋅e⋅s produit mettent les prix à jour.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Commandes</td>
|
||||
<th>Commandes</th>
|
||||
<td>Du {{ delivery.dates.price_update_deadline | date }} au {{ delivery.dates.order_before | date }}</td>
|
||||
<td>Envoyer le lien de commande aux groupes pour qu'iels commandent</td>
|
||||
<td>Envoyer le lien de commande aux groupes</td>
|
||||
<td>—</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Ajustements</th>
|
||||
<td>Du {{ delivery.dates.order_before | date }} au {{ delivery.dates.adjustment_deadline | date }}</td>
|
||||
<td>S'assurer que les ajustements sont bien faits par les participant⋅e⋅s</td>
|
||||
<td>S'assurer que les produits qui doivent être tomber rond tombent bien rond ! Ajuster si besoin.</td>
|
||||
<td>Faire les ajustements à la main si besoin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Approvisionnements</th>
|
||||
<th>Récup des produits</th>
|
||||
<td>Du {{ delivery.dates.adjustment_deadline | date }} au {{ delivery.dates.delivery_date | date }}</td>
|
||||
<td><a href="{{ url_for('send_referent_emails', id=delivery.id) }}">Envoyer les infos de commande aux référent⋅e⋅s</a></td>
|
||||
<td>Faire les commandes aux producteurs⋅rices, <strong>récupérer les produits</strong></td>
|
||||
<td>Transmettre les commandes, <strong>récupérer les produits</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Préparation de la distribution</th>
|
||||
<td>La veille du {{ delivery.dates.delivery_date | date }}</td>
|
||||
<td><a href="{{ url_for('show_orders_summary', id=delivery.id) }}">Imprimer les bons de commandes par colocation</a></td>
|
||||
<td><a href="{{ url_for('show_orders_summary', id=delivery.id) }}">Imprimer les bons de commandes par groupe</a></td>
|
||||
<td>—</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
<ul class="delivery-head">
|
||||
{% if delivery.description %}<li><i class="icon-basket"></i> <strong>Produits</strong> {{ delivery.description }}</li>{% endif %}
|
||||
<li><i class="icon-clock"></i> <strong>Distribution le</strong> <time datetime="{{ delivery.from_date }}">{{ delivery.from_date|date }} ({{ delivery.from_date|time }} à {{ delivery.to_date|time }}</time></li>
|
||||
<li><i class="icon-clock"></i> <strong>Distribution le</strong> <time datetime="{{ delivery.from_date }}">{{ delivery.from_date|date }} ({{ delivery.from_date|time }} à {{ delivery.to_date|time }})</time></li>
|
||||
<li><i class="icon-hourglass"></i> <strong>Commandes avant le</strong> <time datetime="{{ delivery.order_before }}">{{ delivery.order_before|date }}</time></li>
|
||||
<li class="hide-on-print"><i class="icon-calendar"></i>
|
||||
{% include "includes/delivery_status.html" %}
|
||||
</li>
|
||||
{% if display_counts %}
|
||||
<li><i class="icon-lightbulb"></i> <strong>{{ delivery.orders|length }}</strong> colocs</strong>, <strong>{{ delivery.products|length }}</strong> produits et <strong>{{ delivery.producers | length}}</strong> product⋅eurs⋅rices, <strong>{{ delivery.total }}€</strong></li>
|
||||
{% else %}
|
||||
<li class="hide-on-print"><i class="icon-strategy"></i> <strong>Référent⋅e</strong> <a href="mailto:{{ delivery.contact }}">{{ delivery.contact }}</a></li>
|
||||
{% endif %}
|
||||
<li class="hide-on-print"><i class="icon-strategy"></i> <strong>Référent⋅e</strong> : <a href="tel:{{ delivery.contact_phone }}">{{ delivery.contact_phone }}</a></li>
|
||||
{% if delivery.instructions %}<li><i class="icon-lightbulb"></i> <strong>À savoir</strong> {{ delivery.instructions }}</li>{% endif %}
|
||||
{% if delivery.infos_url %}<li><i class="icon-global"></i><strong>Plus d'infos</strong> <a href="{{ delivery.infos_url }}" title="{{ delivery.infos_url }}">{{ delivery.infos_url|truncate(20)}}</a></li>{% endif %}
|
||||
</ul>
|
|
@ -1,10 +1,10 @@
|
|||
<ul class="progressbar">
|
||||
<li>Mise à jour des référent·es</li>
|
||||
<li {% if delivery.status == delivery.NEED_PRICE_UPDATE %}class="active"{% endif %}>Mise à jour des prix</li>
|
||||
<li>Création</li>
|
||||
<li {% if delivery.status == delivery.NEED_PRICE_UPDATE %}class="active"{% endif %}>Mise à jour</li>
|
||||
<li {% if delivery.status == delivery.OPEN %}class="active"{% endif %}>Commande</li>
|
||||
<li {% if delivery.status == delivery.ADJUSTMENT %}class="active"{% endif %}>Ajustements</li>
|
||||
<li {% if delivery.status == delivery.WAITING_PRODUCTS %}class="active"{% endif %}>Récupération des commandes</li>
|
||||
<li><a href="{{ url_for('show_orders_summary', id=delivery.id) }}">Distribution</a></li>
|
||||
<li {% if delivery.status == delivery.CLOSED %}class="active"{% endif %}><a href="{{ url_for('compute_payments', id=delivery.id) }}">Répartition des paiements</a></li>
|
||||
<li {% if delivery.status == delivery.WAITING_PRODUCTS %}class="active"{% endif %}>Appro</li>
|
||||
<li><a href="{{ url_for('show_orders_summary', id=delivery.id) }}">Distrib</a></li>
|
||||
<li {% if delivery.status == delivery.CLOSED %}class="active"{% endif %}><a href="{{ url_for('compute_payments', id=delivery.id) }}">Paiements</a></li>
|
||||
</ul>
|
||||
<div style="clear: both"></div>
|
|
@ -6,21 +6,18 @@
|
|||
{% for producer in producers %}
|
||||
{% set producer_obj = delivery.producers[producer] %}
|
||||
{% if edit_mode or producer_obj.has_active_products(delivery) %}
|
||||
<h2>{{ producer_obj.name }}
|
||||
<h3>{{ producer_obj.name }}
|
||||
{% if producer_obj.needs_price_update(delivery) %}*{% endif %}
|
||||
{% if edit_mode or request.user.is_staff or producer_obj.referent == request.user.email %}
|
||||
<span class="edit">
|
||||
<a class="button" href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer_obj.id) }}"><i class="icon-ribbon"></i> Gérer ce⋅tte producteur⋅rice</a>
|
||||
<a class="button" href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer_obj.id) }}"><i class="icon-ribbon"></i> Gérer les produits</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<h5>{% if producer_obj.description %}{{ producer_obj.description }}. {% endif %}Référent⋅e : <a href="mailto:{{ producer_obj.referent }}">{{ producer_obj.referent_name }}</a> / {{ producer_obj.referent_tel }}.
|
||||
{% if not edit_mode and producer_obj.has_rupture_products(delivery) %}
|
||||
<p><em>Certains produits sont en rupture de stock.</em></p>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<h5>{% if producer_obj.description %}{{ producer_obj.description }}. {% endif %}Référent⋅e : <a href="mailto:{{ producer_obj.referent }}">{{ producer_obj.referent_name }}</a> / <a href="tel:{{ producer_obj.referent_tel }}">{{ producer_obj.referent_tel }}</a>
|
||||
</h5>
|
||||
{% if not delivery.get_products_by(producer) %}
|
||||
😔 Ce⋅tte producteur⋅rice n'a pas encore de produits. Voulez vous <a href="{{ url_for('create_product', delivery_id=delivery.id, producer_id=producer_obj.id) }}">en rajouter un ?</a>
|
||||
😔 Aucun produit. Voulez vous <a href="{{ url_for('create_product', delivery_id=delivery.id, producer_id=producer_obj.id) }}">en rajouter un ?</a>
|
||||
{% else %}
|
||||
<table class="delivery pure-table">
|
||||
<thead>
|
||||
|
@ -47,9 +44,9 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for product in delivery.get_products_by(producer) %}
|
||||
{% if edit_mode or not product.rupture %}
|
||||
<tr>
|
||||
<th class="product {% if product.rupture %}rupture{% endif %}">{% if edit_mode %}<a href="{{ url_for('edit_product', delivery_id=delivery.id, producer_id=producer_obj.id, product_ref=product.ref) }}">{% endif %}{% if edit_mode %}<i class="icon-pencil"></i> {% endif %}{% if product.rupture %} (rupture){% endif %} {{ product }}{% if edit_mode %}</a>{% endif %}
|
||||
|
||||
<tr {% if product.rupture %}class="rupture"{% endif %}>
|
||||
<th class="product">{% if edit_mode %}<a href="{{ url_for('edit_product', delivery_id=delivery.id, producer_id=producer_obj.id, product_ref=product.ref) }}">{% endif %}{% if edit_mode %}<i class="icon-pencil"></i> {% endif %}{% if product.rupture %}{% endif %} {{ product }}{% if edit_mode %}</a>{% endif %}
|
||||
<td>{{ product.price | round(2) }} €</td>
|
||||
{% if delivery.has_packing %}
|
||||
<td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td>
|
||||
|
@ -66,7 +63,7 @@
|
|||
{% endfor %}
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% if delivery.shipping.get(producer) %}
|
||||
<tr>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% if (delivery.status == delivery.OPEN or delivery.status == delivery.ADJUSTMENT) and delivery.has_products %}
|
||||
<a class="button" href="{{ url_for('place_order', id=delivery.id) }}">
|
||||
<a class="button big-button" href="{{ url_for('place_order', id=delivery.id) }}">
|
||||
{% if delivery.status == delivery.ADJUSTMENT %}
|
||||
Ajuster ma commande
|
||||
{% elif delivery.status == delivery.OPEN %}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{% if display_prices %}
|
||||
<td>{{ product.price | round(2) }} €</td>
|
||||
{% endif %}
|
||||
<td>{{ order[product].quantity }} x {{ product.unit }}</td>
|
||||
<td class="quantity">{{ order[product].quantity }} x {{ product.unit }}</td>
|
||||
{% if display_prices %}
|
||||
<td>{{ order.total([product], delivery, group_id, False) }}</td>
|
||||
{% endif %}
|
||||
|
@ -15,4 +15,6 @@
|
|||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p>Total: {{ order.total(delivery.products, delivery, group_id) if order else 0 }} € (dont {{ order.compute_shipping(delivery, delivery.producers, group_id) | round(2) }} de port)</p>
|
||||
|
||||
{% set shipping = order.compute_shipping(delivery, delivery.producers, group_id) | round(2) %}
|
||||
<p>Total: {{ order.total(delivery.products, delivery, group_id) if order else 0 }} € {% if shipping > 0 %}(dont {{ shipping }}€ de port){% endif %}</p>
|
||||
|
|
|
@ -22,10 +22,28 @@ async def home(request, response):
|
|||
if not request["user"].group_id:
|
||||
response.redirect = app.url_for("groups")
|
||||
return
|
||||
|
||||
deliveries=Delivery.incoming()
|
||||
if len(deliveries) == 1:
|
||||
response.redirect = app.url_for("show_delivery", id=deliveries[0].id)
|
||||
else:
|
||||
response.html(
|
||||
"delivery/list_deliveries.html",
|
||||
incoming=Delivery.incoming(),
|
||||
former=Delivery.former(),
|
||||
deliveries=Delivery.incoming(),
|
||||
)
|
||||
|
||||
|
||||
@app.route("/archives", methods=["GET"])
|
||||
async def archives(request, response):
|
||||
if not Delivery.is_defined() and not Groups.is_defined():
|
||||
response.redirect = app.url_for("onboarding")
|
||||
return
|
||||
if not request["user"].group_id:
|
||||
response.redirect = app.url_for("groups")
|
||||
return
|
||||
response.html(
|
||||
"delivery/list_deliveries.html",
|
||||
deliveries=Delivery.former(),
|
||||
)
|
||||
|
||||
|
||||
|
@ -297,7 +315,7 @@ async def show_orders_summary(request, response, id):
|
|||
delivery = Delivery.load(id)
|
||||
response.pdf(
|
||||
"delivery/show_orders_summary.html",
|
||||
{"delivery": delivery},
|
||||
{"delivery": delivery, "display_prices": True},
|
||||
css="order-summary.css",
|
||||
filename=utils.prefix("résumé-de-commandes.pdf", delivery),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue