1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Merge branch 'master' into 'app_member'

# Conflicts:
#   apps/member/views.py
This commit is contained in:
Pierre-antoine Comby 2019-08-15 19:53:40 +00:00
commit cc41409f5e
34 changed files with 741 additions and 566 deletions

View File

@ -3,7 +3,6 @@ source =
activity
member
note
theme
omit =
activity/tests/*.py
activity/migrations/*.py
@ -11,4 +10,3 @@ omit =
member/migrations/*.py
note/tests/*.py
note/migrations/*.py
theme/tests/*.py

View File

@ -45,6 +45,7 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n
Sinon:
$ sudo ln -s /var/www/note_kfet/uwsgi_note.ini /etc/uwsgi/apps-enabled/
5. Base de données
Pour le moment c'est du sqllite, pas de config particulière.
@ -53,6 +54,26 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n
Il est tout a fait possible de travailler en local, vive `./manage.py runserver` !
1. Cloner le dépot là ou vous voulez:
$ git@gitlab.crans.org:bde/nk20.git
2. Environnement Virtuel
$ virtualenv env
$ source /env/bin/activate
(env)$ pip install -r requirements.txt
3. Migrations:
(env)$ ./manage.py makemigrations
(env)$ ./manage.py migrate
4. Enjoy:
(env)$ ./manage.py runserver
## Cahier des Charges
Il est disponible [ici](https://wiki.crans.org/NoteKfet/NoteKfet2018/CdC).

View File

@ -1,74 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-16 13:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: apps.py:11 models.py:61
msgid "activity"
msgstr "activité"
#: models.py:12 models.py:29
msgid "name"
msgstr "nom"
#: models.py:16
msgid "can invite"
msgstr "peut inviter"
#: models.py:19
msgid "guest entry fee"
msgstr "cotisation de l'entrée invité"
#: models.py:23
msgid "activity type"
msgstr "type d'activité"
#: models.py:24
msgid "activity types"
msgstr "types d'activité"
#: models.py:33
msgid "description"
msgstr "description"
#: models.py:39
msgid "type"
msgstr "type"
#: models.py:45
msgid "organizer"
msgstr "organisateur"
#: models.py:51
msgid "attendees club"
msgstr ""
#: models.py:54
msgid "start date"
msgstr "date de début"
#: models.py:57
msgid "end date"
msgstr "date de fin"
#: models.py:62
msgid "activities"
msgstr "activités"
#: models.py:88
msgid "guest"
msgstr "invité"
#: models.py:89
msgid "guests"
msgstr "invités"

View File

@ -1,116 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-16 15:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: apps.py:11
msgid "member"
msgstr "adhérent"
#: models.py:24
msgid "phone number"
msgstr "numéro de téléphone"
#: models.py:30
msgid "section"
msgstr "section"
#: models.py:31
msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
msgstr "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
#: models.py:37
msgid "address"
msgstr "adresse"
#: models.py:43
msgid "paid"
msgstr "payé"
#: models.py:48 models.py:49
msgid "user profile"
msgstr "profil utilisateur"
#: models.py:57 models.py:102
msgid "name"
msgstr "nom"
#: models.py:62
msgid "email"
msgstr "courriel"
#: models.py:67
msgid "membership fee"
msgstr "cotisation pour adhérer"
#: models.py:71
msgid "membership duration"
msgstr "durée de l'adhésion"
#: models.py:72
msgid "The longest time a membership can last (NULL = infinite)."
msgstr "La durée maximale d'une adhésion (NULL = infinie)."
#: models.py:77
msgid "membership start"
msgstr "début de l'adhésion"
#: models.py:78
msgid "How long after January 1st the members can renew their membership."
msgstr ""
#: models.py:83
msgid "membership end"
msgstr "fin de l'adhésion"
#: models.py:84
msgid ""
"How long the membership can last after January 1st of the next year after "
"members can renew their membership."
msgstr ""
#: models.py:90
msgid "club"
msgstr "club"
#: models.py:91
msgid "clubs"
msgstr "clubs"
#: models.py:108
msgid "role"
msgstr "rôle"
#: models.py:109
msgid "roles"
msgstr "rôles"
#: models.py:126
msgid "membership starts on"
msgstr "l'adhésion commence le"
#: models.py:129
msgid "membership ends on"
msgstr "l'adhésion finie le"
#: models.py:133
msgid "fee"
msgstr "cotisation"
#: models.py:137
msgid "membership"
msgstr "adhésion"
#: models.py:138
msgid "memberships"
msgstr "adhésions"

View File

@ -45,10 +45,17 @@ class UserCreateView(CreateView):
return super().form_valid(form)
class UserDetailView(LoginRequiredMixin,DetailView):
model = Profile
def get_context_data(slef,**kwargs):
context = super().get_context_data(**kwargs)
user = context['object'].user.note
user_transactions = \
Transaction.objects.all().filter(Q(source=user) | Q(destination=user))
context['history_list'] = user_transactions
return context
class ClubCreateView(LoginRequiredMixin,CreateView):
"""

View File

@ -1,192 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-24 22:37+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: admin.py:112 models/transactions.py:46
msgid "source"
msgstr "source"
#: admin.py:120 admin.py:148 models/transactions.py:25
#: models/transactions.py:52
msgid "destination"
msgstr "destination"
#: apps.py:15 models/notes.py:47
msgid "note"
msgstr "note"
#: models/notes.py:24
msgid "account balance"
msgstr "solde du compte"
#: models/notes.py:25
msgid "in centimes, money credited for this instance"
msgstr "en centimes, argent crédité pour cette instance"
#: models/notes.py:29
msgid "active"
msgstr "actif"
#: models/notes.py:32
msgid ""
"Designates whether this note should be treated as active. Unselect this "
"instead of deleting notes."
msgstr ""
"Indique si la note est active. Désactiver cela plutôt que supprimer la note."
#: models/notes.py:37
msgid "display image"
msgstr "image affichée"
#: models/notes.py:42 models/transactions.py:55
msgid "created at"
msgstr "créée le"
#: models/notes.py:48
msgid "notes"
msgstr "notes"
#: models/notes.py:56
msgid "Note"
msgstr "Note"
#: models/notes.py:66 models/notes.py:88
msgid "This alias is already taken."
msgstr "Cet alias est déjà pris."
#: models/notes.py:103
msgid "user"
msgstr "utilisateur"
#: models/notes.py:107
msgid "one's note"
msgstr "note d'un utilisateur"
#: models/notes.py:108
msgid "users note"
msgstr "notes des utilisateurs"
#: models/notes.py:114
#, python-format
msgid "%(user)s's note"
msgstr "Note de %(user)s"
#: models/notes.py:125
msgid "club"
msgstr "club"
#: models/notes.py:129
msgid "club note"
msgstr "note d'un club"
#: models/notes.py:130
msgid "clubs notes"
msgstr "notes des clubs"
#: models/notes.py:136
#, python-format
msgid "Note for %(club)s club"
msgstr "Note du club %(club)s"
#: models/notes.py:149 models/transactions.py:32 models/transactions.py:66
msgid "type"
msgstr "type"
#: models/notes.py:155
msgid "special note"
msgstr "note spéciale"
#: models/notes.py:156
msgid "special notes"
msgstr "notes spéciales"
#: models/notes.py:167 models/transactions.py:18
msgid "name"
msgstr "nom"
#: models/notes.py:173
msgid "Invalid alias"
msgstr "Alias invalide"
#: models/notes.py:189
msgid "alias"
msgstr "alias"
#: models/notes.py:190
msgid "aliases"
msgstr "alias"
#: models/notes.py:218
msgid "Alias too long."
msgstr "L'alias est trop long."
#: models/notes.py:221
msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà."
#: models/transactions.py:28 models/transactions.py:63
msgid "amount"
msgstr "montant"
#: models/transactions.py:29
msgid "in centimes"
msgstr "en centimes"
#: models/transactions.py:37
msgid "transaction template"
msgstr "modèle de transaction"
#: models/transactions.py:38
msgid "transaction templates"
msgstr "modèles de transaction"
#: models/transactions.py:59
msgid "quantity"
msgstr "quantité"
#: models/transactions.py:70
msgid "reason"
msgstr "raison"
#: models/transactions.py:74
msgid "valid"
msgstr "valide"
#: models/transactions.py:79
msgid "transaction"
msgstr "transaction"
#: models/transactions.py:80
msgid "transactions"
msgstr "transactions"
#: models/transactions.py:116
msgid "membership transaction"
msgstr "transaction d'adhésion"
#: models/transactions.py:117
msgid "membership transactions"
msgstr "transactions d'adhésion"
#: templates/note/transaction_form.html:10
msgid "Home"
msgstr "Accueil"
#: templates/note/transaction_form.html:53
msgid "Transfer"
msgstr "Virement"
#: views.py:26
msgid "Transfer money from your account to one or others"
msgstr "Transfert d'argent de ton compte vers un ou plusieurs autres"

View File

View File

@ -0,0 +1,12 @@
from django import template
def pretty_money(value):
if value%100 == 0:
return str(value//100) + ''
else:
return str(value//100) + '' + str(value%100)
register = template.Library()
register.filter('pretty_money', pretty_money)

View File

@ -0,0 +1,448 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-14 15:14+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: apps/activity/apps.py:11 apps/activity/models.py:70
msgid "activity"
msgstr "activité"
#: apps/activity/models.py:15 apps/activity/models.py:38
#: apps/member/models.py:59 apps/member/models.py:107
#: apps/note/models/notes.py:167 apps/note/models/transactions.py:19
#: templates/member/profile_detail.html:10
msgid "name"
msgstr "nom"
#: apps/activity/models.py:19
msgid "can invite"
msgstr "peut inviter"
#: apps/activity/models.py:22
msgid "guest entry fee"
msgstr "cotisation de l'entrée invité"
#: apps/activity/models.py:26
msgid "activity type"
msgstr "type d'activité"
#: apps/activity/models.py:27
msgid "activity types"
msgstr "types d'activité"
#: apps/activity/models.py:42
msgid "description"
msgstr "description"
#: apps/activity/models.py:48 apps/note/models/notes.py:149
#: apps/note/models/transactions.py:34 apps/note/models/transactions.py:71
msgid "type"
msgstr "type"
#: apps/activity/models.py:54
msgid "organizer"
msgstr "organisateur"
#: apps/activity/models.py:60
msgid "attendees club"
msgstr ""
#: apps/activity/models.py:63
msgid "start date"
msgstr "date de début"
#: apps/activity/models.py:66
msgid "end date"
msgstr "date de fin"
#: apps/activity/models.py:71
msgid "activities"
msgstr "activités"
#: apps/activity/models.py:100
msgid "guest"
msgstr "invité"
#: apps/activity/models.py:101
msgid "guests"
msgstr "invités"
#: apps/member/apps.py:11
msgid "member"
msgstr "adhérent"
#: apps/member/models.py:24
msgid "phone number"
msgstr "numéro de téléphone"
#: apps/member/models.py:30 templates/member/profile_detail.html:18
msgid "section"
msgstr "section"
#: apps/member/models.py:31
msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
msgstr "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
#: apps/member/models.py:37 templates/member/profile_detail.html:20
msgid "address"
msgstr "adresse"
#: apps/member/models.py:43
msgid "paid"
msgstr "payé"
#: apps/member/models.py:48 apps/member/models.py:49
msgid "user profile"
msgstr "profil utilisateur"
#: apps/member/models.py:64
msgid "email"
msgstr "courriel"
#: apps/member/models.py:69
msgid "membership fee"
msgstr "cotisation pour adhérer"
#: apps/member/models.py:73
msgid "membership duration"
msgstr "durée de l'adhésion"
#: apps/member/models.py:74
msgid "The longest time a membership can last (NULL = infinite)."
msgstr "La durée maximale d'une adhésion (NULL = infinie)."
#: apps/member/models.py:79
msgid "membership start"
msgstr "début de l'adhésion"
#: apps/member/models.py:80
msgid "How long after January 1st the members can renew their membership."
msgstr ""
#: apps/member/models.py:85
msgid "membership end"
msgstr "fin de l'adhésion"
#: apps/member/models.py:86
msgid ""
"How long the membership can last after January 1st of the next year after "
"members can renew their membership."
msgstr ""
#: apps/member/models.py:92 apps/note/models/notes.py:125
msgid "club"
msgstr "club"
#: apps/member/models.py:93
msgid "clubs"
msgstr "clubs"
#: apps/member/models.py:113
msgid "role"
msgstr "rôle"
#: apps/member/models.py:114
msgid "roles"
msgstr "rôles"
#: apps/member/models.py:134
msgid "membership starts on"
msgstr "l'adhésion commence le"
#: apps/member/models.py:137
msgid "membership ends on"
msgstr "l'adhésion finie le"
#: apps/member/models.py:141
msgid "fee"
msgstr "cotisation"
#: apps/member/models.py:145
msgid "membership"
msgstr "adhésion"
#: apps/member/models.py:146
msgid "memberships"
msgstr "adhésions"
#: apps/note/admin.py:112 apps/note/models/transactions.py:51
msgid "source"
msgstr "source"
#: apps/note/admin.py:120 apps/note/admin.py:148
#: apps/note/models/transactions.py:27 apps/note/models/transactions.py:57
msgid "destination"
msgstr "destination"
#: apps/note/apps.py:15 apps/note/models/notes.py:47
msgid "note"
msgstr "note"
#: apps/note/models/notes.py:24
msgid "account balance"
msgstr "solde du compte"
#: apps/note/models/notes.py:25
msgid "in centimes, money credited for this instance"
msgstr "en centimes, argent crédité pour cette instance"
#: apps/note/models/notes.py:29
msgid "active"
msgstr "actif"
#: apps/note/models/notes.py:32
msgid ""
"Designates whether this note should be treated as active. Unselect this "
"instead of deleting notes."
msgstr ""
"Indique si la note est active. Désactiver cela plutôt que supprimer la note."
#: apps/note/models/notes.py:37
msgid "display image"
msgstr "image affichée"
#: apps/note/models/notes.py:42 apps/note/models/transactions.py:60
msgid "created at"
msgstr "créée le"
#: apps/note/models/notes.py:48
msgid "notes"
msgstr "notes"
#: apps/note/models/notes.py:56
msgid "Note"
msgstr "Note"
#: apps/note/models/notes.py:66 apps/note/models/notes.py:88
msgid "This alias is already taken."
msgstr "Cet alias est déjà pris."
#: apps/note/models/notes.py:103
msgid "user"
msgstr "utilisateur"
#: apps/note/models/notes.py:107
msgid "one's note"
msgstr "note d'un utilisateur"
#: apps/note/models/notes.py:108
msgid "users note"
msgstr "notes des utilisateurs"
#: apps/note/models/notes.py:114
#, python-format
msgid "%(user)s's note"
msgstr "Note de %(user)s"
#: apps/note/models/notes.py:129
msgid "club note"
msgstr "note d'un club"
#: apps/note/models/notes.py:130
msgid "clubs notes"
msgstr "notes des clubs"
#: apps/note/models/notes.py:136
#, python-format
msgid "Note for %(club)s club"
msgstr "Note du club %(club)s"
#: apps/note/models/notes.py:155
msgid "special note"
msgstr "note spéciale"
#: apps/note/models/notes.py:156
msgid "special notes"
msgstr "notes spéciales"
#: apps/note/models/notes.py:173
msgid "Invalid alias"
msgstr "Alias invalide"
#: apps/note/models/notes.py:189
msgid "alias"
msgstr "alias"
#: apps/note/models/notes.py:190
msgid "aliases"
msgstr "alias"
#: apps/note/models/notes.py:218
msgid "Alias too long."
msgstr "L'alias est trop long."
#: apps/note/models/notes.py:221
msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà."
#: apps/note/models/transactions.py:30 apps/note/models/transactions.py:68
msgid "amount"
msgstr "montant"
#: apps/note/models/transactions.py:31
msgid "in centimes"
msgstr "en centimes"
#: apps/note/models/transactions.py:39
msgid "transaction template"
msgstr "modèle de transaction"
#: apps/note/models/transactions.py:40
msgid "transaction templates"
msgstr "modèles de transaction"
#: apps/note/models/transactions.py:64
msgid "quantity"
msgstr "quantité"
#: apps/note/models/transactions.py:75
msgid "reason"
msgstr "raison"
#: apps/note/models/transactions.py:79
msgid "valid"
msgstr "valide"
#: apps/note/models/transactions.py:84
msgid "transaction"
msgstr "transaction"
#: apps/note/models/transactions.py:85
msgid "transactions"
msgstr "transactions"
#: apps/note/models/transactions.py:118
msgid "membership transaction"
msgstr "transaction d'adhésion"
#: apps/note/models/transactions.py:119
msgid "membership transactions"
msgstr "transactions d'adhésion"
#: apps/note/views.py:26
msgid "Transfer money from your account to one or others"
msgstr "Transfert d'argent de ton compte vers un ou plusieurs autres"
#: note_kfet/settings.py:140
msgid "English"
msgstr ""
#: note_kfet/settings.py:141
msgid "French"
msgstr ""
#: templates/base.html:14
msgid "The ENS Paris-Saclay BDE note."
msgstr ""
#: templates/member/profile_detail.html:12
msgid "first name"
msgstr ""
#: templates/member/profile_detail.html:14
#, fuzzy
#| msgid "name"
msgid "username"
msgstr "nom"
#: templates/member/profile_detail.html:22
#, fuzzy
#| msgid "account balance"
msgid "balance"
msgstr "solde du compte"
#: templates/member/profile_detail.html:26
msgid "Change password"
msgstr ""
#: templates/note/transaction_form.html:35
msgid "Transfer"
msgstr "Virement"
#: templates/registration/logged_out.html:8
msgid "Thanks for spending some quality time with the Web site today."
msgstr ""
#: templates/registration/logged_out.html:9
msgid "Log in again"
msgstr ""
#: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:22
#: templates/registration/password_reset_complete.html:10
msgid "Log in"
msgstr ""
#: templates/registration/login.html:13
#, python-format
msgid ""
"You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""
#: templates/registration/login.html:23
msgid "Forgotten your password or username?"
msgstr ""
#: templates/registration/password_change_done.html:8
msgid "Your password was changed."
msgstr ""
#: templates/registration/password_change_form.html:9
msgid ""
"Please enter your old password, for security's sake, and then enter your new "
"password twice so we can verify you typed it in correctly."
msgstr ""
#: templates/registration/password_change_form.html:11
#: templates/registration/password_reset_confirm.html:12
msgid "Change my password"
msgstr ""
#: templates/registration/password_reset_complete.html:8
msgid "Your password has been set. You may go ahead and log in now."
msgstr ""
#: templates/registration/password_reset_confirm.html:9
msgid ""
"Please enter your new password twice so we can verify you typed it in "
"correctly."
msgstr ""
#: templates/registration/password_reset_confirm.html:15
msgid ""
"The password reset link was invalid, possibly because it has already been "
"used. Please request a new password reset."
msgstr ""
#: templates/registration/password_reset_done.html:8
msgid ""
"We've emailed you instructions for setting your password, if an account "
"exists with the email you entered. You should receive them shortly."
msgstr ""
#: templates/registration/password_reset_done.html:9
msgid ""
"If you don't receive an email, please make sure you've entered the address "
"you registered with, and check your spam folder."
msgstr ""
#: templates/registration/password_reset_form.html:8
msgid ""
"Forgotten your password? Enter your email address below, and we'll email "
"instructions for setting a new one."
msgstr ""
#: templates/registration/password_reset_form.html:11
msgid "Reset my password"
msgstr ""

View File

@ -10,7 +10,7 @@ from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
APPS_DIR = os.path.realpath(os.path.join(BASE_DIR,"apps"))
APPS_DIR = os.path.realpath(os.path.join(BASE_DIR, "apps"))
sys.path.append(APPS_DIR)
# Quick-start development settings - unsuitable for production
@ -76,7 +76,7 @@ ROOT_URLCONF = 'note_kfet.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'templates')],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -127,7 +127,7 @@ AUTHENTICATION_BACKENDS = (
'guardian.backends.ObjectPermissionBackend',
)
ANONYMOUS_USER_NAME = None # Disable guardian anonymous user
ANONYMOUS_USER_NAME = None # Disable guardian anonymous user
GUARDIAN_GET_CONTENT_TYPE = 'polymorphic.contrib.guardian.get_polymorphic_base_content_type'
@ -149,6 +149,8 @@ USE_L10N = True
USE_TZ = True
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
@ -158,7 +160,7 @@ USE_TZ = True
# Example: "/var/www/example.com/static/"
STATIC_ROOT = os.path.realpath(__file__)
STATICFILES_DIRS = [
os.path.join(BASE_DIR,'static')]
os.path.join(BASE_DIR, 'static')]
CRISPY_TEMPLATE_PACK = 'bootstrap4'
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'

View File

@ -14,9 +14,8 @@ urlpatterns = [
path('note/', include('note.urls')),
# Include Django Contrib and Core routers
# admin/login/ is redirected to the non-admin login page
path('i18n/', include('django.conf.urls.i18n')),
path('accounts/',include('member.urls')),
path('accounts/', include('member.urls')),
path('accounts/', include('django.contrib.auth.urls')),
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),

View File

@ -1,17 +0,0 @@
/* Footer en bas */
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 70px; /* Margin bottom by footer height */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px; /* Set the fixed height of the footer here */
line-height: 60px; /* Vertically center the text there */
background-color: #f5f5f5;
}
/* Affichage des accords dans les interlignes */

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/static/favicon/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/favicon/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/static/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/favicon/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

View File

@ -1,60 +1,80 @@
{% load static %}
{% load static i18n static %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="position-relative h-100">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<title>{% block title %}NoteKfet2020{% endblock title %}</title>
<meta name="description" content="A framework for launching new Django projects quickly.">
<meta name="author" content="">
<link rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<title>
{% block title %}{{ title }}{% endblock title %} - {{ request.site.name }}
</title>
<meta name="description" content="{% trans "The ENS Paris-Saclay BDE note." %}">
{% block css %}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="{% static 'css/base.css' %}">
{% endblock %}
{# Favicon #}
<link rel="apple-touch-icon" sizes="180x180" href="{% static "favicon/apple-touch-icon.png" %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static "favicon/favicon-32x32.png" %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static "favicon/favicon-16x16.png" %}">
<link rel="manifest" href="{% static "favicon/site.webmanifest" %}">
<link rel="mask-icon" href="{% static "favicon/safari-pinned-tab.svg" %}" color="#5bbad5">
<link rel="shortcut icon" href="{% static "favicon/favicon.ico" %}">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="{% static "favicon/browserconfig.xml" %}">
<meta name="theme-color" content="#ffffff">
{# Bootstrap CSS #}
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
{% block extracss %}{% endblock %}
</head>
<body>
<main>
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-navbar">
<a class="navbar-brand" href="#">NK20-dev</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#"><i class="fa fa-coffee"></i>Consos</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url 'member:club_list' %}"><i class="fa fa-users"></i> Clubs</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#"><i class="fa fa-calendar"></i> Activités</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url 'note:template_list' %}"><i class="fa fa-coffee"></i> Bouton</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
{% if user.is_authenticated%}
<main>
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-navbar">
<a class="navbar-brand" href="/">{{ request.site.name }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#"><i class="fa fa-coffee"></i> Consos</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url 'member:club_list' %}"><i class="fa fa-users"></i> Clubs</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#"><i class="fa fa-calendar"></i> Activités</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url 'note:template_list' %}"><i class="fa fa-coffee"></i> Bouton</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
{% if user.is_authenticated %}
<li class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user"></i> {{ user.username }}
<i class="fa fa-user"></i> {{ user.username }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="{% url 'member:user_detail' pk=user.profile.pk %}"> <i class="fa fa-user"></i> Mon compte </a>
<div class="dropdown-menu dropdown-menu-right"
aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="{% url 'member:user_detail' pk=user.profile.pk %}">
<i class="fa fa-user"></i> Mon compte
</a>
<a class="dropdown-item" href="{% url 'logout' %}">
<i class="fa fa-sign-out"></i>
Se déconnecter</a>
<i class="fa fa-sign-out"></i> Se déconnecter
</a>
</div>
</li>
{% else%}
{% else %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'member:signup' %}">
<i class="fa fa-user-plus"></i> S'inscrire
@ -65,43 +85,74 @@
<i class="fa fa-sign-in"></i> Se connecter
</a>
</li>
{% endif%}
</ul>
{% endif %}
</ul>
</div>
</nav>
<div class="container-fluid mb-5 mt-2">
<div class="row">
<div class="col-md-2">
{% block sidebar %}
{% endblock %}
</div>
</nav>
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-md-2">
</div>
<div class ="col-md-10 text-justify mt-5">
{% block content %}
<div class="col-md-10 text-justify">
{% block contenttitle %}<h1>{{ title }}</h1>{% endblock %}
{% block content %}
<p>Default content...</p>
{% endblock content %}
</div>
{% endblock content %}
</div>
</div>
</main>
<footer class="footer mt-2">
<div class="container">
<span class="text-muted"> NoteKfet2020 - Nous contacter - </span>
<p class="pull-right"> <a href="#">Retour en haut</a></p>
</div>
</main>
<footer class="bg-light fixed-bottom position-absolute py-2">
<div class="container-fluid">
<div class="row">
<div class="col-sm">
<form action="{% url 'set_language' %}" method="post"
class="form-inline">
<span class="text-muted mr-1">
NoteKfet2020 -
<a href="mailto:tresorie.bde@lists.crans.org"
class="text-muted">Nous contacter</a> -
</span>
{% csrf_token %}
<select title="language" name="language"
class="custom-select custom-select-sm"
onchange="this.form.submit()">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"
{% if language.code == LANGUAGE_CODE %}
selected{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
<noscript>
<input type="submit">
</noscript>
</form>
</div>
<div class="col-sm text-right">
<a href="#" class="text-muted">Retour en haut</a>
</div>
</div>
</footer>
{% block javascript %}
<!-- Bootstrap JavaScript -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<!-- 3rd party JavaScript -->
<!-- Project JS -->
<script src="{% static 'js/base.js' %}"></script>
{% endblock javascript %}
</div>
</footer>
{# Bootstrap JavaScript #}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
{% block extrajavascript %}
{% endblock extrajavascript %}
</body>
</html>

View File

@ -1,19 +1,29 @@
{% extends "base.html" %}
{% load static %}
{% block content %}
{% load i18n static pretty_money django_tables2 %}
<h5>Compte n° {{object.pk}}</h5>
<table>
<tr>
<td> <img src="{{ object.note.display_image.url }}" alt="" /> </td>
</tr>
<tr><th> Nom</th><td>{{ object.user.name }}</td></tr>
<tr><th>Prénom </th><td>{{object.user.first_name}}</td></tr>
<tr><th>Pseudo</th><td> {{object.user.username}}</td></tr>
<tr><th> Aliases</th><td>{{object.user.note.aliases_set.all }}</td></tr>
<tr><th>Pseudo</th><td> {{object.user.username}}</td></tr>
<tr><th>Section</th><td> {{object.section}}</td></tr>
<tr><th>Adresse</th><td> {{object.address}}</td></tr>
<tr><th>Solde</th><td> {{object.user.note.balance}}</td></tr>
</table>
{% block content %}
<h3>Compte n° {{ object.pk }}</h3>
<img src="{{ object.note.display_image.url }}" alt=""/>
<dl class="row">
<dt class="col-6 col-md-3">{% trans 'name'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.user.name }}</dd>
<dt class="col-6 col-md-3">{% trans 'first name'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.user.first_name }}</dd>
<dt class="col-6 col-md-3">{% trans 'username'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.user.username }}</dd>
<dt class="col-6 col-md-3">Aliases</dt>
<dd class="col-6 col-md-3">{{ object.user.note.aliases_set.all }}</dd>
<dt class="col-6 col-md-3">{% trans 'section'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.section }}</dd>
<dt class="col-6 col-md-3">{% trans 'address'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.address }}</dd>
<dt class="col-6 col-md-3">{% trans 'balance'|capfirst %}</dt>
<dd class="col-6 col-md-3">{{ object.user.note.balance | pretty_money }}</dd>
</dl>
<a href="{% url "password_change" %}">{% trans 'Change password' %}</a>
{% render_table history_list %}
{% endblock %}

View File

@ -4,12 +4,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a>
</div>
{% endblock %}
{% block content %}
<p>{% trans "Thanks for spending some quality time with the Web site today." %}</p>
<p><a href="{% url 'index' %}">{% trans 'Log in again' %}</a></p>

View File

@ -2,16 +2,24 @@
{% comment %}
SPDX-License-Identifier: GPL-2.0-or-later
{% endcomment %}
{% load i18n crispy_forms_tags %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block title %}{% trans "Log in" %}{% endblock %}
{% block contenttitle %}<h1>{% trans "Log in" %}</h1>{% endblock %}
{% block content %}
<h2>Login</h2>
<form method="post">
{% csrf_token %}
{{ form | crispy }}
<button type="submit">Login</button>
</form>
{% if user.is_authenticated %}
<p class="errornote">
{% blocktrans trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktrans %}
</p>
{% endif %}
<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
{{ form | crispy }}
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
<a href="{% url 'password_reset' %}" class="badge badge-light">{% trans 'Forgotten your password or username?' %}</a>
</form>
{% endblock %}

View File

@ -4,8 +4,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}
</div>
{% block content %}
<p>{% trans 'Your password was changed.' %}</p>
{% endblock %}

View File

@ -2,10 +2,12 @@
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% load i18n crispy_forms_tags %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}
</div>
{% block content %}
<form method="post">{% csrf_token %}
<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
{{ form | crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Change my password' %}">
</form>
{% endblock %}

View File

@ -4,8 +4,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}
</div>
{% block content %}
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p>
<a href="{{ login_url }}" class="btn btn-success">{% trans 'Log in' %}</a>
</p>
{% endblock %}

View File

@ -2,10 +2,16 @@
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% load i18n crispy_forms_tags %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset confirmation' %}
</div>
{% block content %}
{% if validlink %}
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<form method="post">{% csrf_token %}
{{ form | crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Change my password' %}">
</form>
{% else %}
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
{% endif %}
{% endblock %}

View File

@ -4,8 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}
</div>
{% block content %}
<p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p>
<p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}</p>
{% endblock %}

View File

@ -1,13 +0,0 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@ -2,10 +2,12 @@
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% load i18n crispy_forms_tags %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}
</div>
{% block content %}
<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
<form method="post">{% csrf_token %}
{{ form | crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Reset my password' %}">
</form>
{% endblock %}

View File

@ -28,7 +28,7 @@ deps =
pyflakes
pylint
commands =
flake8 activity member note
flake8 app/activity app/member app/note
pylint .
[flake8]