Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
e97135bf
Commit
e97135bf
authored
Jun 02, 2017
by
Sli
Browse files
Add subscriptions stats
parent
e7f7c575
Changes
6
Hide whitespace changes
Inline
Side-by-side
locale/fr/LC_MESSAGES/django.po
View file @
e97135bf
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2017-0
5-31 23:42
+0200
\n
"
"POT-Creation-Date: 2017-0
6-02 14:55
+0200
\n
"
"PO-Revision-Date: 2016-07-18
\n
"
"Last-Translator: Skia <skia@libskia.so>
\n
"
"Language-Team: AE info <ae.info@utbm.fr>
\n
"
...
...
@@ -326,8 +326,8 @@ msgstr "Compte en banque : "
#: core/templates/core/file_detail.jinja:25
#: core/templates/core/file_detail.jinja:62
#: core/templates/core/file_moderation.jinja:24
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:
49
#: core/templates/core/macros.jinja:
68
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:
53
#: core/templates/core/macros.jinja:
72
#: core/templates/core/pagerev_edit.jinja:28
#: core/templates/core/user_account_detail.jinja:38
#: core/templates/core/user_edit.jinja:19
...
...
@@ -335,12 +335,11 @@ msgstr "Compte en banque : "
#: counter/templates/counter/last_ops.jinja:59
#: election/templates/election/election_detail.jinja:280
#: election/templates/election/election_detail.jinja:329
#: forum/templates/forum/macros.jinja:21
#: forum/templates/forum/macros.jinja:123
#: forum/templates/forum/macros.jinja:21 forum/templates/forum/macros.jinja:123
#: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:178 sas/templates/sas/album.jinja:26
#: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:74
#: sas/templates/sas/picture.jinja:124
#: sas/templates/sas/picture.jinja
.py
:124
#: stock/templates/stock/stock_shopping_list.jinja:43
#: stock/templates/stock/stock_shopping_list.jinja:69
#: trombi/templates/trombi/detail.jinja:28
...
...
@@ -491,8 +490,8 @@ msgstr "Non"
#: accounting/templates/accounting/club_account_details.jinja:56
#: com/templates/com/news_admin_list.jinja:38
#: com/templates/com/news_admin_list.jinja:71
#:
core/templates/core/file.jinja:36
core/templates/core/page.jinja:28
#: com/templates/com/news_admin_list.jinja:71
core/templates/core/file.jinja:36
#: core/templates/core/page.jinja:28
msgid
"View"
msgstr
"Voir"
...
...
@@ -696,7 +695,7 @@ msgstr "Opération liée : "
#: core/templates/core/user_preferences.jinja:12
#: core/templates/core/user_preferences.jinja:19
#: counter/templates/counter/cash_register_summary.jinja:22
#: forum/templates/forum/reply.jinja:3
1
#: forum/templates/forum/reply.jinja:3
2
#: subscription/templates/subscription/subscription.jinja:24
#: trombi/templates/trombi/comment.jinja:26
#: trombi/templates/trombi/user_tools.jinja:13
...
...
@@ -859,8 +858,7 @@ msgstr "L'utilisateur est déjà membre de ce club"
msgid
"past member"
msgstr
"Anciens membres"
#: club/templates/club/club_list.jinja:4
#: club/templates/club/club_list.jinja:24
#: club/templates/club/club_list.jinja:4 club/templates/club/club_list.jinja:24
msgid
"Club list"
msgstr
"Liste des clubs"
...
...
@@ -922,14 +920,13 @@ msgstr "Du"
msgid
"To"
msgstr
"Au"
#: club/templates/club/club_sellings.jinja:5 club/views.py:84
#:
club/views.py:247
counter/templates/counter/counter_main.jinja:19
#: club/templates/club/club_sellings.jinja:5 club/views.py:84
club/views.py:247
#: counter/templates/counter/counter_main.jinja:19
#: counter/templates/counter/last_ops.jinja:35
msgid
"Sellings"
msgstr
"Ventes"
#: club/templates/club/club_sellings.jinja:9
#: club/templates/club/stats.jinja:19
#: club/templates/club/club_sellings.jinja:9 club/templates/club/stats.jinja:19
#: counter/templates/counter/cash_summary_list.jinja:15
msgid
"Show"
msgstr
"Montrer"
...
...
@@ -985,6 +982,7 @@ msgstr "Quantité"
#: counter/templates/counter/cash_summary_list.jinja:35
#: counter/templates/counter/last_ops.jinja:44
#: counter/templates/counter/stats.jinja:18
#: subscription/templates/subscription/stats.jinja:28
msgid
"Total"
msgstr
"Total"
...
...
@@ -1187,9 +1185,8 @@ msgid "News admin"
msgstr
"Administration des nouvelles"
#: com/templates/com/news_admin_list.jinja:9
#: com/templates/com/news_detail.jinja:5
#: com/templates/com/news_detail.jinja:11 com/templates/com/news_list.jinja:4
#: com/templates/com/news_list.jinja:28
#: com/templates/com/news_detail.jinja:5 com/templates/com/news_detail.jinja:11
#: com/templates/com/news_list.jinja:4 com/templates/com/news_list.jinja:28
msgid
"News"
msgstr
"Nouvelles"
...
...
@@ -1294,7 +1291,7 @@ msgstr ""
#: com/templates/com/news_edit.jinja:55 com/templates/com/weekmail.jinja:10
#: core/templates/core/pagerev_edit.jinja:25
#: forum/templates/forum/reply.jinja:3
0
#: forum/templates/forum/reply.jinja:3
1
msgid
"Preview"
msgstr
"Prévisualiser"
...
...
@@ -1677,13 +1674,13 @@ msgstr "profil visible par les cotisants"
msgid
"A user with that username already exists"
msgstr
"Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/models.py:474 core/templates/core/macros.jinja:1
7
#: core/models.py:474 core/templates/core/macros.jinja:
2
1
#: core/templates/core/user_detail.jinja:14
#: core/templates/core/user_detail.jinja:16
#: core/templates/core/user_edit.jinja:17
#: election/templates/election/election_detail.jinja:316
#: forum/templates/forum/macros.jinja:93 forum/templates/forum/macros.jinja:95
#: forum/templates/forum/reply.jinja:3
6
forum/templates/forum/reply.jinja:3
8
#: forum/templates/forum/reply.jinja:3
7
forum/templates/forum/reply.jinja:3
9
#: trombi/templates/trombi/user_tools.jinja:43
msgid
"Profile"
msgstr
"Profil"
...
...
@@ -1875,8 +1872,7 @@ msgstr "S'enregister"
msgid
"View more"
msgstr
"Voir plus"
#: core/templates/core/base.jinja:62
#: forum/templates/forum/last_unread.jinja:16
#: core/templates/core/base.jinja:62 forum/templates/forum/last_unread.jinja:16
msgid
"Mark all as read"
msgstr
"Marquer tout commme lu"
...
...
@@ -1908,7 +1904,7 @@ msgstr "SAS"
#: core/templates/core/base.jinja:94 forum/templates/forum/forum.jinja:10
#: forum/templates/forum/last_unread.jinja:13
#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja:11
#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja
.py
:11
#: forum/templates/forum/main.jinja:14 forum/templates/forum/reply.jinja:15
#: forum/templates/forum/topic.jinja:30
msgid
"Forum"
...
...
@@ -2122,30 +2118,28 @@ msgstr "login"
msgid
"Lost password?"
msgstr
"Mot de passe perdu ?"
#: core/templates/core/macros.jinja:27
#: core/templates/core/user_detail.jinja:27
#: core/templates/core/macros.jinja:31 core/templates/core/user_detail.jinja:27
msgid
"Born: "
msgstr
"Né le : "
#: core/templates/core/macros.jinja:31
#: core/templates/core/user_detail.jinja:48
#: core/templates/core/macros.jinja:35 core/templates/core/user_detail.jinja:48
msgid
"Promo: "
msgstr
"Promo : "
#: core/templates/core/macros.jinja:
38
#: core/templates/core/macros.jinja:
42
#, python-format
msgid
"Subscribed until %(subscription_end)s"
msgstr
"Cotisant jusqu'au %(subscription_end)s"
#: core/templates/core/macros.jinja:3
9
core/templates/core/user_edit.jinja:40
#: core/templates/core/macros.jinja:
4
3 core/templates/core/user_edit.jinja:40
msgid
"Account number: "
msgstr
"Numero de compte : "
#: core/templates/core/macros.jinja:4
4
launderette/models.py:151
#: core/templates/core/macros.jinja:4
8
launderette/models.py:151
msgid
"Slot"
msgstr
"Créneau"
#: core/templates/core/macros.jinja:
57
#: core/templates/core/macros.jinja:
61
#: launderette/templates/launderette/launderette_admin.jinja:20
msgid
"Tokens"
msgstr
"Jetons"
...
...
@@ -3661,7 +3655,7 @@ msgid "New forum"
msgstr
"Nouveau forum"
#: forum/templates/forum/forum.jinja:22 forum/templates/forum/reply.jinja:8
#: forum/templates/forum/reply.jinja:2
5
#: forum/templates/forum/reply.jinja:2
6
msgid
"New topic"
msgstr
"Nouveau sujet"
...
...
@@ -3707,7 +3701,7 @@ msgstr "Message supprimé ou non-visible."
msgid
"View last unread messages"
msgstr
"Voir les derniers messages non lus"
#: forum/templates/forum/reply.jinja:6 forum/templates/forum/reply.jinja:2
3
#: forum/templates/forum/reply.jinja:6 forum/templates/forum/reply.jinja:2
4
#: forum/templates/forum/topic.jinja:40 forum/templates/forum/topic.jinja:59
msgid
"Reply"
msgstr
"Répondre"
...
...
@@ -3841,11 +3835,11 @@ msgstr "Fusionner deux utilisateurs"
msgid
"Merge"
msgstr
"Fusion"
#: rootplace/views.py:
8
9
#: rootplace/views.py:9
0
msgid
"User that will be kept"
msgstr
"Utilisateur qui sera conservé"
#: rootplace/views.py:9
0
#: rootplace/views.py:9
1
msgid
"User that will be deleted"
msgstr
"Utilisateur qui sera supprimé"
...
...
@@ -4368,16 +4362,32 @@ msgstr "Vous ne pouvez pas cotiser plusieurs fois pour la même période"
msgid
"Subscription error"
msgstr
"Erreur de cotisation"
#: subscription/templates/subscription/stats.jinja:4
msgid
"Subscription stats"
msgstr
"Statistiques de cotisation"
#: subscription/templates/subscription/stats.jinja:9
msgid
"Total subscriptions"
msgstr
"Cotisations totales"
#: subscription/templates/subscription/stats.jinja:10
msgid
"Subscriptions by type"
msgstr
"Cotisations par type"
#: subscription/templates/subscription/stats.jinja:19
msgid
"Subscripton type"
msgstr
"Type de cotisation"
#: subscription/templates/subscription/subscription.jinja:22
msgid
"Eboutic is reserved to specific users. In doubt, don't use it."
msgstr
""
"Eboutic est réservé à des cas particuliers. Dans le doute, ne l'utilisez pas."
#: subscription/views.py:7
4
#: subscription/views.py:7
5
msgid
"A user with that email address already exists"
msgstr
"Un utilisateur avec cette adresse email existe déjà"
#: subscription/views.py:9
0
#: subscription/views.py:9
1
msgid
"You must either choose an existing user or create a new one properly"
msgstr
""
"Vous devez soit choisir un utilisateur existant, soit en créer un proprement"
...
...
@@ -4613,4 +4623,3 @@ msgstr "Vous ne pouvez plus écrire de commentaires, la date est passée."
#, python-format
msgid
"Maximum characters: %(max_length)s"
msgstr
"Nombre de caractères max: %(max_length)s"
rootplace/urls.py
View file @
e97135bf
...
...
@@ -22,13 +22,10 @@
#
#
from
django.conf.urls
import
url
,
include
from
django.conf.urls
import
url
from
rootplace.views
import
*
urlpatterns
=
[
url
(
r
'^merge$'
,
MergeUsersView
.
as_view
(),
name
=
'merge'
),
]
rootplace/views.py
View file @
e97135bf
...
...
@@ -31,6 +31,7 @@ from django.core.exceptions import PermissionDenied
from
ajax_select.fields
import
AutoCompleteSelectField
from
core.views
import
CanViewMixin
from
core.models
import
User
from
counter.models
import
Customer
...
...
subscription/templates/subscription/stats.jinja
0 → 100644
View file @
e97135bf
{%
extends
"core/base.jinja"
%}
{%
block
title
%}
{%
trans
%}
Subscription stats
{%
endtrans
%}
{%
endblock
%}
{%
block
content
%}
{%
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
%}
<br>
<table>
<tr>
<th>
{%
trans
%}
Subscripton type
{%
endtrans
%}
</th>
{%
for
location
in
locations
%}
<th>
{{
location
[
1
]
}}
</th>
{%
endfor
%}
{%
for
type
in
subscriptions_types
%}
<tr>
<td>
{{
subscriptions_types
[
type
][
'name'
]
}}
</td>
{%
for
location
in
locations
%}
<td>
{%
trans
%}
Total
{%
endtrans
%}
:
{{
subscriptions_total.filter
(
location
=
location
[
0
])
.
count
()
}}
<br>
{%
for
p_type
in
payment_types
%}
{{
p_type
[
1
]
}}
:
{{
subscriptions_total.filter
(
location
=
location
[
0
],
payment_method
=
p_type
[
0
])
.
count
()
}}
<br>
{%
endfor
%}
</td>
{%
endfor
%}
</tr>
{%
endfor
%}
</table>
{%
endblock
%}
subscription/urls.py
View file @
e97135bf
...
...
@@ -22,13 +22,14 @@
#
#
from
django.conf.urls
import
url
,
include
from
django.conf.urls
import
url
from
subscription.views
import
*
urlpatterns
=
[
# Subscription views
url
(
r
'^$'
,
NewSubscription
.
as_view
(),
name
=
'subscription'
),
url
(
r
'stats'
,
SubscriptionsStatsView
.
as_view
(),
name
=
'stats'
),
]
...
...
subscription/views.py
View file @
e97135bf
...
...
@@ -25,6 +25,7 @@
from
django.shortcuts
import
render
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.core.exceptions
import
PermissionDenied
,
ValidationError
from
django.db
import
IntegrityError
...
...
@@ -114,3 +115,22 @@ class NewSubscription(CreateView):
)
return
super
(
NewSubscription
,
self
).
form_valid
(
form
)
class
SubscriptionsStatsView
(
TemplateView
):
template_name
=
"subscription/stats.jinja"
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
res
=
super
(
SubscriptionsStatsView
,
self
).
dispatch
(
request
,
*
arg
,
**
kwargs
)
if
request
.
user
.
is_root
or
request
.
user
.
is_board_member
:
return
res
raise
PermissionDenied
def
get_context_data
(
self
,
**
kwargs
):
from
subscription.models
import
Subscription
import
datetime
kwargs
=
super
(
SubscriptionsStatsView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'subscriptions_total'
]
=
Subscription
.
objects
.
filter
(
subscription_end__gte
=
datetime
.
datetime
.
today
())
kwargs
[
'subscriptions_types'
]
=
settings
.
SITH_SUBSCRIPTIONS
kwargs
[
'payment_types'
]
=
settings
.
SITH_COUNTER_PAYMENT_METHOD
kwargs
[
'locations'
]
=
settings
.
SITH_SUBSCRIPTION_LOCATIONS
return
kwargs
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment