8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 11:53:12 +00:00

Translation: Mark all strings in templates of cotisation

This commit is contained in:
Maël Kervella 2018-04-08 17:41:45 +00:00
parent ccab7ff718
commit 433ee298dc
17 changed files with 275 additions and 197 deletions

View file

@ -23,15 +23,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>Article</th>
<th>Prix</th>
<th>Type Cotisation</th>
<th>Durée (mois)</th>
<th>Article pour</th>
<th>{% trans "Article" %}</th>
<th>{% trans "Price" %}</th>
<th>{% trans "Cotisation type" %}</th>
<th>{% trans "Duration (month)" %}</th>
<th>{% trans "Concerned users" %}</th>
<th></th>
</tr>
</thead>
@ -44,11 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ article.type_user }}</td>
<td class="text-right">
{% can_edit article %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-article' article.id %}">
<a class="btn btn-primary btn-sm" role="button" title="{% trans "Edit" %}" href="{% url 'cotisations:edit-article' article.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'article' article.id %}">
<a class="btn btn-info btn-sm" role="button" title="{% trans "Historique" %}" href="{% url 'cotisations:history' 'article' article.id %}">
<i class="fa fa-history"></i>
</a>
</td>

View file

@ -23,11 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>Banque</th>
<th>{% trans "Bank" %}</th>
<th></th>
</tr>
</thead>
@ -36,11 +37,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ banque.name }}</td>
<td class="text-right">
{% can_edit banque %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-banque' banque.id %}">
<a class="btn btn-primary btn-sm" role="button" title="{% trans "Edit" %}" href="{% url 'cotisations:edit-banque' banque.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'banque' banque.id %}">
<a class="btn btn-info btn-sm" role="button" title="{% trans "Historique" %}" href="{% url 'cotisations:history' 'banque' banque.id %}">
<i class="fa fa-history"></i>
</a>
</td>

View file

@ -23,20 +23,34 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
<div class="table-responsive">
{% if facture_list.paginator %}
{% include "pagination.html" with list=facture_list %}
{% include 'pagination.html' with list=facture_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='cotis' col='user' text='Utilisateur' %}</th>
<th>Designation</th>
<th>Prix total</th>
<th>{% include "buttons/sort.html" with prefix='cotis' col='paiement' text='Moyen de paiement' %}</th>
<th>{% include "buttons/sort.html" with prefix='cotis' col='date' text='Date' %}</th>
<th>{% include "buttons/sort.html" with prefix='cotis' col='id' text='Id facture' %}</th>
<th>
{% trans "User" as tr_user %}
{% include 'buttons/sort.html' with prefix='cotis' col='user' text=tr_user %}
</th>
<th>{% trans "Designation" %}</th>
<th>{% trans "Total price" %}</th>
<th>
{% trans "Payment method" as tr_payment_method %}
{% include 'buttons/sort.html' with prefix='cotis' col='paiement' text=tr_payment_method %}
</th>
<th>
{% trans "Date" as tr_date %}
{% include 'buttons/sort.html' with prefix='cotis' col='date' text=tr_date %}
</th>
<th>
{% trans "Invoice id" as tr_invoice_id %}
{% include 'buttons/sort.html' with prefix='cotis' col='id' text=tr_invoice_id %}
</th>
<th></th>
<th></th>
</tr>
@ -50,39 +64,49 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ facture.date }}</td>
<td>{{ facture.id }}</td>
<td>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="editionfacture" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Edition
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="editionfacture">
{% can_edit facture %}
<li><a href="{% url 'cotisations:edit-facture' facture.id %}"><i class="fa fa-dollar-sign"></i> Modifier</a></li>
{% acl_else %}
<li>Facture controlée</li>
{% acl_end %}
{% can_delete facture %}
<li><a href="{% url 'cotisations:del-facture' facture.id %}"><i class="fa fa-trash"></i> Supprimer</a></li>
{% acl_end %}
<li><a href="{% url 'cotisations:history' 'facture' facture.id %}"><i class="fa fa-history"></i> Historique</a></li>
</ul>
</div>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="editinvoice" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{% trans "Edit" %}<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="editinvoice">
{% can_edit facture %}
<li>
<a href="{% url 'cotisations:edit-facture' facture.id %}">
<i class="fa fa-dollar-sign"></i> {% trans "Edit" %}
</a>
</li>
{% acl_else %}
<li>{% trans "Controlled invoice" %}</li>
{% acl_end %}
{% can_delete facture %}
<li>
<a href="{% url 'cotisations:del-facture' facture.id %}">
<i class="fa fa-trash"></i> {% trans "Delete" %}
</a>
</li>
{% acl_end %}
<li>
<a href="{% url 'cotisations:history' 'facture' facture.id %}">
<i class="fa fa-history"></i> {% trans "Historique" %}
</a>
</li>
</ul>
</div>
</td>
<td>
{% if facture.valid %}
{% if facture.valid %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:facture-pdf' facture.id %}">
<i class="fa fa-file-pdf"></i>
PDF
<i class="fa fa-file-pdf"></i> {% trans "PDF" %}
</a>
{% else %}
<i class="text-danger">Facture invalide</i>
{% endif %}
{% else %}
<i class="text-danger">{% trans "Invalidated invoice" %}</i>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% if facture_list.paginator %}
{% include "pagination.html" with list=facture_list %}
{% include 'pagination.html' with list=facture_list %}
{% endif %}
</div>

View file

@ -23,11 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>Moyen de paiement</th>
<th>{% trans "Payment method" %}</th>
<th></th>
</tr>
</thead>
@ -35,12 +36,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ paiement.moyen }}</td>
<td class="text-right">
{% can_edit paiement %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-paiement' paiement.id %}">
{% can_edit paiement %}
<a class="btn btn-primary btn-sm" role="button" title="{% trans "Edit" %}" href="{% url 'cotisations:edit-paiement' paiement.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'paiement' paiement.id %}">
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="{% trans "Historique" %}" href="{% url 'cotisations:history' 'paiement' paiement.id %}">
<i class="fa fa-history"></i>
</a>
</td>

View file

@ -25,13 +25,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Controle des factures{% endblock %}
{% block title %}{% trans "Invoice control" %}{% endblock %}
{% block content %}
<h2>Controle et validité des factures</h2>
<h2>{% trans "Invoice control and validation" %}</h2>
{% if facture_list.paginator %}
{% include "pagination.html" with list=facture_list %}
{% include 'pagination.html' with list=facture_list %}
{% endif %}
<form class="form" method="post">
{% csrf_token %}
@ -39,24 +40,50 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>Profil</th>
<th>{% include "buttons/sort.html" with prefix='control' col='name' text='Nom' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='surname' text='Prénom' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='id' text='Id facture' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='user-id' text='Id user' %}</th>
<th>Designation</th>
<th>Prix total</th>
<th>{% include "buttons/sort.html" with prefix='control' col='paiement' text='Moyen de paiement' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='date' text='Date' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='valid' text='Valide' %}</th>
<th>{% include "buttons/sort.html" with prefix='control' col='control' text='Contrôlée' %}</th>
<th>{% trans "Profil" %}</th>
<th>
{% trans "Last name" as tr_last_name %}
{% include 'buttons/sort.html' with prefix='control' col='name' text=tr_last_name %}
</th>
<th>
{% trans "First name" as tr_first_name %}
{% include 'buttons/sort.html' with prefix='control' col='surname' text=tr_first_name %}
</th>
<th>
{% trans "Invoice id" as tr_invoice_id %}
{% include 'buttons/sort.html' with prefix='control' col='id' text=tr_invoice_id %}
</th>
<th>
{% trans "User id" as tr_user_id %}
{% include 'buttons/sort.html' with prefix='control' col='user-id' text=tr_user_id %}
</th>
<th>{% trans "Designation" %}</th>
<th>{% trans "Total price" %}</th>
<th>
{% trans "Payment method" as tr_payment_method %}
{% include 'buttons/sort.html' with prefix='control' col='paiement' text=tr_payment_method %}
</th>
<th>
{% trans "Date" as tr_date %}
{% include 'buttons/sort.html' with prefix='control' col='date' text=tr_date %}<
/th>
<th>
{% trans "Validated" as tr_validated %}
{% include 'buttons/sort.html' with prefix='control' col='valid' text=tr_validated %}<
/th>
<th>
{% trans "Controlled" as tr_controlled %}
{% include 'buttons/sort.html' with prefix='control' col='control' text=tr_controlled %}
</th>
</tr>
</thead>
{% for form in controlform.forms %}
{% bootstrap_form_errors form %}
<tr>
<td><a href="{% url "users:profil" form.instance.user.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i></a>
<td>
<a href="{% url 'users:profil' form.instance.user.id%}" class="btn btn-primary btn-sm" role="button">
<i class="fa fa-user"></i>
</a>
</td>
<td>{{ form.instance.user.name }}</td>
<td>{{ form.instance.user.surname }}</td>
@ -74,10 +101,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
{% endfor %}
</table>
{% bootstrap_button "Modifier" button_type="submit" icon="star" %}
{% trans "Edit" as tr_edit %}
{% bootstrap_button tr_edit button_type='submit' icon='star' %}
</form>
{% endblock %}
{% if facture_list.paginator %}
{% include "pagination.html" with list=facture_list %}
{% include 'pagination.html' with list=facture_list %}
{% endif %}

View file

@ -24,17 +24,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Création et modification de machines{% endblock %}
{% block title %}{% trans "Deletion of cotisations" %}{% endblock %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
<h4>
{% blocktrans %}
Warning. Are you sure you really want te delete this this {{ object_name }} object ( {{ objet }} ) ?
{% endblocktrans %}
</h4>
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type='submit' icon='trash' %}
</form>
<br />
<br />
<br />
{% endblock %}

View file

@ -26,27 +26,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load massive_bootstrap_form %}
{% load i18n %}
{% block title %}Création et modification de factures{% endblock %}
{% block title %}{% trans "Invoices creation and edition" %}{% endblock %}
{% block content %}
{% bootstrap_form_errors factureform %}
<form class="form" method="post">
{% csrf_token %}
<h3>Editer la facture</h3>
<h3>{% trans "Edit the invoice" %}</h3>
{% massive_bootstrap_form factureform 'user' %}
{{ venteform.management_form }}
<h3>Articles de la facture</h3>
<h3>{% trans "Invoice's articles" %}</h3>
<table class="table table-striped">
<thead>
<tr>
<th>Désignation</th>
<th>Quantité</th>
<th>{% trans "Designation" %}</th>
<th>{% trans "Quantity" %}</th>
</tr>
</thead>
{% for form in venteform.forms %}
{% bootstrap_form_errors form %}
{% for form in venteform.forms %}
{% bootstrap_form_errors form %}
<tr>
<td>{{ form.name }}</td>
<td>{{ form.number }}</td>
@ -56,7 +57,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
{% endfor %}
</table>
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type='submit' icon='star' %}
</form>
{% endblock %}

View file

@ -25,8 +25,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Création et modification de factures{% endblock %}
{% block title %}{% trans "invoices creation and edition" %}{% endblock %}
{% block content %}
{% bootstrap_form_errors factureform %}
@ -34,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form factureform %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type='submit' icon='star' %}
</form>
{% endblock %}

View file

@ -24,14 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Facture{% endblock %}
{% block title %}{% trans "Invoices" %}{% endblock %}
{% block content %}
<h2>Cotisations</h2>
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %}
<br />
<br />
<br />
<h2>{% trans "Cotisations" %}</h2>
{% include 'cotisations/aff_cotisations.html' with facture_list=facture_list %}
{% endblock %}

View file

@ -25,18 +25,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load acl %}
{% load i18n %}
{% block title %}Articles{% endblock %}
{% block title %}{% trans "Articles" %}{% endblock %}
{% block content %}
<h2>Liste des types d'articles</h2>
{% can_create Article %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-article' %}"><i class="fa fa-cart-plus"></i> Ajouter un type d'articles</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-article' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types d'articles</a>
{% include "cotisations/aff_article.html" with article_list=article_list %}
<br />
<br />
<br />
<h2>{% trans "Article type list" %}</h2>
{% can_create Article %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-article' %}">
<i class="fa fa-cart-plus"></i> {% trans "Add an article type" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-article' %}">
<i class="fa fa-trash"></i> {% trans "Delete article types" %}
</a>
{% include 'cotisations/aff_article.html' with article_list=article_list %}
{% endblock %}

View file

@ -25,18 +25,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load acl %}
{% load i18n %}
{% block title %}Banques{% endblock %}
{% block title %}{% trans "Banks" %}{% endblock %}
{% block content %}
<h2>Liste des banques</h2>
{% can_create Banque %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-banque' %}"><i class="fa fa-cart-plus"></i> Ajouter une banque</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-banque' %}"><i class="fa fa-trash"></i> Supprimer une ou plusieurs banques</a>
{% include "cotisations/aff_banque.html" with banque_list=banque_list %}
<br />
<br />
<br />
<h2>{% trans "Banks list" %}</h2>
{% can_create Banque %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-banque' %}">
<i class="fa fa-cart-plus"></i> {% trans "Add a bank" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-banque' %}">
<i class="fa fa-trash"></i> {% trans "Delete banks" %}
</a>
{% include 'cotisations/aff_banque.html' with banque_list=banque_list %}
{% endblock %}

View file

@ -25,18 +25,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load acl %}
{% load i18n %}
{% block title %}Paiements{% endblock %}
{% block title %}{% trans "Payments" %}{% endblock %}
{% block content %}
<h2>Liste des types de paiements</h2>
{% can_create Paiement %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-paiement' %}"><i class="fa fa-cart-plus"></i> Ajouter un type de paiement</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-paiement' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types de paiements</a>
{% include "cotisations/aff_paiement.html" with paiement_list=paiement_list %}
<br />
<br />
<br />
<h2>{% trans "Payment types list" %}</h2>
{% can_create Paiement %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-paiement' %}">
<i class="fa fa-cart-plus"></i> {% trans "Add a payment type" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-paiement' %}">
<i class="fa fa-trash"></i> {% trans "Delete payment types" %}
</a>
{% include 'cotisations/aff_paiement.html' with paiement_list=paiement_list %}
{% endblock %}

View file

@ -25,40 +25,45 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Création et modification de factures{% endblock %}
{% block title %}{% trans "Invoices creation and edition" %}{% endblock %}
{% block content %}
{% bootstrap_form_errors factureform %}
<form class="form" method="post">
{% csrf_token %}
<h3>Nouvelle facture</h3>
<h3>{% trans "New invoice" %}</h3>
<p>
Solde de l'utilisateur : {{ user.solde }} €
{% blocktrans %}
User's balance : {{ user.solde }} €
{% endblocktrans %}
</p>
{% bootstrap_form factureform %}
{{ venteform.management_form }}
<!-- TODO: FIXME to include data-type="check" for right option in id_cheque select -->
<h3>Articles de la facture</h3>
<h3>{% trans "Invoice's articles" %}</h3>
<div id="form_set" class="form-group">
{% for form in venteform.forms %}
{% for form in venteform.forms %}
<div class='product_to_sell form-inline'>
Article : &nbsp;
{% bootstrap_form form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm"
id="id_form-0-article-remove" type="button">
<span class="fa fa-times"></span>
</button>
{% trans "Article" %} : &nbsp;
{% bootstrap_form form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm" id="id_form-0-article-remove" type="button">
<span class="fa fa-times"></span>
</button>
</div>
{% endfor %}
{% endfor %}
</div>
<input class="btn btn-primary btn-sm" role="button" value="Ajouter un article" id="add_one">
<input class="btn btn-primary btn-sm" role="button" value="{% trans "Add an article"%}" id="add_one">
<p>
Prix total : <span id="total_price">0,00</span>
{% blocktrans %}
Total price : <span id="total_price">0,00</span>
{% endblocktrans %}
</p>
{% bootstrap_button "Créer" button_type="submit" icon="star" %}
{% trans "Create" as tr_create %}
{% bootstrap_button tr_create button_type='submit' icon='star' %}
</form>
<script type="text/javascript">
@ -72,9 +77,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% bootstrap_form venteform.empty_form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm"
id="id_form-__prefix__-article-remove" type="button">
<span class="fa fa-times"></span>
</button>`
id="id_form-__prefix__-article-remove" type="button">
<span class="fa fa-times"></span>
</button>`
function add_article(){
// Index start at 0 => new_index = number of items
@ -116,13 +121,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
document.getElementById('id_form-' + i.toString() + '-quantity')
.addEventListener("change", update_price, true);
document.getElementById('id_form-' + i.toString() + '-article-remove')
.addEventListener("click", function(event) {
var article = event.target.parentNode;
article.parentNode.removeChild(article);
.addEventListener("click", function(event) {
var article = event.target.parentNode;
article.parentNode.removeChild(article);
document.getElementById('id_form-TOTAL_FORMS').value --;
update_price();
}
)
update_price();
}
)
}
function set_cheque_info_visibility() {
@ -134,9 +139,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
display = 'block';
}
document.getElementById("id_Facture-cheque")
.parentNode.style.display = display;
.parentNode.style.display = display;
document.getElementById("id_Facture-banque")
.parentNode.style.display = display;
.parentNode.style.display = display;
}
// Add events manager when DOM is fully loaded

View file

@ -1,4 +1,3 @@
{% extends "cotisations/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
@ -26,36 +25,39 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Création et modification de factures{% endblock %}
{% block title %}{% trans "Invoices creation and edition" %}{% endblock %}
{% block content %}
{% bootstrap_form_errors venteform.management_form %}
<form class="form" method="post">
{% csrf_token %}
<h3>Nouvelle facture</h3>
<h3>{% trans "New invoice" %}</h3>
{{ venteform.management_form }}
<!-- TODO: FIXME to include data-type="check" for right option in id_cheque select -->
<h3>Articles de la facture</h3>
<h3>{% trans "Invoice's articles" %}</h3>
<div id="form_set" class="form-group">
{% for form in venteform.forms %}
{% for form in venteform.forms %}
<div class='product_to_sell form-inline'>
Article : &nbsp;
{% bootstrap_form form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm"
id="id_form-0-article-remove" type="button">
<span class="fa fa-times"></span>
</button>
{% trans "Article" %} : &nbsp;
{% bootstrap_form form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm" id="id_form-0-article-remove" type="button">
<span class="fa fa-times"></span>
</button>
</div>
{% endfor %}
{% endfor %}
</div>
<input class="btn btn-primary btn-sm" role="button" value="Ajouter un article" id="add_one">
<input class="btn btn-primary btn-sm" role="button" value="{% trans "Add an article"%}" id="add_one">
<p>
Prix total : <span id="total_price">0,00</span>
{% blocktrans %}
Total price : <span id="total_price">0,00</span>
{% endblocktrans %}
</p>
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type='submit' icon='star' %}
</form>
<script type="text/javascript">
@ -68,10 +70,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
var template = `Article : &nbsp;
{% bootstrap_form venteform.empty_form label_class='sr-only' %}
&nbsp;
<button class="btn btn-danger btn-sm"
id="id_form-__prefix__-article-remove" type="button">
<span class="fa fa-times"></span>
</button>`
<button class="btn btn-danger btn-sm" id="id_form-__prefix__-article-remove" type="button">
<span class="fa fa-times"></span>
</button>`
function add_article(){
// Index start at 0 => new_index = number of items
@ -113,13 +114,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
document.getElementById('id_form-' + i.toString() + '-quantity')
.addEventListener("change", update_price, true);
document.getElementById('id_form-' + i.toString() + '-article-remove')
.addEventListener("click", function(event) {
var article = event.target.parentNode;
article.parentNode.removeChild(article);
.addEventListener("click", function(event) {
var article = event.target.parentNode;
article.parentNode.removeChild(article);
document.getElementById('id_form-TOTAL_FORMS').value --;
update_price();
}
)
update_price();
}
)
}
function set_cheque_info_visibility() {
@ -131,9 +132,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
display = 'block';
}
document.getElementById("id_Facture-cheque")
.parentNode.style.display = display;
.parentNode.style.display = display;
document.getElementById("id_Facture-banque")
.parentNode.style.display = display;
.parentNode.style.display = display;
}
// Add events manager when DOM is fully loaded

View file

@ -25,13 +25,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Rechargement du solde{% endblock %}
{% block title %}{% trans "Balance refill" %}{% endblock %}
{% block content %}
<h3>Recharger de {{ amount }} €</h3>
<form class="form" method="{{ method }}" action="{{action}}">
{{ content | safe }}
{% bootstrap_button "Payer" button_type="submit" icon="piggy-bank" %}
</form>
<h3>
{% blocktrans %}
Refill of {{ amount }} €
{% endblocktrans %}
</h3>
<form class="form" method="{{ method }}" action="{{ action }}">
{{ content | safe }}
{% trans "Pay" as tr_pay %}
{% bootstrap_button tr_pay button_type='submit' icon='piggy-bank' %}
</form>
{% endblock %}

View file

@ -25,15 +25,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load staticfiles%}
{% load i18n %}
{% block title %}Rechargement du solde{% endblock %}
{% block title %}{% trans "Balance refill" %}{% endblock %}
{% block content %}
<h2>Rechargement du solde</h2>
<h3>Solde : <span class="label label-default">{{ request.user.solde }} €</span></h3>
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form rechargeform %}
{% bootstrap_button "Valider" button_type="submit" icon="piggy-bank" %}
</form>
<h2>{% trans "Balance refill" %}</h2>
<h3>
{% blocktrans %}
Balance : <span class="label label-default">{{ request.user.solde }} €</span>
{% endblocktrans %}
</h3>
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form rechargeform %}
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type='submit' icon='piggy-bank' %}
</form>
{% endblock %}

View file

@ -24,40 +24,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
{% block sidebar %}
{% can_change Facture pdf %}
<a class="list-group-item list-group-item-success" href="{% url "cotisations:new-facture-pdf" %}">
<i class="fa fa-plus"></i>
Créer une facture
<i class="fa fa-plus"></i> {% trans "Create an invoice" %}
</a>
<a class="list-group-item list-group-item-warning" href="{% url "cotisations:control" %}">
<i class="fa fa-eye"></i>
Contrôler les factures
<i class="fa fa-eye"></i> {% trans "Control the invoices" %}
</a>
{% acl_end %}
{% can_view_all Facture %}
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index" %}">
<i class="fa fa-list-ul"></i>
Factures
<i class="fa fa-list-ul"></i> {% trans "Invoices" %}
</a>
{% acl_end %}
{% can_view_all Article %}
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-article" %}">
<i class="fa fa-list-ul"></i>
Articles en vente
<i class="fa fa-list-ul"></i> {% trans "Available articles" %}
</a>
{% acl_end %}
{% can_view_all Banque %}
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-banque" %}">
<i class="fa fa-list-ul"></i>
Banques
<i class="fa fa-list-ul"></i> {% trans "Banks" %}
</a>
{% acl_end %}
{% can_view_all Paiement %}
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-paiement" %}">
<i class="fa fa-list-ul"></i>
Moyens de paiement
<i class="fa fa-list-ul"></i> {% trans "Payment methods" %}
</a>
{% acl_end %}
{% endblock %}