Subscriptions stats optimisations + form for start and end date

This commit is contained in:
Antoine Bartuccio 2017-06-06 23:27:57 +02:00
parent 1c05671784
commit 88762c492f
3 changed files with 162 additions and 110 deletions

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-02 14:55+0200\n" "POT-Creation-Date: 2017-06-06 23:25+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"
@ -126,8 +126,8 @@ msgstr "numéro"
msgid "journal" msgid "journal"
msgstr "classeur" msgstr "classeur"
#: accounting/models.py:254 core/models.py:596 core/models.py:967 #: accounting/models.py:254 core/models.py:600 core/models.py:971
#: core/models.py:1007 counter/models.py:276 counter/models.py:324 #: core/models.py:1011 counter/models.py:276 counter/models.py:324
#: counter/models.py:450 eboutic/models.py:39 eboutic/models.py:72 #: counter/models.py:450 eboutic/models.py:39 eboutic/models.py:72
#: forum/models.py:236 forum/models.py:308 stock/models.py:76 #: forum/models.py:236 forum/models.py:308 stock/models.py:76
msgid "date" msgid "date"
@ -293,7 +293,7 @@ msgstr "Liste des types comptable"
#: accounting/templates/accounting/label_list.jinja:9 #: accounting/templates/accounting/label_list.jinja:9
#: accounting/templates/accounting/operation_edit.jinja:9 #: accounting/templates/accounting/operation_edit.jinja:9
#: accounting/templates/accounting/simplifiedaccountingtype_list.jinja:9 #: accounting/templates/accounting/simplifiedaccountingtype_list.jinja:9
#: core/templates/core/user_tools.jinja:54 #: core/templates/core/user_tools.jinja:55
msgid "Accounting" msgid "Accounting"
msgstr "Comptabilité" msgstr "Comptabilité"
@ -312,7 +312,7 @@ msgstr "Il n'y a pas de types comptable dans ce site web."
#: accounting/templates/accounting/bank_account_details.jinja:4 #: accounting/templates/accounting/bank_account_details.jinja:4
#: accounting/templates/accounting/bank_account_details.jinja:13 #: accounting/templates/accounting/bank_account_details.jinja:13
#: core/templates/core/user_tools.jinja:63 #: core/templates/core/user_tools.jinja:64
msgid "Bank account: " msgid "Bank account: "
msgstr "Compte en banque : " msgstr "Compte en banque : "
@ -371,7 +371,7 @@ msgstr "Nouveau compte club"
#: com/templates/com/news_admin_list.jinja:72 #: com/templates/com/news_admin_list.jinja:72
#: com/templates/com/weekmail.jinja:32 com/templates/com/weekmail.jinja:61 #: com/templates/com/weekmail.jinja:32 com/templates/com/weekmail.jinja:61
#: core/templates/core/file.jinja:38 core/templates/core/page.jinja:31 #: core/templates/core/file.jinja:38 core/templates/core/page.jinja:31
#: core/templates/core/user_tools.jinja:39 core/views/user.py:177 #: core/templates/core/user_tools.jinja:40 core/views/user.py:177
#: counter/templates/counter/cash_summary_list.jinja:53 #: counter/templates/counter/cash_summary_list.jinja:53
#: counter/templates/counter/counter_list.jinja:17 #: counter/templates/counter/counter_list.jinja:17
#: counter/templates/counter/counter_list.jinja:32 #: counter/templates/counter/counter_list.jinja:32
@ -497,7 +497,7 @@ msgstr "Voir"
#: accounting/templates/accounting/co_list.jinja:4 #: accounting/templates/accounting/co_list.jinja:4
#: accounting/templates/accounting/journal_details.jinja:18 #: accounting/templates/accounting/journal_details.jinja:18
#: core/templates/core/user_tools.jinja:59 #: core/templates/core/user_tools.jinja:60
msgid "Company list" msgid "Company list"
msgstr "Liste des entreprises" msgstr "Liste des entreprises"
@ -863,7 +863,7 @@ msgid "Club list"
msgstr "Liste des clubs" msgstr "Liste des clubs"
#: club/templates/club/club_list.jinja:21 #: club/templates/club/club_list.jinja:21
#: core/templates/core/user_tools.jinja:19 #: core/templates/core/user_tools.jinja:20
msgid "New club" msgid "New club"
msgstr "Nouveau club" msgstr "Nouveau club"
@ -982,7 +982,8 @@ msgstr "Quantité"
#: counter/templates/counter/cash_summary_list.jinja:35 #: counter/templates/counter/cash_summary_list.jinja:35
#: counter/templates/counter/last_ops.jinja:44 #: counter/templates/counter/last_ops.jinja:44
#: counter/templates/counter/stats.jinja:18 #: counter/templates/counter/stats.jinja:18
#: subscription/templates/subscription/stats.jinja:28 #: subscription/templates/subscription/stats.jinja:33
#: subscription/templates/subscription/stats.jinja:41
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"
@ -995,7 +996,7 @@ msgid "Payment method"
msgstr "Méthode de paiement" msgstr "Méthode de paiement"
#: club/templates/club/club_tools.jinja:4 #: club/templates/club/club_tools.jinja:4
#: core/templates/core/user_tools.jinja:95 #: core/templates/core/user_tools.jinja:96
msgid "Club tools" msgid "Club tools"
msgstr "Outils club" msgstr "Outils club"
@ -1067,7 +1068,7 @@ msgid "Begin date"
msgstr "Date de début" msgstr "Date de début"
#: club/views.py:196 com/views.py:123 counter/views.py:1020 #: club/views.py:196 com/views.py:123 counter/views.py:1020
#: election/views.py:131 #: election/views.py:131 subscription/views.py:50
msgid "End date" msgid "End date"
msgstr "Date de fin" msgstr "Date de fin"
@ -1122,7 +1123,7 @@ msgstr "résumé"
msgid "content" msgid "content"
msgstr "contenu" msgstr "contenu"
#: com/models.py:63 core/models.py:1006 launderette/models.py:84 #: com/models.py:63 core/models.py:1010 launderette/models.py:84
#: launderette/models.py:109 launderette/models.py:145 stock/models.py:59 #: launderette/models.py:109 launderette/models.py:145 stock/models.py:59
#: stock/models.py:98 #: stock/models.py:98
msgid "type" msgid "type"
@ -1132,7 +1133,7 @@ msgstr "type"
msgid "author" msgid "author"
msgstr "auteur" msgstr "auteur"
#: com/models.py:66 core/models.py:597 #: com/models.py:66 core/models.py:601
msgid "is moderated" msgid "is moderated"
msgstr "est modéré" msgstr "est modéré"
@ -1262,7 +1263,7 @@ msgid "Edit news"
msgstr "Éditer la nouvelle" msgstr "Éditer la nouvelle"
#: com/templates/com/news_edit.jinja:8 com/templates/com/news_edit.jinja:30 #: com/templates/com/news_edit.jinja:8 com/templates/com/news_edit.jinja:30
#: core/templates/core/user_tools.jinja:81 #: core/templates/core/user_tools.jinja:82
msgid "Create news" msgid "Create news"
msgstr "Créer nouvelle" msgstr "Créer nouvelle"
@ -1308,7 +1309,7 @@ msgid "Coming soon... don't miss!"
msgstr "Prochainement... à ne pas rater!" msgstr "Prochainement... à ne pas rater!"
#: com/templates/com/weekmail.jinja:5 com/templates/com/weekmail.jinja.py:9 #: com/templates/com/weekmail.jinja:5 com/templates/com/weekmail.jinja.py:9
#: com/views.py:61 core/templates/core/user_tools.jinja:79 #: com/views.py:61 core/templates/core/user_tools.jinja:80
msgid "Weekmail" msgid "Weekmail"
msgstr "Weekmail" msgstr "Weekmail"
@ -1398,7 +1399,7 @@ msgstr "Le mot de la fin"
msgid "Communication administration" msgid "Communication administration"
msgstr "Administration de la communication" msgstr "Administration de la communication"
#: com/views.py:66 core/templates/core/user_tools.jinja:80 #: com/views.py:66 core/templates/core/user_tools.jinja:81
msgid "Weekmail destinations" msgid "Weekmail destinations"
msgstr "Destinataires du Weekmail" msgstr "Destinataires du Weekmail"
@ -1414,7 +1415,7 @@ msgstr "Message d'info"
msgid "Alert message" msgid "Alert message"
msgstr "Message d'alerte" msgstr "Message d'alerte"
#: com/views.py:122 election/views.py:130 #: com/views.py:122 election/views.py:130 subscription/views.py:47
msgid "Start date" msgid "Start date"
msgstr "Date de début" msgstr "Date de début"
@ -1685,109 +1686,109 @@ msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
msgid "Profile" msgid "Profile"
msgstr "Profil" msgstr "Profil"
#: core/models.py:554 #: core/models.py:558
msgid "Visitor" msgid "Visitor"
msgstr "Visiteur" msgstr "Visiteur"
#: core/models.py:559 #: core/models.py:563
msgid "do you want to receive the weekmail" msgid "do you want to receive the weekmail"
msgstr "voulez-vous recevoir le Weekmail" msgstr "voulez-vous recevoir le Weekmail"
#: core/models.py:564 #: core/models.py:568
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:566 #: core/models.py:570
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:585 #: core/models.py:589
msgid "file name" msgid "file name"
msgstr "nom du fichier" msgstr "nom du fichier"
#: core/models.py:586 core/models.py:794 #: core/models.py:590 core/models.py:798
msgid "parent" msgid "parent"
msgstr "parent" msgstr "parent"
#: core/models.py:587 core/models.py:603 #: core/models.py:591 core/models.py:607
msgid "file" msgid "file"
msgstr "fichier" msgstr "fichier"
#: core/models.py:588 #: core/models.py:592
msgid "compressed file" msgid "compressed file"
msgstr "version allégée" msgstr "version allégée"
#: core/models.py:589 #: core/models.py:593
msgid "thumbnail" msgid "thumbnail"
msgstr "miniature" msgstr "miniature"
#: core/models.py:590 core/models.py:598 #: core/models.py:594 core/models.py:602
msgid "owner" msgid "owner"
msgstr "propriétaire" msgstr "propriétaire"
#: core/models.py:591 core/models.py:800 core/views/files.py:146 #: core/models.py:595 core/models.py:804 core/views/files.py:146
msgid "edit group" msgid "edit group"
msgstr "groupe d'édition" msgstr "groupe d'édition"
#: core/models.py:592 core/models.py:801 core/views/files.py:147 #: core/models.py:596 core/models.py:805 core/views/files.py:147
msgid "view group" msgid "view group"
msgstr "groupe de vue" msgstr "groupe de vue"
#: core/models.py:593 #: core/models.py:597
msgid "is folder" msgid "is folder"
msgstr "est un dossier" msgstr "est un dossier"
#: core/models.py:594 #: core/models.py:598
msgid "mime type" msgid "mime type"
msgstr "type mime" msgstr "type mime"
#: core/models.py:595 #: core/models.py:599
msgid "size" msgid "size"
msgstr "taille" msgstr "taille"
#: core/models.py:599 #: core/models.py:603
msgid "asked for removal" msgid "asked for removal"
msgstr "retrait demandé" msgstr "retrait demandé"
#: core/models.py:600 #: core/models.py:604
msgid "is in the SAS" msgid "is in the SAS"
msgstr "est dans le SAS" msgstr "est dans le SAS"
#: core/models.py:639 #: core/models.py:643
msgid "Character '/' not authorized in name" msgid "Character '/' not authorized in name"
msgstr "Le caractère '/' n'est pas autorisé dans les noms de fichier" msgstr "Le caractère '/' n'est pas autorisé dans les noms de fichier"
#: core/models.py:642 core/models.py:647 #: core/models.py:646 core/models.py:651
msgid "Loop in folder tree" msgid "Loop in folder tree"
msgstr "Boucle dans l'arborescence des dossiers" msgstr "Boucle dans l'arborescence des dossiers"
#: core/models.py:651 #: core/models.py:655
msgid "You can not make a file be a children of a non folder file" msgid "You can not make a file be a children of a non folder file"
msgstr "" msgstr ""
"Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas " "Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas "
"un dossier" "un dossier"
#: core/models.py:655 #: core/models.py:659
msgid "Duplicate file" msgid "Duplicate file"
msgstr "Un fichier de ce nom existe déjà" msgstr "Un fichier de ce nom existe déjà"
#: core/models.py:669 #: core/models.py:673
msgid "You must provide a file" msgid "You must provide a file"
msgstr "Vous devez fournir un fichier" msgstr "Vous devez fournir un fichier"
#: core/models.py:735 #: core/models.py:739
msgid "Folder: " msgid "Folder: "
msgstr "Dossier : " msgstr "Dossier : "
#: core/models.py:737 #: core/models.py:741
msgid "File: " msgid "File: "
msgstr "Fichier : " msgstr "Fichier : "
#: core/models.py:785 #: core/models.py:789
msgid "page unix name" msgid "page unix name"
msgstr "nom unix de la page" msgstr "nom unix de la page"
#: core/models.py:789 #: core/models.py:793
msgid "" msgid ""
"Enter a valid page name. This value may contain only unaccented letters, " "Enter a valid page name. This value may contain only unaccented letters, "
"numbers and ./+/-/_ characters." "numbers and ./+/-/_ characters."
@ -1795,51 +1796,51 @@ msgstr ""
"Entrez un nom de page correct. Uniquement des lettres non accentuées, " "Entrez un nom de page correct. Uniquement des lettres non accentuées, "
"numéros, et ./+/-/_" "numéros, et ./+/-/_"
#: core/models.py:797 #: core/models.py:801
msgid "page name" msgid "page name"
msgstr "nom de la page" msgstr "nom de la page"
#: core/models.py:798 #: core/models.py:802
msgid "owner group" msgid "owner group"
msgstr "groupe propriétaire" msgstr "groupe propriétaire"
#: core/models.py:802 #: core/models.py:806
msgid "lock user" msgid "lock user"
msgstr "utilisateur bloquant" msgstr "utilisateur bloquant"
#: core/models.py:803 #: core/models.py:807
msgid "lock_timeout" msgid "lock_timeout"
msgstr "décompte du déblocage" msgstr "décompte du déblocage"
#: core/models.py:830 #: core/models.py:834
msgid "Duplicate page" msgid "Duplicate page"
msgstr "Une page de ce nom existe déjà" msgstr "Une page de ce nom existe déjà"
#: core/models.py:836 #: core/models.py:840
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:964 #: core/models.py:968
msgid "revision" msgid "revision"
msgstr "révision" msgstr "révision"
#: core/models.py:965 #: core/models.py:969
msgid "page title" msgid "page title"
msgstr "titre de la page" msgstr "titre de la page"
#: core/models.py:966 #: core/models.py:970
msgid "page content" msgid "page content"
msgstr "contenu de la page" msgstr "contenu de la page"
#: core/models.py:1004 #: core/models.py:1008
msgid "url" msgid "url"
msgstr "url" msgstr "url"
#: core/models.py:1005 #: core/models.py:1009
msgid "param" msgid "param"
msgstr "param" msgstr "param"
#: core/models.py:1008 #: core/models.py:1012
msgid "viewed" msgid "viewed"
msgstr "vue" msgstr "vue"
@ -2401,7 +2402,7 @@ msgid "Eboutic invoices"
msgstr "Facture eboutic" msgstr "Facture eboutic"
#: core/templates/core/user_account.jinja:53 #: core/templates/core/user_account.jinja:53
#: core/templates/core/user_tools.jinja:33 counter/views.py:561 #: core/templates/core/user_tools.jinja:34 counter/views.py:561
msgid "Etickets" msgid "Etickets"
msgstr "Etickets" msgstr "Etickets"
@ -2590,121 +2591,126 @@ msgstr "Fusionner deux utilisateurs"
msgid "Subscriptions" msgid "Subscriptions"
msgstr "Cotisations" msgstr "Cotisations"
#: core/templates/core/user_tools.jinja:24 counter/views.py:531 #: core/templates/core/user_tools.jinja:19
#: subscription/templates/subscription/stats.jinja:4
msgid "Subscription stats"
msgstr "Statistiques de cotisation"
#: core/templates/core/user_tools.jinja:25 counter/views.py:531
#: counter/views.py:685 #: counter/views.py:685
msgid "Counters" msgid "Counters"
msgstr "Comptoirs" msgstr "Comptoirs"
#: core/templates/core/user_tools.jinja:27 #: core/templates/core/user_tools.jinja:28
msgid "General management" msgid "General management"
msgstr "Gestion générale" msgstr "Gestion générale"
#: core/templates/core/user_tools.jinja:28 #: core/templates/core/user_tools.jinja:29
msgid "General counters management" msgid "General counters management"
msgstr "Gestion générale des comptoirs" msgstr "Gestion générale des comptoirs"
#: core/templates/core/user_tools.jinja:29 #: core/templates/core/user_tools.jinja:30
msgid "Products management" msgid "Products management"
msgstr "Gestion des produits" msgstr "Gestion des produits"
#: core/templates/core/user_tools.jinja:30 #: core/templates/core/user_tools.jinja:31
msgid "Product types management" msgid "Product types management"
msgstr "Gestion des types de produit" msgstr "Gestion des types de produit"
#: core/templates/core/user_tools.jinja:31 #: core/templates/core/user_tools.jinja:32
#: counter/templates/counter/cash_summary_list.jinja:23 counter/views.py:551 #: counter/templates/counter/cash_summary_list.jinja:23 counter/views.py:551
msgid "Cash register summaries" msgid "Cash register summaries"
msgstr "Relevés de caisse" msgstr "Relevés de caisse"
#: core/templates/core/user_tools.jinja:32 #: core/templates/core/user_tools.jinja:33
#: counter/templates/counter/invoices_call.jinja:4 counter/views.py:556 #: counter/templates/counter/invoices_call.jinja:4 counter/views.py:556
msgid "Invoices call" msgid "Invoices call"
msgstr "Appels à facture" msgstr "Appels à facture"
#: core/templates/core/user_tools.jinja:40 core/views/user.py:204 #: core/templates/core/user_tools.jinja:41 core/views/user.py:204
#: counter/templates/counter/counter_list.jinja:18 #: counter/templates/counter/counter_list.jinja:18
#: counter/templates/counter/counter_list.jinja:33 #: counter/templates/counter/counter_list.jinja:33
#: counter/templates/counter/counter_list.jinja:54 #: counter/templates/counter/counter_list.jinja:54
msgid "Stats" msgid "Stats"
msgstr "Stats" msgstr "Stats"
#: core/templates/core/user_tools.jinja:44 #: core/templates/core/user_tools.jinja:45
#: counter/templates/counter/counter_list.jinja:37 #: counter/templates/counter/counter_list.jinja:37
#: stock/templates/stock/stock_item_list.jinja:11 #: stock/templates/stock/stock_item_list.jinja:11
#: stock/templates/stock/stock_list.jinja:16 #: stock/templates/stock/stock_list.jinja:16
msgid "Shopping lists" msgid "Shopping lists"
msgstr "Liste de courses" msgstr "Liste de courses"
#: core/templates/core/user_tools.jinja:46 #: core/templates/core/user_tools.jinja:47
#: counter/templates/counter/counter_list.jinja:39 #: counter/templates/counter/counter_list.jinja:39
msgid "Create new stock" msgid "Create new stock"
msgstr "Créer nouveau stock" msgstr "Créer nouveau stock"
#: core/templates/core/user_tools.jinja:57 #: core/templates/core/user_tools.jinja:58
msgid "Refound Account" msgid "Refound Account"
msgstr "Rembourser un compte" msgstr "Rembourser un compte"
#: core/templates/core/user_tools.jinja:58 #: core/templates/core/user_tools.jinja:59
msgid "General accounting" msgid "General accounting"
msgstr "Comptabilité générale" msgstr "Comptabilité générale"
#: core/templates/core/user_tools.jinja:68 #: core/templates/core/user_tools.jinja:69
msgid "Club account: " msgid "Club account: "
msgstr "Compte club : " msgstr "Compte club : "
#: core/templates/core/user_tools.jinja:75 #: core/templates/core/user_tools.jinja:76
msgid "Communication" msgid "Communication"
msgstr "Communication" msgstr "Communication"
#: core/templates/core/user_tools.jinja:78 #: core/templates/core/user_tools.jinja:79
msgid "Create weekmail article" msgid "Create weekmail article"
msgstr "Rédiger un nouvel article dans le Weekmail" msgstr "Rédiger un nouvel article dans le Weekmail"
#: core/templates/core/user_tools.jinja:82 #: core/templates/core/user_tools.jinja:83
msgid "Moderate news" msgid "Moderate news"
msgstr "Modérer les nouvelles" msgstr "Modérer les nouvelles"
#: core/templates/core/user_tools.jinja:83 #: core/templates/core/user_tools.jinja:84
msgid "Edit index page" msgid "Edit index page"
msgstr "Éditer la page d'accueil" msgstr "Éditer la page d'accueil"
#: core/templates/core/user_tools.jinja:84 #: core/templates/core/user_tools.jinja:85
msgid "Edit alert message" msgid "Edit alert message"
msgstr "Éditer le message d'alerte" msgstr "Éditer le message d'alerte"
#: core/templates/core/user_tools.jinja:85 #: core/templates/core/user_tools.jinja:86
msgid "Edit information message" msgid "Edit information message"
msgstr "Éditer le message d'informations" msgstr "Éditer le message d'informations"
#: core/templates/core/user_tools.jinja:86 #: core/templates/core/user_tools.jinja:87
msgid "Moderate files" msgid "Moderate files"
msgstr "Modérer les fichiers" msgstr "Modérer les fichiers"
#: core/templates/core/user_tools.jinja:89 #: core/templates/core/user_tools.jinja:90
msgid "Moderate pictures" msgid "Moderate pictures"
msgstr "Modérer les photos" msgstr "Modérer les photos"
#: core/templates/core/user_tools.jinja:102 #: core/templates/core/user_tools.jinja:103
msgid "Elections" msgid "Elections"
msgstr "Élections" msgstr "Élections"
#: core/templates/core/user_tools.jinja:104 #: core/templates/core/user_tools.jinja:105
msgid "See available elections" msgid "See available elections"
msgstr "Voir les élections disponibles" msgstr "Voir les élections disponibles"
#: core/templates/core/user_tools.jinja:106 #: core/templates/core/user_tools.jinja:107
msgid "Create a new election" msgid "Create a new election"
msgstr "Créer une nouvelle élection" msgstr "Créer une nouvelle élection"
#: core/templates/core/user_tools.jinja:109 #: core/templates/core/user_tools.jinja:110
msgid "Other tools" msgid "Other tools"
msgstr "Autres outils" msgstr "Autres outils"
#: core/templates/core/user_tools.jinja:111 #: core/templates/core/user_tools.jinja:112
msgid "Convert dokuwiki/BBcode syntax to Markdown" msgid "Convert dokuwiki/BBcode syntax to Markdown"
msgstr "Convertir de la syntaxe dokuwiki/BBcode vers Markdown" msgstr "Convertir de la syntaxe dokuwiki/BBcode vers Markdown"
#: core/templates/core/user_tools.jinja:112 #: core/templates/core/user_tools.jinja:113
msgid "Trombi tools" msgid "Trombi tools"
msgstr "Outils Trombi" msgstr "Outils Trombi"
@ -3073,6 +3079,7 @@ msgstr "Pas de date de naissance renseignée"
#: launderette/templates/launderette/launderette_admin.jinja:35 #: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:13 #: launderette/templates/launderette/launderette_click.jinja:13
#: sas/templates/sas/picture.jinja:82 #: sas/templates/sas/picture.jinja:82
#: subscription/templates/subscription/stats.jinja:14
msgid "Go" msgid "Go"
msgstr "Valider" msgstr "Valider"
@ -4362,20 +4369,16 @@ msgstr "Vous ne pouvez pas cotiser plusieurs fois pour la même période"
msgid "Subscription error" msgid "Subscription error"
msgstr "Erreur de cotisation" msgstr "Erreur de cotisation"
#: subscription/templates/subscription/stats.jinja:4 #: subscription/templates/subscription/stats.jinja:18
msgid "Subscription stats"
msgstr "Statistiques de cotisation"
#: subscription/templates/subscription/stats.jinja:9
msgid "Total subscriptions" msgid "Total subscriptions"
msgstr "Cotisations totales" msgstr "Cotisations totales"
#: subscription/templates/subscription/stats.jinja:10 #: subscription/templates/subscription/stats.jinja:19
msgid "Subscriptions by type" msgid "Subscriptions by type"
msgstr "Cotisations par type" msgstr "Cotisations par type"
#: subscription/templates/subscription/stats.jinja:19 #: subscription/templates/subscription/stats.jinja:29
msgid "Subscripton type" msgid "Subscription type"
msgstr "Type de cotisation" msgstr "Type de cotisation"
#: subscription/templates/subscription/subscription.jinja:22 #: subscription/templates/subscription/subscription.jinja:22
@ -4383,11 +4386,11 @@ msgid "Eboutic is reserved to specific users. In doubt, don't use it."
msgstr "" msgstr ""
"Eboutic est réservé à des cas particuliers. Dans le doute, ne l'utilisez pas." "Eboutic est réservé à des cas particuliers. Dans le doute, ne l'utilisez pas."
#: subscription/views.py:75 #: subscription/views.py:86
msgid "A user with that email address already exists" msgid "A user with that email address already exists"
msgstr "Un utilisateur avec cette adresse email existe déjà" msgstr "Un utilisateur avec cette adresse email existe déjà"
#: subscription/views.py:91 #: subscription/views.py:102
msgid "You must either choose an existing user or create a new one properly" msgid "You must either choose an existing user or create a new one properly"
msgstr "" msgstr ""
"Vous devez soit choisir un utilisateur existant, soit en créer un proprement" "Vous devez soit choisir un utilisateur existant, soit en créer un proprement"

View File

@ -6,17 +6,27 @@
{% block content %} {% block content %}
{% trans %}Total subscriptions{% endtrans %} : {{ subscriptions_total.count() }}<br><br> <p>
{% trans %}Subscriptions by type{% endtrans %}<br><br> {{ form.start_date.label }}<br>
{% for location in locations %} {{ form.start_date }}<br><br>
{{ location[1] }} {{ subscriptions_total.filter(location=location[0]).count() }}<br> {{ form.end_date.label }}<br>
{% endfor %} {{ form.end_date }}<br>
<p><input type="submit" value="{% trans %}Go{% endtrans %}" /></p>
</p>
<p>
{% trans %}Total subscriptions{% endtrans %} : {{ subscriptions_total.count() }}<br><br>
{% trans %}Subscriptions by type{% endtrans %}<br><br>
{% for location in locations %}
{{ location[1] }} : {{ subscriptions_total.filter(location=location[0]).count() }}<br>
{% endfor %}
<p>
<br> <br>
<table> <table>
<tr> <tr>
<th>{% trans %}Subscripton type{% endtrans %}</th> <th>{% trans %}Subscription type{% endtrans %}</th>
{% for location in locations %} {% for location in locations %}
<th>{{ location[1] }}</th> <th>{{ location[1] }}</th>
{% endfor %} {% endfor %}
@ -24,15 +34,17 @@
{% for type in subscriptions_types %} {% for type in subscriptions_types %}
<tr> <tr>
<td>{{ subscriptions_types[type]['name'] }}</td> <td>{{ subscriptions_types[type]['name'] }}</td>
{% set subscriptions_total_type = subscriptions_total.filter(subscription_type=type) %}
{% for location in locations %} {% for location in locations %}
<td> <td>
{% trans %}Total{% endtrans %} : {{ subscriptions_total.filter(subscription_type=type, location=location[0]).count()}}<br> {% set subscriptions_total_type_location = subscriptions_total_type.filter(location=location[0]) %}
{% trans %}Total{% endtrans %} : {{ subscriptions_total_type_location.count()}}<br>
{% for p_type in payment_types %} {% for p_type in payment_types %}
{{ p_type[1] }} : {{ subscriptions_total.filter(subscription_type=type, location=location[0], payment_method=p_type[0]).count()}}<br> {{ p_type[1] }} : {{ subscriptions_total_type_location.filter(payment_method=p_type[0]).count()}}<br>
{% endfor %} {% endfor %}
</td> </td>
{% endfor %} {% endfor %}
<td>{{subscriptions_total.filter(subscription_type=type).count()}} <td>{{subscriptions_total_type.count()}}
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View File

@ -22,12 +22,10 @@
# #
# #
from django.shortcuts import render from django.views.generic.edit import CreateView, FormView
from django.views.generic.edit import UpdateView, CreateView
from django.views.generic.base import View
from django.views.generic import TemplateView
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import PermissionDenied, ValidationError from django.core.exceptions import PermissionDenied, ValidationError
from django.core.urlresolvers import reverse_lazy
from django.db import IntegrityError from django.db import IntegrityError
from django import forms from django import forms
from django.forms import Select from django.forms import Select
@ -38,8 +36,21 @@ import random
from subscription.models import Subscription from subscription.models import Subscription
from core.views import CanEditMixin, CanEditPropMixin, CanViewMixin from core.views import CanEditMixin, CanEditPropMixin, CanViewMixin
from core.views.forms import SelectDateTime
from core.models import User from core.models import User
class SelectionDateForm(forms.Form):
def __init__(self, *args, **kwargs):
super(SelectionDateForm, self).__init__(*args, **kwargs)
self.fields['start_date'] = forms.DateTimeField(
['%Y-%m-%d %H:%M:%S'], label=_("Start date"),
widget=SelectDateTime, required=True)
self.fields['end_date'] = forms.DateTimeField(
['%Y-%m-%d %H:%M:%S'], label=_("End date"),
widget=SelectDateTime, required=True)
class SubscriptionForm(forms.ModelForm): class SubscriptionForm(forms.ModelForm):
class Meta: class Meta:
model = Subscription model = Subscription
@ -116,21 +127,47 @@ class NewSubscription(CreateView):
return super(NewSubscription, self).form_valid(form) return super(NewSubscription, self).form_valid(form)
class SubscriptionsStatsView(TemplateView): class SubscriptionsStatsView(FormView):
template_name = "subscription/stats.jinja" template_name = "subscription/stats.jinja"
form_class = SelectionDateForm
def dispatch(self, request, *arg, **kwargs): def dispatch(self, request, *arg, **kwargs):
res = super(SubscriptionsStatsView, self).dispatch(request, *arg, **kwargs) import datetime
self.start_date = datetime.datetime.today()
self.end_date = self.start_date
res = super(SubscriptionsStatsView, self).dispatch(
request, *arg, **kwargs)
if request.user.is_root or request.user.is_board_member: if request.user.is_root or request.user.is_board_member:
return res return res
raise PermissionDenied raise PermissionDenied
def post(self, request, *args, **kwargs):
self.form = self.get_form()
self.start_date = self.form['start_date']
self.end_date = self.form['end_date']
res = super(SubscriptionsStatsView, self).post(
request, *args, **kwargs)
if request.user.is_root or request.user.is_board_member:
return res
raise PermissionDenied
def get_initial(self):
init = {
'start_date': self.start_date.strftime('%Y-%m-%d %H:%M:%S'),
'end_date': self.end_date.strftime('%Y-%m-%d %H:%M:%S')
}
return init
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
from subscription.models import Subscription from subscription.models import Subscription
import datetime
kwargs = super(SubscriptionsStatsView, self).get_context_data(**kwargs) kwargs = super(SubscriptionsStatsView, self).get_context_data(**kwargs)
kwargs['subscriptions_total'] = Subscription.objects.filter(subscription_end__gte=datetime.datetime.today()) kwargs['subscriptions_total'] = Subscription.objects.filter(
subscription_end__gte=self.end_date,
subscription_start__lte=self.start_date)
kwargs['subscriptions_types'] = settings.SITH_SUBSCRIPTIONS kwargs['subscriptions_types'] = settings.SITH_SUBSCRIPTIONS
kwargs['payment_types'] = settings.SITH_COUNTER_PAYMENT_METHOD kwargs['payment_types'] = settings.SITH_COUNTER_PAYMENT_METHOD
kwargs['locations'] = settings.SITH_SUBSCRIPTION_LOCATIONS kwargs['locations'] = settings.SITH_SUBSCRIPTION_LOCATIONS
return kwargs return kwargs
def get_success_url(self, **kwargs):
return reverse_lazy('subscriptions:stats')