Commit 724f3d8d authored by Skia's avatar Skia

Templates and views

parent 28aa143f
Pipeline #61 failed with stage
in 1 minute and 13 seconds
...@@ -5,7 +5,12 @@ ...@@ -5,7 +5,12 @@
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> > <a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
{{ object.name }} {{ object.name }}
</p> </p>
<h2>{% trans %}View account{% endtrans %}</h2> <h2>{% trans %}Bank account: {% endtrans %}{{ object.name }}</h2>
<h4>{% trans %}Infos{% endtrans %}</h4>
<ul>
<li><strong>{% trans %}IBAN: {% endtrans %}</strong>{{ object.iban }}</li>
<li><strong>{% trans %}Number: {% endtrans %}</strong>{{ object.number }}</li>
</ul>
<p><a href="{{ url('accounting:club_new') }}?parent={{ object.id }}">{% trans %}New club account{% endtrans %}</a></p> <p><a href="{{ url('accounting:club_new') }}?parent={{ object.id }}">{% trans %}New club account{% endtrans %}</a></p>
<ul> <ul>
{% for c in object.club_accounts.all() %} {% for c in object.club_accounts.all() %}
......
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> > <a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> > <a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> >
{{ object }} {{ object }}
<h2>{% trans %}View account:{% endtrans %} {{ object.name }}</h2> <h2>{% trans %}Club account:{% endtrans %} {{ object.name }}</h2>
<ul>
{% for k,v in object.__dict__.items() %}
<li>{{ k }} - {{ v }}</li>
{% endfor %}
</ul>
{% if not object.has_open_journal() %} {% if not object.has_open_journal() %}
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">{% trans %}New journal{% endtrans %}</a></p> <p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">{% trans %}New journal{% endtrans %}</a></p>
{% else %} {% else %}
......
...@@ -65,7 +65,7 @@ class BankAccountCreateView(CanCreateMixin, CreateView): ...@@ -65,7 +65,7 @@ class BankAccountCreateView(CanCreateMixin, CreateView):
Create a bank account (for the admins) Create a bank account (for the admins)
""" """
model = BankAccount model = BankAccount
fields = ['name', 'iban', 'number'] fields = ['name', 'club', 'iban', 'number']
template_name = 'core/create.jinja' template_name = 'core/create.jinja'
class BankAccountDeleteView(CanEditPropMixin, DeleteView): # TODO change Delete to Close class BankAccountDeleteView(CanEditPropMixin, DeleteView): # TODO change Delete to Close
...@@ -163,9 +163,8 @@ class OperationCreateView(CanCreateMixin, CreateView): ...@@ -163,9 +163,8 @@ class OperationCreateView(CanCreateMixin, CreateView):
Create an operation Create an operation
""" """
model = Operation model = Operation
# fields = ['type', 'amount', 'label', 'remark', 'journal', 'date', 'cheque_number', 'accounting_type', 'done']
form_class = modelform_factory(Operation, form_class = modelform_factory(Operation,
fields=['amount', 'label', 'remark', 'journal', 'date', 'cheque_number', 'accounting_type', 'done'], fields=['amount', 'label', 'remark', 'journal', 'date', 'mode', 'cheque_number', 'accounting_type', 'done'],
widgets={'journal': HiddenInput}) widgets={'journal': HiddenInput})
template_name = 'core/create.jinja' template_name = 'core/create.jinja'
...@@ -183,6 +182,6 @@ class OperationEditView(CanEditMixin, UpdateView): ...@@ -183,6 +182,6 @@ class OperationEditView(CanEditMixin, UpdateView):
""" """
model = Operation model = Operation
pk_url_kwarg = "op_id" pk_url_kwarg = "op_id"
fields = ['amount', 'label', 'remark', 'date', 'cheque_number', 'accounting_type', 'done'] fields = ['amount', 'label', 'remark', 'date', 'mode', 'cheque_number', 'accounting_type', 'done']
template_name = 'core/edit.jinja' template_name = 'core/edit.jinja'
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
{% block content %} {% block content %}
<h3>{% trans %}User Tools{% endtrans %}</h3> <h3>{% trans %}User Tools{% endtrans %}</h3>
<hr>
<h4>{% trans %}Sith management{% endtrans %}</h4> <h4>{% trans %}Sith management{% endtrans %}</h4>
<ul> <ul>
{% if user.is_in_group(settings.SITH_GROUPS['root']['name']) %} {% if user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
{% endif %} {% endif %}
</ul> </ul>
<hr>
<h4>{% trans %}Counters{% endtrans %}</h4> <h4>{% trans %}Counters{% endtrans %}</h4>
<ul> <ul>
{% for b in settings.SITH_COUNTER_BARS %} {% for b in settings.SITH_COUNTER_BARS %}
...@@ -33,7 +35,23 @@ ...@@ -33,7 +35,23 @@
{% endfor %} {% endfor %}
</ul> </ul>
<h4>{% trans %}Clubs{% endtrans %}</h4> <hr>
<h4>{% trans %}Accounting{% endtrans %}</h4>
<ul>
{% for m in user.membership.filter(end_date=None).filter(role__gte=7).all() %}
{% for b in m.club.bank_accounts.all() %}
<li><strong>{% trans %}Bank account: {% endtrans %}</strong>
<a href="{{ url('accounting:bank_details', b_account_id=b.id) }}">{{ b.club }}</a></li>
{% endfor %}
{% if m.club.club_account %}
<li><strong>{% trans %}Club account: {% endtrans %}</strong>
<a href="{{ url('accounting:club_details', c_account_id=m.club.club_account.id) }}">{{ m.club.club_account }}</a></li>
{% endif %}
{% endfor %}
</ul>
<hr>
<h4>{% trans %}Club tools{% endtrans %}</h4>
<ul> <ul>
{% for m in user.membership.filter(end_date=None).all() %} {% for m in user.membership.filter(end_date=None).all() %}
<li><a href="{{ url('club:tools', club_id=m.club.id) }}">{{ m.club }}</a></li> <li><a href="{{ url('club:tools', club_id=m.club.id) }}">{{ m.club }}</a></li>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-19 17:00+0000\n" "POT-Creation-Date: 2016-07-21 12:08+0200\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
...@@ -16,71 +16,84 @@ msgstr "" ...@@ -16,71 +16,84 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: accounting/models.py:29 accounting/models.py:52 accounting/models.py:91 #: accounting/models.py:32 accounting/models.py:55 accounting/models.py:94
#: club/models.py:18 counter/models.py:35 counter/models.py:54 #: club/models.py:18 counter/models.py:39 counter/models.py:58
#: counter/models.py:76 #: counter/models.py:80
msgid "name" msgid "name"
msgstr "nom" msgstr "nom"
#: accounting/models.py:30 #: accounting/models.py:33
msgid "iban" msgid "iban"
msgstr "IBAN" msgstr "IBAN"
#: accounting/models.py:31 #: accounting/models.py:34
msgid "account number" msgid "account number"
msgstr "numero de compte" msgstr "numero de compte"
#: accounting/models.py:89 club/models.py:109 counter/models.py:211 #: accounting/models.py:92 club/models.py:109 counter/models.py:215
msgid "start date" msgid "start date"
msgstr "date de début" msgstr "date de début"
#: accounting/models.py:90 club/models.py:110 counter/models.py:212 #: accounting/models.py:93 club/models.py:110 counter/models.py:216
msgid "end date" msgid "end date"
msgstr "date de fin" msgstr "date de fin"
#: accounting/models.py:92 #: accounting/models.py:95
msgid "is closed" msgid "is closed"
msgstr "est fermé" msgstr "est fermé"
#: accounting/models.py:94 accounting/models.py:132 counter/models.py:21 #: accounting/models.py:97 accounting/models.py:136 counter/models.py:22
#: counter/models.py:159 #: counter/models.py:163
msgid "amount" msgid "amount"
msgstr "montant" msgstr "montant"
#: accounting/models.py:95 #: accounting/models.py:98
msgid "effective_amount" msgid "effective_amount"
msgstr "montant effectif" msgstr "montant effectif"
#: accounting/models.py:133 core/models.py:456 counter/models.py:162 #: accounting/models.py:134
#: counter/models.py:190 msgid "number"
msgstr "numéro"
#: accounting/models.py:137 core/models.py:462 counter/models.py:166
#: counter/models.py:194
msgid "date" msgid "date"
msgstr "date" msgstr "date"
#: accounting/models.py:134 accounting/models.py:182 #: accounting/models.py:138 accounting/models.py:198
msgid "label" msgid "label"
msgstr "intitulé" msgstr "intitulé"
#: accounting/models.py:135 #: accounting/models.py:139
msgid "remark" msgid "remark"
msgstr "remarque" msgstr "remarque"
#: accounting/models.py:136 counter/models.py:163 subscription/models.py:34 #: accounting/models.py:140 counter/models.py:167 subscription/models.py:34
msgid "payment method" msgid "payment method"
msgstr "méthode de paiement" msgstr "méthode de paiement"
#: accounting/models.py:137 #: accounting/models.py:141
msgid "cheque number" msgid "cheque number"
msgstr "numéro de chèque" msgstr "numéro de chèque"
#: accounting/models.py:139 #: accounting/models.py:143
msgid "is done" msgid "is done"
msgstr "est fait" msgstr "est fait"
#: accounting/models.py:181 counter/models.py:57 #: accounting/models.py:153
#, python-format
msgid ""
"The date can not be before the start date of the journal, which is\n"
"%(start_date)s."
msgstr ""
"La date ne peut pas être avant la date de début du journal, qui est\n"
"%(start_date)s."
#: accounting/models.py:197 counter/models.py:61
msgid "code" msgid "code"
msgstr "code" msgstr "code"
#: accounting/models.py:183 #: accounting/models.py:199
msgid "movement type" msgid "movement type"
msgstr "type de mouvement" msgstr "type de mouvement"
...@@ -100,31 +113,46 @@ msgstr "Il n'y a pas de types comptable dans ce site web." ...@@ -100,31 +113,46 @@ msgstr "Il n'y a pas de types comptable dans ce site web."
#: accounting/templates/accounting/bank_account_details.jinja:5 #: accounting/templates/accounting/bank_account_details.jinja:5
#: accounting/templates/accounting/club_account_details.jinja:5 #: accounting/templates/accounting/club_account_details.jinja:5
#: accounting/templates/accounting/journal_details.jinja:5 #: accounting/templates/accounting/journal_details.jinja:5
#: core/templates/core/user_tools.jinja:19 #: core/templates/core/user_tools.jinja:20
#: core/templates/core/user_tools.jinja:39
msgid "Accounting" msgid "Accounting"
msgstr "Comptabilité" msgstr "Comptabilité"
#: accounting/templates/accounting/bank_account_details.jinja:8 #: accounting/templates/accounting/bank_account_details.jinja:8
msgid "View account" #: core/templates/core/user_tools.jinja:43
msgstr "Voir le compte" msgid "Bank account: "
msgstr "Compte en banque : "
#: accounting/templates/accounting/bank_account_details.jinja:9 #: accounting/templates/accounting/bank_account_details.jinja:9
#: core/templates/core/user_base.jinja:6
msgid "Infos"
msgstr "Infos"
#: accounting/templates/accounting/bank_account_details.jinja:11
msgid "IBAN: "
msgstr "IBAN : "
#: accounting/templates/accounting/bank_account_details.jinja:12
msgid "Number: "
msgstr "Numéro : "
#: accounting/templates/accounting/bank_account_details.jinja:14
msgid "New club account" msgid "New club account"
msgstr "Nouveau compte club" msgstr "Nouveau compte club"
#: accounting/templates/accounting/bank_account_details.jinja:13 #: accounting/templates/accounting/bank_account_details.jinja:18
#: accounting/templates/accounting/bank_account_list.jinja:15 #: accounting/templates/accounting/bank_account_list.jinja:15
#: accounting/templates/accounting/club_account_details.jinja:45 #: accounting/templates/accounting/club_account_details.jinja:44
#: accounting/templates/accounting/journal_details.jinja:48 #: accounting/templates/accounting/journal_details.jinja:51
#: club/templates/club/club_detail.jinja:7 #: club/templates/club/club_detail.jinja:7
#: core/templates/core/page_detail.jinja:7 #: core/templates/core/page_detail.jinja:7
#: core/templates/core/user_base.jinja:8 #: core/templates/core/user_base.jinja:8
#: core/templates/core/user_tools.jinja:31 #: core/templates/core/user_tools.jinja:33
#: counter/templates/counter/counter_list.jinja:14 #: counter/templates/counter/counter_list.jinja:14
msgid "Edit" msgid "Edit"
msgstr "Éditer" msgstr "Éditer"
#: accounting/templates/accounting/bank_account_details.jinja:14 #: accounting/templates/accounting/bank_account_details.jinja:19
#: accounting/templates/accounting/bank_account_list.jinja:16 #: accounting/templates/accounting/bank_account_list.jinja:16
#: core/templates/core/group_list.jinja:13 #: core/templates/core/group_list.jinja:13
msgid "Delete" msgid "Delete"
...@@ -148,53 +176,58 @@ msgid "There is no accounts in this website." ...@@ -148,53 +176,58 @@ msgid "There is no accounts in this website."
msgstr "Il n'y a pas de comptes dans ce site web." msgstr "Il n'y a pas de comptes dans ce site web."
#: accounting/templates/accounting/club_account_details.jinja:8 #: accounting/templates/accounting/club_account_details.jinja:8
msgid "View account:" msgid "Club account:"
msgstr "Voir le compte:" msgstr "Compte club : "
#: accounting/templates/accounting/club_account_details.jinja:15 #: accounting/templates/accounting/club_account_details.jinja:10
msgid "New journal" msgid "New journal"
msgstr "Nouveau classeur" msgstr "Nouveau classeur"
#: accounting/templates/accounting/club_account_details.jinja:17 #: accounting/templates/accounting/club_account_details.jinja:12
msgid "You can not create new journal while you still have one opened" msgid "You can not create new journal while you still have one opened"
msgstr "Vous ne pouvez pas créer de journal tant qu'il y en a un d'ouvert" msgstr "Vous ne pouvez pas créer de journal tant qu'il y en a un d'ouvert"
#: accounting/templates/accounting/club_account_details.jinja:21 #: accounting/templates/accounting/club_account_details.jinja:17
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: accounting/templates/accounting/club_account_details.jinja:22 #: accounting/templates/accounting/club_account_details.jinja:18
msgid "Start" msgid "Start"
msgstr "Début" msgstr "Début"
#: accounting/templates/accounting/club_account_details.jinja:23 #: accounting/templates/accounting/club_account_details.jinja:19
msgid "End" msgid "End"
msgstr "Fin" msgstr "Fin"
#: accounting/templates/accounting/club_account_details.jinja:24 #: accounting/templates/accounting/club_account_details.jinja:20
#: accounting/templates/accounting/journal_details.jinja:22 #: accounting/templates/accounting/journal_details.jinja:23
msgid "Amount" msgid "Amount"
msgstr "Montant" msgstr "Montant"
#: accounting/templates/accounting/club_account_details.jinja:25 #: accounting/templates/accounting/club_account_details.jinja:21
msgid "Effective amount" msgid "Effective amount"
msgstr "Montant effectif" msgstr "Montant effectif"
#: accounting/templates/accounting/club_account_details.jinja:26 #: accounting/templates/accounting/club_account_details.jinja:22
msgid "Closed" msgid "Closed"
msgstr "Fermé" msgstr "Fermé"
#: accounting/templates/accounting/club_account_details.jinja:40 #: accounting/templates/accounting/club_account_details.jinja:23
#: accounting/templates/accounting/journal_details.jinja:41 #: accounting/templates/accounting/journal_details.jinja:30
msgid "Actions"
msgstr "Actions"
#: accounting/templates/accounting/club_account_details.jinja:39
#: accounting/templates/accounting/journal_details.jinja:44
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: accounting/templates/accounting/club_account_details.jinja:42 #: accounting/templates/accounting/club_account_details.jinja:41
#: accounting/templates/accounting/journal_details.jinja:43 #: accounting/templates/accounting/journal_details.jinja:46
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: accounting/templates/accounting/club_account_details.jinja:44 #: accounting/templates/accounting/club_account_details.jinja:43
msgid "View" msgid "View"
msgstr "Voir" msgstr "Voir"
...@@ -214,42 +247,38 @@ msgstr "Le classeur est fermé, vous ne pouvez pas créer d'opération" ...@@ -214,42 +247,38 @@ msgstr "Le classeur est fermé, vous ne pouvez pas créer d'opération"
msgid "New operation" msgid "New operation"
msgstr "Nouvelle opération" msgstr "Nouvelle opération"
#: accounting/templates/accounting/journal_details.jinja:19 #: accounting/templates/accounting/journal_details.jinja:20
msgid "Nb" msgid "Nb"
msgstr "No" msgstr "No"
#: accounting/templates/accounting/journal_details.jinja:20 #: accounting/templates/accounting/journal_details.jinja:21
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: accounting/templates/accounting/journal_details.jinja:21 #: accounting/templates/accounting/journal_details.jinja:22
msgid "Label" msgid "Label"
msgstr "Intitulé" msgstr "Intitulé"
#: accounting/templates/accounting/journal_details.jinja:23 #: accounting/templates/accounting/journal_details.jinja:24
msgid "Payment mode" msgid "Payment mode"
msgstr "Méthode de paiement" msgstr "Méthode de paiement"
#: accounting/templates/accounting/journal_details.jinja:25 #: accounting/templates/accounting/journal_details.jinja:26
msgid "Code" msgid "Code"
msgstr "Code" msgstr "Code"
#: accounting/templates/accounting/journal_details.jinja:26 #: accounting/templates/accounting/journal_details.jinja:27
msgid "Nature" msgid "Nature"
msgstr "Nature" msgstr "Nature"
#: accounting/templates/accounting/journal_details.jinja:27 #: accounting/templates/accounting/journal_details.jinja:28
msgid "Done" msgid "Done"
msgstr "Effectué" msgstr "Effectué"
#: accounting/templates/accounting/journal_details.jinja:28 #: accounting/templates/accounting/journal_details.jinja:29
msgid "Comment" msgid "Comment"
msgstr "Commentaire" msgstr "Commentaire"
#: accounting/templates/accounting/journal_details.jinja:29
msgid "Actions"
msgstr "Actions"
#: club/models.py:20 #: club/models.py:20
msgid "unix name" msgid "unix name"
msgstr "nom unix" msgstr "nom unix"
...@@ -286,8 +315,8 @@ msgstr "club" ...@@ -286,8 +315,8 @@ msgstr "club"
msgid "role" msgid "role"
msgstr "rôle" msgstr "rôle"
#: club/models.py:113 core/models.py:27 counter/models.py:36 #: club/models.py:113 core/models.py:27 counter/models.py:40
#: counter/models.py:55 #: counter/models.py:59
msgid "description" msgid "description"
msgstr "description" msgstr "description"
...@@ -361,12 +390,13 @@ msgid "Add" ...@@ -361,12 +390,13 @@ msgid "Add"
msgstr "Ajouter" msgstr "Ajouter"
#: club/templates/club/club_tools.jinja:4 #: club/templates/club/club_tools.jinja:4
#: core/templates/core/user_tools.jinja:54
msgid "Club tools" msgid "Club tools"
msgstr "Outils du club" msgstr "Outils club"
#: club/templates/club/club_tools.jinja:8 #: club/templates/club/club_tools.jinja:8
msgid "Counters:" msgid "Counters:"
msgstr "Comptoirs:" msgstr "Comptoirs : "
#: core/models.py:23 #: core/models.py:23
msgid "meta group status" msgid "meta group status"
...@@ -446,35 +476,35 @@ msgstr "super-utilisateur" ...@@ -446,35 +476,35 @@ msgstr "super-utilisateur"
msgid "Designates whether this user is a superuser. " msgid "Designates whether this user is a superuser. "
msgstr "Est-ce que l'utilisateur est super-utilisateur." msgstr "Est-ce que l'utilisateur est super-utilisateur."
#: core/models.py:274 #: core/models.py:280
msgid "Visitor" msgid "Visitor"
msgstr "Visiteur" msgstr "Visiteur"
#: core/models.py:279 #: core/models.py:285
msgid "define if we show a users stats" msgid "define if we show a users stats"
msgstr "Definit si l'on montre les statistiques de l'utilisateur" msgstr "Definit si l'on montre les statistiques de l'utilisateur"
#: core/models.py:281 #: core/models.py:287
msgid "Show your account statistics to others" msgid "Show your account statistics to others"
msgstr "Montrez vos statistiques de compte aux autres" msgstr "Montrez vos statistiques de compte aux autres"
#: core/models.py:307 core/models.py:311 #: core/models.py:313 core/models.py:317
msgid "page name" msgid "page name"
msgstr "nom de la page" msgstr "nom de la page"
#: core/models.py:344 #: core/models.py:350
msgid "Duplicate page" msgid "Duplicate page"
msgstr "Duppliquer la page" msgstr "Duppliquer la page"
#: core/models.py:350 #: core/models.py:356
msgid "Loop in page tree" msgid "Loop in page tree"
msgstr "Boucle dans l'arborescence des pages" msgstr "Boucle dans l'arborescence des pages"
#: core/models.py:454 #: core/models.py:460
msgid "page title" msgid "page title"
msgstr "titre de la page" msgstr "titre de la page"
#: core/models.py:455 #: core/models.py:461
msgid "page content" msgid "page content"
msgstr "contenu de la page" msgstr "contenu de la page"
...@@ -519,7 +549,7 @@ msgstr "Utilisateurs" ...@@ -519,7 +549,7 @@ msgstr "Utilisateurs"
msgid "Pages" msgid "Pages"
msgstr "Pages" msgstr "Pages"
#: core/templates/core/base.jinja:31 core/templates/core/user_tools.jinja:36 #: core/templates/core/base.jinja:31
msgid "Clubs" msgid "Clubs"
msgstr "Clubs" msgstr "Clubs"
...@@ -653,6 +683,7 @@ msgid "Back to page" ...@@ -653,6 +683,7 @@ msgid "Back to page"
msgstr "Retour à la page"