From 5aff771d9c2a3b8f834cd2cce5edbf7ddf75b064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Thu, 9 Feb 2017 21:04:32 +0100 Subject: [PATCH] Set the new structure of gestioCOF - `cof` is renamed `gestioCOF` - `gestioncof` become `cof` (yes it looks pretty stupid but it is not) - `bds` is created --- bda/management/commands/loadbdadevdata.py | 2 +- bda/templates/resume_places.html | 2 +- bda/urls.py | 2 +- bda/views.py | 2 +- {cof/locale => bds}/__init__.py | 0 bds/admin.py | 3 + {cof/locale/fr => bds/migrations}/__init__.py | 0 bds/models.py | 3 + bds/tests.py | 3 + bds/views.py | 3 + {gestioncof => cof}/admin.py | 6 +- {gestioncof => cof}/autocomplete.py | 4 +- .../autocomplete_light_registry.py | 0 {gestioncof => cof}/csv_views.py | 0 {gestioncof => cof}/decorators.py | 0 {gestioncof => cof}/fixtures/gestion.json | 40 ++--- {gestioncof => cof}/fixtures/sites.json | 0 {gestioncof => cof}/forms.py | 6 +- {gestioncof => cof}/management/base.py | 0 .../management/commands/loaddevdata.py | 4 +- .../management/data/gaulois.json | 0 .../management/data/romains.json | 0 .../migrations/0001_initial.py | 36 ++--- .../0002_enable_unprocessed_demandes.py | 2 +- .../migrations/0003_event_image.py | 2 +- .../migrations/0004_registration_mail.py | 4 +- .../migrations/0005_encoding.py | 2 +- .../migrations/0006_add_calendar.py | 2 +- .../migrations/0007_alter_club.py | 2 +- {gestioncof => cof}/migrations/0008_py3.py | 4 +- {gestioncof => cof/migrations}/__init__.py | 0 {gestioncof => cof}/models.py | 2 +- {gestioncof => cof}/petits_cours_models.py | 0 {gestioncof => cof}/petits_cours_views.py | 8 +- {gestioncof => cof}/shared.py | 2 +- .../static/css/bootstrap.min.css | 0 .../static/css/bootstrap.min.css.map | 0 {gestioncof => cof}/static/css/cof.css | 0 .../static/css/droidserif.woff | Bin .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin {gestioncof => cof}/static/images/no.png | Bin {gestioncof => cof}/static/images/none.png | Bin {gestioncof => cof}/static/images/yes.png | Bin .../static/js/bootstrap.min.js | 0 .../js/joequery-Stupid-Table-Plugin/LICENSE | 0 .../js/joequery-Stupid-Table-Plugin/README.md | 0 .../examples/basic.html | 0 .../examples/colspan.html | 0 .../examples/complex.html | 0 .../examples/large-table.html | 0 .../stupidtable.js | 0 .../stupidtable.min.js | 0 {gestioncof => cof}/static/js/jquery.min.js | 0 {gestioncof => cof}/templates/404.html | 0 {gestioncof => cof}/templates/500.html | 0 .../templates/admin/base_site.html | 0 .../templates/admin/index.html | 0 .../templates/autocomplete_user.html | 0 {gestioncof => cof}/templates/base.html | 0 .../templates/base_header.html | 4 +- {gestioncof => cof}/templates/base_title.html | 0 .../templates/base_title_petitscours.html | 0 {gestioncof => cof}/templates/cof-denied.html | 0 .../templates/cof}/calendar_subscription.html | 2 +- cof/templates/cof/utile_cof.html | 24 +++ .../templates/demande-petit-cours-raw.html | 2 +- .../templates/demande-petit-cours.html | 2 +- .../details_demande_petit_cours.html | 0 .../details_demande_petit_cours_infos.html | 0 {gestioncof => cof}/templates/error.html | 0 {gestioncof => cof}/templates/event.html | 2 +- .../templates/event_status.html | 4 +- {gestioncof => cof}/templates/home.html | 18 +-- .../inscription-petit-cours-formset.html | 0 .../templates/inscription-petit-cours.html | 0 .../templates/liste_clubs.html | 0 .../templates/liste_mails.html | 0 {gestioncof => cof}/templates/login.html | 2 +- .../templates/login_switch.html | 2 +- .../templates/membres_clubs.html | 0 .../templates/petits-cours-mail-demandeur.txt | 0 .../templates/petits-cours-mail-eleve.txt | 0 .../templates/petits_cours_demandes_list.html | 0 {gestioncof => cof}/templates/profile.html | 2 +- .../templates/registration.html | 2 +- .../registration/password_change_done.html | 2 +- .../registration/password_change_form.html | 0 .../templates/registration_form.html | 2 +- .../templates/registration_post.html | 0 {gestioncof => cof}/templates/survey.html | 2 +- .../templates/survey_status.html | 4 +- .../traitement_demande_petit_cours.html | 0 ...ment_demande_petit_cours_autre_niveau.html | 0 ...raitement_demande_petit_cours_success.html | 0 .../templates/tristate_js.html | 0 {gestioncof => cof}/templates/utile_bda.html | 4 +- .../templatetags}/__init__.py | 0 {gestioncof => cof}/templatetags/utils.py | 0 {gestioncof => cof}/tests.py | 2 +- cof/urls.py | 140 +++++++----------- {gestioncof => cof}/views.py | 24 +-- {gestioncof => cof}/widgets.py | 0 .../templatetags => gestioCOF}/__init__.py | 0 {cof => gestioCOF}/asgi.py | 0 gestioCOF/locale/__init__.py | 0 gestioCOF/locale/fr/__init__.py | 0 {cof => gestioCOF}/locale/fr/formats.py | 0 {cof => gestioCOF}/routing.py | 0 {cof => gestioCOF}/settings_dev.py | 20 +-- gestioCOF/urls.py | 99 +++++++++++++ gestion/__init__.py | 0 gestion/admin.py | 3 + gestion/migrations/__init__.py | 0 gestion/models.py | 3 + gestion/tests.py | 3 + gestion/views.py | 3 + .../templates/gestioncof/utile_cof.html | 24 --- gestioncof/urls.py | 61 -------- kfet/autocomplete.py | 2 +- kfet/backends.py | 2 +- kfet/forms.py | 2 +- kfet/migrations/0001_initial.py | 4 +- kfet/models.py | 2 +- kfet/templates/kfet/base_nav.html | 2 +- kfet/views.py | 2 +- provisioning/bootstrap.sh | 4 +- provisioning/supervisor.conf | 6 +- sync_clipper.py | 4 +- 132 files changed, 331 insertions(+), 307 deletions(-) rename {cof/locale => bds}/__init__.py (100%) create mode 100644 bds/admin.py rename {cof/locale/fr => bds/migrations}/__init__.py (100%) create mode 100644 bds/models.py create mode 100644 bds/tests.py create mode 100644 bds/views.py rename {gestioncof => cof}/admin.py (98%) rename {gestioncof => cof}/autocomplete.py (95%) rename {gestioncof => cof}/autocomplete_light_registry.py (100%) rename {gestioncof => cof}/csv_views.py (100%) rename {gestioncof => cof}/decorators.py (100%) rename {gestioncof => cof}/fixtures/gestion.json (78%) rename {gestioncof => cof}/fixtures/sites.json (100%) rename {gestioncof => cof}/forms.py (99%) rename {gestioncof => cof}/management/base.py (100%) rename {gestioncof => cof}/management/commands/loaddevdata.py (97%) rename {gestioncof => cof}/management/data/gaulois.json (100%) rename {gestioncof => cof}/management/data/romains.json (100%) rename {gestioncof => cof}/migrations/0001_initial.py (94%) rename {gestioncof => cof}/migrations/0002_enable_unprocessed_demandes.py (91%) rename {gestioncof => cof}/migrations/0003_event_image.py (87%) rename {gestioncof => cof}/migrations/0004_registration_mail.py (91%) rename {gestioncof => cof}/migrations/0005_encoding.py (97%) rename {gestioncof => cof}/migrations/0006_add_calendar.py (97%) rename {gestioncof => cof}/migrations/0007_alter_club.py (97%) rename {gestioncof => cof}/migrations/0008_py3.py (98%) rename {gestioncof => cof/migrations}/__init__.py (100%) rename {gestioncof => cof}/models.py (99%) rename {gestioncof => cof}/petits_cours_models.py (100%) rename {gestioncof => cof}/petits_cours_views.py (98%) rename {gestioncof => cof}/shared.py (98%) rename {gestioncof => cof}/static/css/bootstrap.min.css (100%) rename {gestioncof => cof}/static/css/bootstrap.min.css.map (100%) rename {gestioncof => cof}/static/css/cof.css (100%) rename {gestioncof => cof}/static/css/droidserif.woff (100%) rename {gestioncof => cof}/static/fonts/glyphicons-halflings-regular.eot (100%) rename {gestioncof => cof}/static/fonts/glyphicons-halflings-regular.svg (100%) rename {gestioncof => cof}/static/fonts/glyphicons-halflings-regular.ttf (100%) rename {gestioncof => cof}/static/fonts/glyphicons-halflings-regular.woff (100%) rename {gestioncof => cof}/static/fonts/glyphicons-halflings-regular.woff2 (100%) rename {gestioncof => cof}/static/images/no.png (100%) rename {gestioncof => cof}/static/images/none.png (100%) rename {gestioncof => cof}/static/images/yes.png (100%) rename {gestioncof => cof}/static/js/bootstrap.min.js (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/LICENSE (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/README.md (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/examples/basic.html (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/examples/colspan.html (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/examples/complex.html (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/examples/large-table.html (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/stupidtable.js (100%) rename {gestioncof => cof}/static/js/joequery-Stupid-Table-Plugin/stupidtable.min.js (100%) rename {gestioncof => cof}/static/js/jquery.min.js (100%) rename {gestioncof => cof}/templates/404.html (100%) rename {gestioncof => cof}/templates/500.html (100%) rename {gestioncof => cof}/templates/admin/base_site.html (100%) rename {gestioncof => cof}/templates/admin/index.html (100%) rename {gestioncof => cof}/templates/autocomplete_user.html (100%) rename {gestioncof => cof}/templates/base.html (100%) rename {gestioncof => cof}/templates/base_header.html (78%) rename {gestioncof => cof}/templates/base_title.html (100%) rename {gestioncof => cof}/templates/base_title_petitscours.html (100%) rename {gestioncof => cof}/templates/cof-denied.html (100%) rename {gestioncof/templates/gestioncof => cof/templates/cof}/calendar_subscription.html (95%) create mode 100644 cof/templates/cof/utile_cof.html rename {gestioncof => cof}/templates/demande-petit-cours-raw.html (71%) rename {gestioncof => cof}/templates/demande-petit-cours.html (92%) rename {gestioncof => cof}/templates/details_demande_petit_cours.html (100%) rename {gestioncof => cof}/templates/details_demande_petit_cours_infos.html (100%) rename {gestioncof => cof}/templates/error.html (100%) rename {gestioncof => cof}/templates/event.html (87%) rename {gestioncof => cof}/templates/event_status.html (89%) rename {gestioncof => cof}/templates/home.html (85%) rename {gestioncof => cof}/templates/inscription-petit-cours-formset.html (100%) rename {gestioncof => cof}/templates/inscription-petit-cours.html (100%) rename {gestioncof => cof}/templates/liste_clubs.html (100%) rename {gestioncof => cof}/templates/liste_mails.html (100%) rename {gestioncof => cof}/templates/login.html (93%) rename {gestioncof => cof}/templates/login_switch.html (91%) rename {gestioncof => cof}/templates/membres_clubs.html (100%) rename {gestioncof => cof}/templates/petits-cours-mail-demandeur.txt (100%) rename {gestioncof => cof}/templates/petits-cours-mail-eleve.txt (100%) rename {gestioncof => cof}/templates/petits_cours_demandes_list.html (100%) rename {gestioncof => cof}/templates/profile.html (96%) rename {gestioncof => cof}/templates/registration.html (95%) rename {gestioncof => cof}/templates/registration/password_change_done.html (65%) rename {gestioncof => cof}/templates/registration/password_change_form.html (100%) rename {gestioncof => cof}/templates/registration_form.html (96%) rename {gestioncof => cof}/templates/registration_post.html (100%) rename {gestioncof => cof}/templates/survey.html (95%) rename {gestioncof => cof}/templates/survey_status.html (89%) rename {gestioncof => cof}/templates/traitement_demande_petit_cours.html (100%) rename {gestioncof => cof}/templates/traitement_demande_petit_cours_autre_niveau.html (100%) rename {gestioncof => cof}/templates/traitement_demande_petit_cours_success.html (100%) rename {gestioncof => cof}/templates/tristate_js.html (100%) rename {gestioncof => cof}/templates/utile_bda.html (54%) rename {gestioncof/migrations => cof/templatetags}/__init__.py (100%) rename {gestioncof => cof}/templatetags/utils.py (100%) rename {gestioncof => cof}/tests.py (95%) rename {gestioncof => cof}/views.py (97%) rename {gestioncof => cof}/widgets.py (100%) rename {gestioncof/templatetags => gestioCOF}/__init__.py (100%) rename {cof => gestioCOF}/asgi.py (100%) create mode 100644 gestioCOF/locale/__init__.py create mode 100644 gestioCOF/locale/fr/__init__.py rename {cof => gestioCOF}/locale/fr/formats.py (100%) rename {cof => gestioCOF}/routing.py (100%) rename {cof => gestioCOF}/settings_dev.py (95%) create mode 100644 gestioCOF/urls.py create mode 100644 gestion/__init__.py create mode 100644 gestion/admin.py create mode 100644 gestion/migrations/__init__.py create mode 100644 gestion/models.py create mode 100644 gestion/tests.py create mode 100644 gestion/views.py delete mode 100644 gestioncof/templates/gestioncof/utile_cof.html delete mode 100644 gestioncof/urls.py diff --git a/bda/management/commands/loadbdadevdata.py b/bda/management/commands/loadbdadevdata.py index a8e3f298..a8851e3d 100644 --- a/bda/management/commands/loadbdadevdata.py +++ b/bda/management/commands/loadbdadevdata.py @@ -8,7 +8,7 @@ import random from django.utils import timezone from django.contrib.auth.models import User -from gestioncof.management.base import MyBaseCommand +from cof.management.base import MyBaseCommand from bda.models import Tirage, Spectacle, Salle, Participant, ChoixSpectacle from bda.views import do_tirage diff --git a/bda/templates/resume_places.html b/bda/templates/resume_places.html index 614a1656..1449473a 100644 --- a/bda/templates/resume_places.html +++ b/bda/templates/resume_places.html @@ -19,7 +19,7 @@

Total à payer : {{ total|floatformat }}€


Ne manque pas un spectacle avec le - calendrier + calendrier automatique !

{% else %}

Vous n'avez aucune place :(

diff --git a/bda/urls.py b/bda/urls.py index bbbf8e39..8088dd8a 100644 --- a/bda/urls.py +++ b/bda/urls.py @@ -5,7 +5,7 @@ from __future__ import print_function from __future__ import unicode_literals from django.conf.urls import url -from gestioncof.decorators import buro_required +from cof.decorators import buro_required from bda.views import SpectacleListView from bda import views diff --git a/bda/views.py b/bda/views.py index 1a864c7f..18fdc3bc 100644 --- a/bda/views.py +++ b/bda/views.py @@ -20,7 +20,7 @@ from django.template import loader from django.utils import timezone from django.views.generic.list import ListView -from gestioncof.decorators import cof_required, buro_required +from cof.decorators import cof_required, buro_required from bda.models import Spectacle, Participant, ChoixSpectacle, Attribution,\ Tirage, SpectacleRevente from bda.algorithm import Algorithm diff --git a/cof/locale/__init__.py b/bds/__init__.py similarity index 100% rename from cof/locale/__init__.py rename to bds/__init__.py diff --git a/bds/admin.py b/bds/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/bds/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/cof/locale/fr/__init__.py b/bds/migrations/__init__.py similarity index 100% rename from cof/locale/fr/__init__.py rename to bds/migrations/__init__.py diff --git a/bds/models.py b/bds/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/bds/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/bds/tests.py b/bds/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/bds/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/bds/views.py b/bds/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/bds/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/gestioncof/admin.py b/cof/admin.py similarity index 98% rename from gestioncof/admin.py rename to cof/admin.py index eb8ad6c0..4ef9ef66 100644 --- a/gestioncof/admin.py +++ b/cof/admin.py @@ -7,10 +7,10 @@ from __future__ import unicode_literals from django import forms from django.contrib import admin from django.utils.translation import ugettext_lazy as _ -from gestioncof.models import SurveyQuestionAnswer, SurveyQuestion, \ +from .models import SurveyQuestionAnswer, SurveyQuestion, \ CofProfile, EventOption, EventOptionChoice, Event, Club, CustomMail, \ Survey, EventCommentField, EventRegistration -from gestioncof.petits_cours_models import PetitCoursDemande, \ +from .petits_cours_models import PetitCoursDemande, \ PetitCoursSubject, PetitCoursAbility, PetitCoursAttribution, \ PetitCoursAttributionCounter from django.contrib.auth.models import User, Group, Permission @@ -195,7 +195,7 @@ class UserProfileAdmin(UserAdmin): # Si le groupe COF n'était pas déjà dans la bdd # On lui assigne les bonnes permissions perms = Permission.objects.filter( - Q(content_type__app_label='gestioncof') + Q(content_type__app_label='cof') | Q(content_type__app_label='bda') | (Q(content_type__app_label='auth') & Q(content_type__model='user'))) diff --git a/gestioncof/autocomplete.py b/cof/autocomplete.py similarity index 95% rename from gestioncof/autocomplete.py rename to cof/autocomplete.py index ed0a1e5a..38dea4a2 100644 --- a/gestioncof/autocomplete.py +++ b/cof/autocomplete.py @@ -9,8 +9,8 @@ from django.http import Http404 from django.db.models import Q from django.contrib.auth.models import User -from gestioncof.models import CofProfile, Clipper -from gestioncof.decorators import buro_required +from .models import CofProfile, Clipper +from .decorators import buro_required @buro_required diff --git a/gestioncof/autocomplete_light_registry.py b/cof/autocomplete_light_registry.py similarity index 100% rename from gestioncof/autocomplete_light_registry.py rename to cof/autocomplete_light_registry.py diff --git a/gestioncof/csv_views.py b/cof/csv_views.py similarity index 100% rename from gestioncof/csv_views.py rename to cof/csv_views.py diff --git a/gestioncof/decorators.py b/cof/decorators.py similarity index 100% rename from gestioncof/decorators.py rename to cof/decorators.py diff --git a/gestioncof/fixtures/gestion.json b/cof/fixtures/gestion.json similarity index 78% rename from gestioncof/fixtures/gestion.json rename to cof/fixtures/gestion.json index ae6466f8..6d1bd76f 100644 --- a/gestioncof/fixtures/gestion.json +++ b/cof/fixtures/gestion.json @@ -6,7 +6,7 @@ "survey_open": true, "title": "Sort du barde" }, - "model": "gestioncof.survey", + "model": "cof.survey", "pk": 1 }, { @@ -15,7 +15,7 @@ "survey": 1, "multi_answers": true }, - "model": "gestioncof.surveyquestion", + "model": "cof.surveyquestion", "pk": 1 }, { @@ -24,7 +24,7 @@ "survey": 1, "multi_answers": false }, - "model": "gestioncof.surveyquestion", + "model": "cof.surveyquestion", "pk": 2 }, { @@ -32,7 +32,7 @@ "answer": "On l'ernestise", "survey_question": 1 }, - "model": "gestioncof.surveyquestionanswer", + "model": "cof.surveyquestionanswer", "pk": 1 }, { @@ -40,7 +40,7 @@ "answer": "On ligote", "survey_question": 1 }, - "model": "gestioncof.surveyquestionanswer", + "model": "cof.surveyquestionanswer", "pk": 2 }, { @@ -48,7 +48,7 @@ "answer": "On le prive de banquet", "survey_question": 1 }, - "model": "gestioncof.surveyquestionanswer", + "model": "cof.surveyquestionanswer", "pk": 3 }, { @@ -56,7 +56,7 @@ "answer": "Oui", "survey_question": 2 }, - "model": "gestioncof.surveyquestionanswer", + "model": "cof.surveyquestionanswer", "pk": 4 }, { @@ -64,7 +64,7 @@ "answer": "Non", "survey_question": 2 }, - "model": "gestioncof.surveyquestionanswer", + "model": "cof.surveyquestionanswer", "pk": 5 }, { @@ -78,7 +78,7 @@ "registration_open": true, "start_date": "2016-09-09T00:00:00Z" }, - "model": "gestioncof.event", + "model": "cof.event", "pk": 1 }, { @@ -88,7 +88,7 @@ "fieldtype": "text", "name": "Commentaires" }, - "model": "gestioncof.eventcommentfield", + "model": "cof.eventcommentfield", "pk": 1 }, { @@ -97,7 +97,7 @@ "event": 1, "name": "Potion magique" }, - "model": "gestioncof.eventoption", + "model": "cof.eventoption", "pk": 1 }, { @@ -105,7 +105,7 @@ "event_option": 1, "value": "Je suis alergique" }, - "model": "gestioncof.eventoptionchoice", + "model": "cof.eventoptionchoice", "pk": 1 }, { @@ -113,7 +113,7 @@ "event_option": 1, "value": "J'en veux" }, - "model": "gestioncof.eventoptionchoice", + "model": "cof.eventoptionchoice", "pk": 2 }, { @@ -121,35 +121,35 @@ "event_option": 1, "value": "Je suis tomb\u00e9 dans la marmite quand j'\u00e9tais petit" }, - "model": "gestioncof.eventoptionchoice", + "model": "cof.eventoptionchoice", "pk": 3 }, { "fields": { "name": "Bagarre" }, - "model": "gestioncof.petitcourssubject", + "model": "cof.petitcourssubject", "pk": 1 }, { "fields": { "name": "Lancer de menhir" }, - "model": "gestioncof.petitcourssubject", + "model": "cof.petitcourssubject", "pk": 2 }, { "fields": { "name": "Pr\u00e9paration de potions" }, - "model": "gestioncof.petitcourssubject", + "model": "cof.petitcourssubject", "pk": 3 }, { "fields": { "name": "Chant" }, - "model": "gestioncof.petitcourssubject", + "model": "cof.petitcourssubject", "pk": 4 }, { @@ -171,7 +171,7 @@ "email": "jules.cesar@polytechnique.edu", "processed": null }, - "model": "gestioncof.petitcoursdemande", + "model": "cof.petitcoursdemande", "pk": 1 }, { @@ -193,7 +193,7 @@ "email": "jules.cesar@polytechnique.edu", "processed": null }, - "model": "gestioncof.petitcoursdemande", + "model": "cof.petitcoursdemande", "pk": 2 } ] diff --git a/gestioncof/fixtures/sites.json b/cof/fixtures/sites.json similarity index 100% rename from gestioncof/fixtures/sites.json rename to cof/fixtures/sites.json diff --git a/gestioncof/forms.py b/cof/forms.py similarity index 99% rename from gestioncof/forms.py rename to cof/forms.py index 3a519a39..9c340053 100644 --- a/gestioncof/forms.py +++ b/cof/forms.py @@ -12,10 +12,10 @@ from django.forms.formsets import BaseFormSet, formset_factory from django.db.models import Max from django.core.validators import MinLengthValidator -from gestioncof.models import CofProfile, EventCommentValue, \ +from .models import CofProfile, EventCommentValue, \ CalendarSubscription, Club -from gestioncof.widgets import TriStateCheckbox -from gestioncof.shared import lock_table, unlock_table +from .widgets import TriStateCheckbox +from .shared import lock_table, unlock_table from bda.models import Spectacle diff --git a/gestioncof/management/base.py b/cof/management/base.py similarity index 100% rename from gestioncof/management/base.py rename to cof/management/base.py diff --git a/gestioncof/management/commands/loaddevdata.py b/cof/management/commands/loaddevdata.py similarity index 97% rename from gestioncof/management/commands/loaddevdata.py rename to cof/management/commands/loaddevdata.py index 77bfc606..4627c2d0 100644 --- a/gestioncof/management/commands/loaddevdata.py +++ b/cof/management/commands/loaddevdata.py @@ -13,8 +13,8 @@ import random from django.contrib.auth.models import User from django.core.management import call_command -from gestioncof.management.base import MyBaseCommand -from gestioncof.petits_cours_models import ( +from cof.management.base import MyBaseCommand +from cof.petits_cours_models import ( PetitCoursAbility, PetitCoursSubject, LEVELS_CHOICES, PetitCoursAttributionCounter ) diff --git a/gestioncof/management/data/gaulois.json b/cof/management/data/gaulois.json similarity index 100% rename from gestioncof/management/data/gaulois.json rename to cof/management/data/gaulois.json diff --git a/gestioncof/management/data/romains.json b/cof/management/data/romains.json similarity index 100% rename from gestioncof/management/data/romains.json rename to cof/management/data/romains.json diff --git a/gestioncof/migrations/0001_initial.py b/cof/migrations/0001_initial.py similarity index 94% rename from gestioncof/migrations/0001_initial.py rename to cof/migrations/0001_initial.py index b942645d..0540e689 100644 --- a/gestioncof/migrations/0001_initial.py +++ b/cof/migrations/0001_initial.py @@ -91,7 +91,7 @@ class Migration(migrations.Migration): ('name', models.CharField(max_length=200, verbose_name=b'Champ')), ('fieldtype', models.CharField(default=b'text', max_length=10, verbose_name=b'Type', choices=[(b'text', 'Texte long'), (b'char', 'Texte court')])), ('default', models.TextField(verbose_name=b'Valeur par d\xc3\xa9faut', blank=True)), - ('event', models.ForeignKey(related_name='commentfields', to='gestioncof.Event')), + ('event', models.ForeignKey(related_name='commentfields', to='cof.Event')), ], options={ 'verbose_name': 'Champ', @@ -102,7 +102,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('content', models.TextField(null=True, verbose_name=b'Contenu', blank=True)), - ('commentfield', models.ForeignKey(related_name='values', to='gestioncof.EventCommentField')), + ('commentfield', models.ForeignKey(related_name='values', to='cof.EventCommentField')), ], ), migrations.CreateModel( @@ -111,7 +111,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=200, verbose_name=b'Option')), ('multi_choices', models.BooleanField(default=False, verbose_name=b'Choix multiples')), - ('event', models.ForeignKey(related_name='options', to='gestioncof.Event')), + ('event', models.ForeignKey(related_name='options', to='cof.Event')), ], options={ 'verbose_name': 'Option', @@ -122,7 +122,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('value', models.CharField(max_length=200, verbose_name=b'Valeur')), - ('event_option', models.ForeignKey(related_name='choices', to='gestioncof.EventOption')), + ('event_option', models.ForeignKey(related_name='choices', to='cof.EventOption')), ], options={ 'verbose_name': 'Choix', @@ -133,9 +133,9 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('paid', models.BooleanField(default=False, verbose_name=b'A pay\xc3\xa9')), - ('event', models.ForeignKey(to='gestioncof.Event')), - ('filledcomments', models.ManyToManyField(to='gestioncof.EventCommentField', through='gestioncof.EventCommentValue')), - ('options', models.ManyToManyField(to='gestioncof.EventOptionChoice')), + ('event', models.ForeignKey(to='cof.Event')), + ('filledcomments', models.ManyToManyField(to='cof.EventCommentField', through='cof.EventCommentValue')), + ('options', models.ManyToManyField(to='cof.EventOptionChoice')), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ @@ -205,7 +205,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=30, verbose_name='Mati\xe8re')), - ('users', models.ManyToManyField(related_name='petits_cours_matieres', through='gestioncof.PetitCoursAbility', to=settings.AUTH_USER_MODEL)), + ('users', models.ManyToManyField(related_name='petits_cours_matieres', through='cof.PetitCoursAbility', to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name': 'Mati\xe8re de petits cours', @@ -240,7 +240,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('question', models.CharField(max_length=200, verbose_name=b'Question')), ('multi_answers', models.BooleanField(default=False, verbose_name=b'Choix multiples')), - ('survey', models.ForeignKey(related_name='questions', to='gestioncof.Survey')), + ('survey', models.ForeignKey(related_name='questions', to='cof.Survey')), ], options={ 'verbose_name': 'Question', @@ -251,7 +251,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('answer', models.CharField(max_length=200, verbose_name=b'R\xc3\xa9ponse')), - ('survey_question', models.ForeignKey(related_name='answers', to='gestioncof.SurveyQuestion')), + ('survey_question', models.ForeignKey(related_name='answers', to='cof.SurveyQuestion')), ], options={ 'verbose_name': 'R\xe9ponse', @@ -260,12 +260,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name='surveyanswer', name='answers', - field=models.ManyToManyField(related_name='selected_by', to='gestioncof.SurveyQuestionAnswer'), + field=models.ManyToManyField(related_name='selected_by', to='cof.SurveyQuestionAnswer'), ), migrations.AddField( model_name='surveyanswer', name='survey', - field=models.ForeignKey(to='gestioncof.Survey'), + field=models.ForeignKey(to='cof.Survey'), ), migrations.AddField( model_name='surveyanswer', @@ -275,7 +275,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='petitcoursdemande', name='matieres', - field=models.ManyToManyField(related_name='demandes', verbose_name='Mati\xe8res', to='gestioncof.PetitCoursSubject'), + field=models.ManyToManyField(related_name='demandes', verbose_name='Mati\xe8res', to='cof.PetitCoursSubject'), ), migrations.AddField( model_name='petitcoursdemande', @@ -285,7 +285,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='petitcoursattributioncounter', name='matiere', - field=models.ForeignKey(verbose_name='Matiere', to='gestioncof.PetitCoursSubject'), + field=models.ForeignKey(verbose_name='Matiere', to='cof.PetitCoursSubject'), ), migrations.AddField( model_name='petitcoursattributioncounter', @@ -295,12 +295,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name='petitcoursattribution', name='demande', - field=models.ForeignKey(verbose_name='Demande', to='gestioncof.PetitCoursDemande'), + field=models.ForeignKey(verbose_name='Demande', to='cof.PetitCoursDemande'), ), migrations.AddField( model_name='petitcoursattribution', name='matiere', - field=models.ForeignKey(verbose_name='Mati\xe8re', to='gestioncof.PetitCoursSubject'), + field=models.ForeignKey(verbose_name='Mati\xe8re', to='cof.PetitCoursSubject'), ), migrations.AddField( model_name='petitcoursattribution', @@ -310,7 +310,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='petitcoursability', name='matiere', - field=models.ForeignKey(verbose_name='Mati\xe8re', to='gestioncof.PetitCoursSubject'), + field=models.ForeignKey(verbose_name='Mati\xe8re', to='cof.PetitCoursSubject'), ), migrations.AddField( model_name='petitcoursability', @@ -320,7 +320,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='eventcommentvalue', name='registration', - field=models.ForeignKey(related_name='comments', to='gestioncof.EventRegistration'), + field=models.ForeignKey(related_name='comments', to='cof.EventRegistration'), ), migrations.AlterUniqueTogether( name='surveyanswer', diff --git a/gestioncof/migrations/0002_enable_unprocessed_demandes.py b/cof/migrations/0002_enable_unprocessed_demandes.py similarity index 91% rename from gestioncof/migrations/0002_enable_unprocessed_demandes.py rename to cof/migrations/0002_enable_unprocessed_demandes.py index 18006588..43fca7ae 100644 --- a/gestioncof/migrations/0002_enable_unprocessed_demandes.py +++ b/cof/migrations/0002_enable_unprocessed_demandes.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0001_initial'), + ('cof', '0001_initial'), ] operations = [ diff --git a/gestioncof/migrations/0003_event_image.py b/cof/migrations/0003_event_image.py similarity index 87% rename from gestioncof/migrations/0003_event_image.py rename to cof/migrations/0003_event_image.py index 6d65b1a6..2f967f6a 100644 --- a/gestioncof/migrations/0003_event_image.py +++ b/cof/migrations/0003_event_image.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0002_enable_unprocessed_demandes'), + ('cof', '0002_enable_unprocessed_demandes'), ] operations = [ diff --git a/gestioncof/migrations/0004_registration_mail.py b/cof/migrations/0004_registration_mail.py similarity index 91% rename from gestioncof/migrations/0004_registration_mail.py rename to cof/migrations/0004_registration_mail.py index d72900bf..03685f3d 100644 --- a/gestioncof/migrations/0004_registration_mail.py +++ b/cof/migrations/0004_registration_mail.py @@ -5,7 +5,7 @@ from django.db import migrations def create_mail(apps, schema_editor): - CustomMail = apps.get_model("gestioncof", "CustomMail") + CustomMail = apps.get_model("cof", "CustomMail") db_alias = schema_editor.connection.alias if CustomMail.objects.filter(shortname="bienvenue").count() == 0: CustomMail.objects.using(db_alias).bulk_create([ @@ -24,7 +24,7 @@ def create_mail(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0003_event_image'), + ('cof', '0003_event_image'), ] operations = [ diff --git a/gestioncof/migrations/0005_encoding.py b/cof/migrations/0005_encoding.py similarity index 97% rename from gestioncof/migrations/0005_encoding.py rename to cof/migrations/0005_encoding.py index 4f565a5d..5b25cc2e 100644 --- a/gestioncof/migrations/0005_encoding.py +++ b/cof/migrations/0005_encoding.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0004_registration_mail'), + ('cof', '0004_registration_mail'), ] operations = [ diff --git a/gestioncof/migrations/0006_add_calendar.py b/cof/migrations/0006_add_calendar.py similarity index 97% rename from gestioncof/migrations/0006_add_calendar.py rename to cof/migrations/0006_add_calendar.py index 004d3602..3009ac4d 100644 --- a/gestioncof/migrations/0006_add_calendar.py +++ b/cof/migrations/0006_add_calendar.py @@ -10,7 +10,7 @@ class Migration(migrations.Migration): dependencies = [ ('bda', '0004_mails-rappel'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('gestioncof', '0005_encoding'), + ('cof', '0005_encoding'), ] operations = [ diff --git a/gestioncof/migrations/0007_alter_club.py b/cof/migrations/0007_alter_club.py similarity index 97% rename from gestioncof/migrations/0007_alter_club.py rename to cof/migrations/0007_alter_club.py index 324c59a6..ca1a6d0b 100644 --- a/gestioncof/migrations/0007_alter_club.py +++ b/cof/migrations/0007_alter_club.py @@ -8,7 +8,7 @@ from django.conf import settings class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0006_add_calendar'), + ('cof', '0006_add_calendar'), ] operations = [ diff --git a/gestioncof/migrations/0008_py3.py b/cof/migrations/0008_py3.py similarity index 98% rename from gestioncof/migrations/0008_py3.py rename to cof/migrations/0008_py3.py index 7d94d7ce..612d06ac 100644 --- a/gestioncof/migrations/0008_py3.py +++ b/cof/migrations/0008_py3.py @@ -5,14 +5,14 @@ from django.db import models, migrations def forwards(apps, schema_editor): - Profile = apps.get_model("gestioncof", "CofProfile") + Profile = apps.get_model("cof", "CofProfile") Profile.objects.update(comments="") class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0007_alter_club'), + ('cof', '0007_alter_club'), ] operations = [ diff --git a/gestioncof/__init__.py b/cof/migrations/__init__.py similarity index 100% rename from gestioncof/__init__.py rename to cof/migrations/__init__.py diff --git a/gestioncof/models.py b/cof/models.py similarity index 99% rename from gestioncof/models.py rename to cof/models.py index 01798180..7a9c3fe4 100644 --- a/gestioncof/models.py +++ b/cof/models.py @@ -12,7 +12,7 @@ from django.utils.encoding import python_2_unicode_compatible import django.utils.six as six from django.db.models.signals import post_save, post_delete -from gestioncof.petits_cours_models import choices_length +from .petits_cours_models import choices_length from bda.models import Spectacle diff --git a/gestioncof/petits_cours_models.py b/cof/petits_cours_models.py similarity index 100% rename from gestioncof/petits_cours_models.py rename to cof/petits_cours_models.py diff --git a/gestioncof/petits_cours_views.py b/cof/petits_cours_views.py similarity index 98% rename from gestioncof/petits_cours_views.py rename to cof/petits_cours_views.py index ee71d1a9..9dc8a576 100644 --- a/gestioncof/petits_cours_views.py +++ b/cof/petits_cours_views.py @@ -19,12 +19,12 @@ from django.conf import settings from django.contrib.auth.decorators import login_required from django.db.models import Min -from gestioncof.models import CofProfile -from gestioncof.petits_cours_models import PetitCoursDemande, \ +from .models import CofProfile +from .petits_cours_models import PetitCoursDemande, \ PetitCoursAttribution, PetitCoursAttributionCounter, PetitCoursAbility, \ PetitCoursSubject -from gestioncof.decorators import buro_required -from gestioncof.shared import lock_table, unlock_tables +from .decorators import buro_required +from .shared import lock_table, unlock_tables from captcha.fields import ReCaptchaField diff --git a/gestioncof/shared.py b/cof/shared.py similarity index 98% rename from gestioncof/shared.py rename to cof/shared.py index 8fe17d43..7c8b089b 100644 --- a/gestioncof/shared.py +++ b/cof/shared.py @@ -14,7 +14,7 @@ from django.db import connection from django.core.mail import send_mail from django.template import Template, Context -from gestioncof.models import CofProfile, CustomMail +from .models import CofProfile, CustomMail User = get_user_model() diff --git a/gestioncof/static/css/bootstrap.min.css b/cof/static/css/bootstrap.min.css similarity index 100% rename from gestioncof/static/css/bootstrap.min.css rename to cof/static/css/bootstrap.min.css diff --git a/gestioncof/static/css/bootstrap.min.css.map b/cof/static/css/bootstrap.min.css.map similarity index 100% rename from gestioncof/static/css/bootstrap.min.css.map rename to cof/static/css/bootstrap.min.css.map diff --git a/gestioncof/static/css/cof.css b/cof/static/css/cof.css similarity index 100% rename from gestioncof/static/css/cof.css rename to cof/static/css/cof.css diff --git a/gestioncof/static/css/droidserif.woff b/cof/static/css/droidserif.woff similarity index 100% rename from gestioncof/static/css/droidserif.woff rename to cof/static/css/droidserif.woff diff --git a/gestioncof/static/fonts/glyphicons-halflings-regular.eot b/cof/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from gestioncof/static/fonts/glyphicons-halflings-regular.eot rename to cof/static/fonts/glyphicons-halflings-regular.eot diff --git a/gestioncof/static/fonts/glyphicons-halflings-regular.svg b/cof/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from gestioncof/static/fonts/glyphicons-halflings-regular.svg rename to cof/static/fonts/glyphicons-halflings-regular.svg diff --git a/gestioncof/static/fonts/glyphicons-halflings-regular.ttf b/cof/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from gestioncof/static/fonts/glyphicons-halflings-regular.ttf rename to cof/static/fonts/glyphicons-halflings-regular.ttf diff --git a/gestioncof/static/fonts/glyphicons-halflings-regular.woff b/cof/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from gestioncof/static/fonts/glyphicons-halflings-regular.woff rename to cof/static/fonts/glyphicons-halflings-regular.woff diff --git a/gestioncof/static/fonts/glyphicons-halflings-regular.woff2 b/cof/static/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from gestioncof/static/fonts/glyphicons-halflings-regular.woff2 rename to cof/static/fonts/glyphicons-halflings-regular.woff2 diff --git a/gestioncof/static/images/no.png b/cof/static/images/no.png similarity index 100% rename from gestioncof/static/images/no.png rename to cof/static/images/no.png diff --git a/gestioncof/static/images/none.png b/cof/static/images/none.png similarity index 100% rename from gestioncof/static/images/none.png rename to cof/static/images/none.png diff --git a/gestioncof/static/images/yes.png b/cof/static/images/yes.png similarity index 100% rename from gestioncof/static/images/yes.png rename to cof/static/images/yes.png diff --git a/gestioncof/static/js/bootstrap.min.js b/cof/static/js/bootstrap.min.js similarity index 100% rename from gestioncof/static/js/bootstrap.min.js rename to cof/static/js/bootstrap.min.js diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/LICENSE b/cof/static/js/joequery-Stupid-Table-Plugin/LICENSE similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/LICENSE rename to cof/static/js/joequery-Stupid-Table-Plugin/LICENSE diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/README.md b/cof/static/js/joequery-Stupid-Table-Plugin/README.md similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/README.md rename to cof/static/js/joequery-Stupid-Table-Plugin/README.md diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/basic.html b/cof/static/js/joequery-Stupid-Table-Plugin/examples/basic.html similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/basic.html rename to cof/static/js/joequery-Stupid-Table-Plugin/examples/basic.html diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/colspan.html b/cof/static/js/joequery-Stupid-Table-Plugin/examples/colspan.html similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/colspan.html rename to cof/static/js/joequery-Stupid-Table-Plugin/examples/colspan.html diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/complex.html b/cof/static/js/joequery-Stupid-Table-Plugin/examples/complex.html similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/complex.html rename to cof/static/js/joequery-Stupid-Table-Plugin/examples/complex.html diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/large-table.html b/cof/static/js/joequery-Stupid-Table-Plugin/examples/large-table.html similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/examples/large-table.html rename to cof/static/js/joequery-Stupid-Table-Plugin/examples/large-table.html diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/stupidtable.js b/cof/static/js/joequery-Stupid-Table-Plugin/stupidtable.js similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/stupidtable.js rename to cof/static/js/joequery-Stupid-Table-Plugin/stupidtable.js diff --git a/gestioncof/static/js/joequery-Stupid-Table-Plugin/stupidtable.min.js b/cof/static/js/joequery-Stupid-Table-Plugin/stupidtable.min.js similarity index 100% rename from gestioncof/static/js/joequery-Stupid-Table-Plugin/stupidtable.min.js rename to cof/static/js/joequery-Stupid-Table-Plugin/stupidtable.min.js diff --git a/gestioncof/static/js/jquery.min.js b/cof/static/js/jquery.min.js similarity index 100% rename from gestioncof/static/js/jquery.min.js rename to cof/static/js/jquery.min.js diff --git a/gestioncof/templates/404.html b/cof/templates/404.html similarity index 100% rename from gestioncof/templates/404.html rename to cof/templates/404.html diff --git a/gestioncof/templates/500.html b/cof/templates/500.html similarity index 100% rename from gestioncof/templates/500.html rename to cof/templates/500.html diff --git a/gestioncof/templates/admin/base_site.html b/cof/templates/admin/base_site.html similarity index 100% rename from gestioncof/templates/admin/base_site.html rename to cof/templates/admin/base_site.html diff --git a/gestioncof/templates/admin/index.html b/cof/templates/admin/index.html similarity index 100% rename from gestioncof/templates/admin/index.html rename to cof/templates/admin/index.html diff --git a/gestioncof/templates/autocomplete_user.html b/cof/templates/autocomplete_user.html similarity index 100% rename from gestioncof/templates/autocomplete_user.html rename to cof/templates/autocomplete_user.html diff --git a/gestioncof/templates/base.html b/cof/templates/base.html similarity index 100% rename from gestioncof/templates/base.html rename to cof/templates/base.html diff --git a/gestioncof/templates/base_header.html b/cof/templates/base_header.html similarity index 78% rename from gestioncof/templates/base_header.html rename to cof/templates/base_header.html index baaa24b6..801783e8 100644 --- a/gestioncof/templates/base_header.html +++ b/cof/templates/base_header.html @@ -3,7 +3,7 @@ {% block content %}
diff --git a/gestioncof/templates/base_title.html b/cof/templates/base_title.html similarity index 100% rename from gestioncof/templates/base_title.html rename to cof/templates/base_title.html diff --git a/gestioncof/templates/base_title_petitscours.html b/cof/templates/base_title_petitscours.html similarity index 100% rename from gestioncof/templates/base_title_petitscours.html rename to cof/templates/base_title_petitscours.html diff --git a/gestioncof/templates/cof-denied.html b/cof/templates/cof-denied.html similarity index 100% rename from gestioncof/templates/cof-denied.html rename to cof/templates/cof-denied.html diff --git a/gestioncof/templates/gestioncof/calendar_subscription.html b/cof/templates/cof/calendar_subscription.html similarity index 95% rename from gestioncof/templates/gestioncof/calendar_subscription.html rename to cof/templates/cof/calendar_subscription.html index 75f4dbea..fca35ad8 100644 --- a/gestioncof/templates/gestioncof/calendar_subscription.html +++ b/cof/templates/cof/calendar_subscription.html @@ -20,7 +20,7 @@ souscrire aux événements du COF et/ou aux spectacles BdA. {% if token %}

Votre calendrier (compatible avec toutes les applications d'agenda) se trouve à -cette adresse.

+cette adresse.

  • Pour l'ajouter à Thunderbird (lightning), il faut copier ce lien et aller diff --git a/cof/templates/cof/utile_cof.html b/cof/templates/cof/utile_cof.html new file mode 100644 index 00000000..5741b7f1 --- /dev/null +++ b/cof/templates/cof/utile_cof.html @@ -0,0 +1,24 @@ +{% extends "base_title.html" %} + +{% block homelink %} +{% endblock %} + +{% block realcontent %} +

    Liens utiles du COF

    +

    COF

    + + +

    Mega

    + + +

    Note : pour ouvrir les fichiers .csv avec Excel, il faut + passer par Fichier > Importer et sélectionner la + virgule comme séparateur.

    +{% endblock %} diff --git a/gestioncof/templates/demande-petit-cours-raw.html b/cof/templates/demande-petit-cours-raw.html similarity index 71% rename from gestioncof/templates/demande-petit-cours-raw.html rename to cof/templates/demande-petit-cours-raw.html index c2fcf85a..7aab243a 100644 --- a/gestioncof/templates/demande-petit-cours-raw.html +++ b/cof/templates/demande-petit-cours-raw.html @@ -1,7 +1,7 @@ {% if success %}

    Votre demande a été enregistrée avec succès !

    {% else %} -
    + {% csrf_token %} {{ form.as_table }} diff --git a/gestioncof/templates/demande-petit-cours.html b/cof/templates/demande-petit-cours.html similarity index 92% rename from gestioncof/templates/demande-petit-cours.html rename to cof/templates/demande-petit-cours.html index 3a447e3a..e44f88e0 100644 --- a/gestioncof/templates/demande-petit-cours.html +++ b/cof/templates/demande-petit-cours.html @@ -5,7 +5,7 @@ {% if success %}

    Votre demande a été enregistrée avec succès !

    {% else %} - + {% csrf_token %}
    {{ form.as_table }} diff --git a/gestioncof/templates/details_demande_petit_cours.html b/cof/templates/details_demande_petit_cours.html similarity index 100% rename from gestioncof/templates/details_demande_petit_cours.html rename to cof/templates/details_demande_petit_cours.html diff --git a/gestioncof/templates/details_demande_petit_cours_infos.html b/cof/templates/details_demande_petit_cours_infos.html similarity index 100% rename from gestioncof/templates/details_demande_petit_cours_infos.html rename to cof/templates/details_demande_petit_cours_infos.html diff --git a/gestioncof/templates/error.html b/cof/templates/error.html similarity index 100% rename from gestioncof/templates/error.html rename to cof/templates/error.html diff --git a/gestioncof/templates/event.html b/cof/templates/event.html similarity index 87% rename from gestioncof/templates/event.html rename to cof/templates/event.html index cc7d96d0..f11d5e88 100644 --- a/gestioncof/templates/event.html +++ b/cof/templates/event.html @@ -8,7 +8,7 @@ {% if event.details %}

    {{ event.details }}

    {% endif %} - + {% csrf_token %} {{ form.as_p }} diff --git a/gestioncof/templates/event_status.html b/cof/templates/event_status.html similarity index 89% rename from gestioncof/templates/event_status.html rename to cof/templates/event_status.html index 2a09b820..9561af6b 100644 --- a/gestioncof/templates/event_status.html +++ b/cof/templates/event_status.html @@ -4,14 +4,14 @@ {% block page_size %}col-sm-8{% endblock %} {% block realcontent %} -

    Événement: {{ event.title }}{% if user.is_staff %} Administration{% endif %}

    +

    Événement: {{ event.title }}{% if user.is_staff %} Administration{% endif %}

    {% if event.details %}

    {{ event.details }}


    {% endif %} {% include "tristate_js.html" %}

    Filtres

    - + {% csrf_token %} {{ form.as_p }} diff --git a/gestioncof/templates/home.html b/cof/templates/home.html similarity index 85% rename from gestioncof/templates/home.html rename to cof/templates/home.html index c85cbbe1..5e9732c7 100644 --- a/gestioncof/templates/home.html +++ b/cof/templates/home.html @@ -13,7 +13,7 @@
    @@ -23,7 +23,7 @@
    @@ -54,10 +54,10 @@

    Divers

    @@ -71,16 +71,16 @@

    Général

  • Administration générale
  • Demandes de petits cours
  • -
  • Inscription d'un nouveau membre
  • +
  • Inscription d'un nouveau membre
  • Gestion des clubs
  • @@ -105,8 +105,8 @@

    Liens utiles

    diff --git a/gestioncof/templates/inscription-petit-cours-formset.html b/cof/templates/inscription-petit-cours-formset.html similarity index 100% rename from gestioncof/templates/inscription-petit-cours-formset.html rename to cof/templates/inscription-petit-cours-formset.html diff --git a/gestioncof/templates/inscription-petit-cours.html b/cof/templates/inscription-petit-cours.html similarity index 100% rename from gestioncof/templates/inscription-petit-cours.html rename to cof/templates/inscription-petit-cours.html diff --git a/gestioncof/templates/liste_clubs.html b/cof/templates/liste_clubs.html similarity index 100% rename from gestioncof/templates/liste_clubs.html rename to cof/templates/liste_clubs.html diff --git a/gestioncof/templates/liste_mails.html b/cof/templates/liste_mails.html similarity index 100% rename from gestioncof/templates/liste_mails.html rename to cof/templates/liste_mails.html diff --git a/gestioncof/templates/login.html b/cof/templates/login.html similarity index 93% rename from gestioncof/templates/login.html rename to cof/templates/login.html index 1cd1d25d..67b2134d 100644 --- a/gestioncof/templates/login.html +++ b/cof/templates/login.html @@ -15,7 +15,7 @@

    Identifiants incorrects.

    {% endif %} + action="{% url 'cof.views.login_ext' %}?next={{ next|urlencode }}"> {% csrf_token %}
    diff --git a/gestioncof/templates/login_switch.html b/cof/templates/login_switch.html similarity index 91% rename from gestioncof/templates/login_switch.html rename to cof/templates/login_switch.html index aa8a68c6..7945973e 100644 --- a/gestioncof/templates/login_switch.html +++ b/cof/templates/login_switch.html @@ -18,7 +18,7 @@
    + href="{% url 'cof.views.login_ext' %}?next={{ next|urlencode }}">
    Extérieur
    diff --git a/gestioncof/templates/membres_clubs.html b/cof/templates/membres_clubs.html similarity index 100% rename from gestioncof/templates/membres_clubs.html rename to cof/templates/membres_clubs.html diff --git a/gestioncof/templates/petits-cours-mail-demandeur.txt b/cof/templates/petits-cours-mail-demandeur.txt similarity index 100% rename from gestioncof/templates/petits-cours-mail-demandeur.txt rename to cof/templates/petits-cours-mail-demandeur.txt diff --git a/gestioncof/templates/petits-cours-mail-eleve.txt b/cof/templates/petits-cours-mail-eleve.txt similarity index 100% rename from gestioncof/templates/petits-cours-mail-eleve.txt rename to cof/templates/petits-cours-mail-eleve.txt diff --git a/gestioncof/templates/petits_cours_demandes_list.html b/cof/templates/petits_cours_demandes_list.html similarity index 100% rename from gestioncof/templates/petits_cours_demandes_list.html rename to cof/templates/petits_cours_demandes_list.html diff --git a/gestioncof/templates/profile.html b/cof/templates/profile.html similarity index 96% rename from gestioncof/templates/profile.html rename to cof/templates/profile.html index 7b185150..54bdb9b6 100644 --- a/gestioncof/templates/profile.html +++ b/cof/templates/profile.html @@ -8,7 +8,7 @@ {% if success %}

    Votre profil a été mis à jour avec succès !

    {% endif %} - +
    {% csrf_token %} diff --git a/gestioncof/templates/registration.html b/cof/templates/registration.html similarity index 95% rename from gestioncof/templates/registration.html rename to cof/templates/registration.html index 4f15a4b7..e3bf7e31 100644 --- a/gestioncof/templates/registration.html +++ b/cof/templates/registration.html @@ -17,7 +17,7 @@ // On attend que la page soit prête pour executer le code $(document).ready(function() { $('input#search_autocomplete').yourlabsAutocomplete({ - url: '{% url 'gestioncof.autocomplete.autocomplete' %}', + url: '{% url 'cof.autocomplete.autocomplete' %}', minimumCharacters: 1, id: 'search_autocomplete', choiceSelector: 'li:has(a)', diff --git a/gestioncof/templates/registration/password_change_done.html b/cof/templates/registration/password_change_done.html similarity index 65% rename from gestioncof/templates/registration/password_change_done.html rename to cof/templates/registration/password_change_done.html index f83a781b..2f2e4eea 100644 --- a/gestioncof/templates/registration/password_change_done.html +++ b/cof/templates/registration/password_change_done.html @@ -5,5 +5,5 @@ {% block realcontent %}

    Mot de passe modifié avec succès !

    -

    Retour au menu principal

    +

    Retour au menu principal

    {% endblock %} diff --git a/gestioncof/templates/registration/password_change_form.html b/cof/templates/registration/password_change_form.html similarity index 100% rename from gestioncof/templates/registration/password_change_form.html rename to cof/templates/registration/password_change_form.html diff --git a/gestioncof/templates/registration_form.html b/cof/templates/registration_form.html similarity index 96% rename from gestioncof/templates/registration_form.html rename to cof/templates/registration_form.html index 8668152b..6a798cc1 100644 --- a/gestioncof/templates/registration_form.html +++ b/cof/templates/registration_form.html @@ -7,7 +7,7 @@ {% else %}

    Inscription d'un nouveau compte (extérieur ?)

    {% endif %} - + {% csrf_token %}
    {{ user_form | bootstrap }} diff --git a/gestioncof/templates/registration_post.html b/cof/templates/registration_post.html similarity index 100% rename from gestioncof/templates/registration_post.html rename to cof/templates/registration_post.html diff --git a/gestioncof/templates/survey.html b/cof/templates/survey.html similarity index 95% rename from gestioncof/templates/survey.html rename to cof/templates/survey.html index 4d836545..7967deec 100644 --- a/gestioncof/templates/survey.html +++ b/cof/templates/survey.html @@ -15,7 +15,7 @@ {% if survey.details %}

    {{ survey.details }}

    {% endif %} - + {% csrf_token %} {{ form | bootstrap}} diff --git a/gestioncof/templates/survey_status.html b/cof/templates/survey_status.html similarity index 89% rename from gestioncof/templates/survey_status.html rename to cof/templates/survey_status.html index 831a07bb..2e8b28fd 100644 --- a/gestioncof/templates/survey_status.html +++ b/cof/templates/survey_status.html @@ -4,14 +4,14 @@ {% block page_size %}col-sm-8{% endblock %} {% block realcontent %} -

    Sondage: {{ survey.title }}{% if user.is_staff %} Administration{% endif %}

    +

    Sondage: {{ survey.title }}{% if user.is_staff %} Administration{% endif %}

    {% if survey.details %}

    {{ survey.details }}


    {% endif %}

    Filtres

    {% include "tristate_js.html" %} - + {% csrf_token %} {{ form.as_p }} diff --git a/gestioncof/templates/traitement_demande_petit_cours.html b/cof/templates/traitement_demande_petit_cours.html similarity index 100% rename from gestioncof/templates/traitement_demande_petit_cours.html rename to cof/templates/traitement_demande_petit_cours.html diff --git a/gestioncof/templates/traitement_demande_petit_cours_autre_niveau.html b/cof/templates/traitement_demande_petit_cours_autre_niveau.html similarity index 100% rename from gestioncof/templates/traitement_demande_petit_cours_autre_niveau.html rename to cof/templates/traitement_demande_petit_cours_autre_niveau.html diff --git a/gestioncof/templates/traitement_demande_petit_cours_success.html b/cof/templates/traitement_demande_petit_cours_success.html similarity index 100% rename from gestioncof/templates/traitement_demande_petit_cours_success.html rename to cof/templates/traitement_demande_petit_cours_success.html diff --git a/gestioncof/templates/tristate_js.html b/cof/templates/tristate_js.html similarity index 100% rename from gestioncof/templates/tristate_js.html rename to cof/templates/tristate_js.html diff --git a/gestioncof/templates/utile_bda.html b/cof/templates/utile_bda.html similarity index 54% rename from gestioncof/templates/utile_bda.html rename to cof/templates/utile_bda.html index 8948de97..83b96fb8 100644 --- a/gestioncof/templates/utile_bda.html +++ b/cof/templates/utile_bda.html @@ -7,7 +7,7 @@

    Liens utiles du BdA

    Listes mail

    {% endblock %} diff --git a/gestioncof/migrations/__init__.py b/cof/templatetags/__init__.py similarity index 100% rename from gestioncof/migrations/__init__.py rename to cof/templatetags/__init__.py diff --git a/gestioncof/templatetags/utils.py b/cof/templatetags/utils.py similarity index 100% rename from gestioncof/templatetags/utils.py rename to cof/templatetags/utils.py diff --git a/gestioncof/tests.py b/cof/tests.py similarity index 95% rename from gestioncof/tests.py rename to cof/tests.py index 66043daf..f411a917 100644 --- a/gestioncof/tests.py +++ b/cof/tests.py @@ -12,7 +12,7 @@ from __future__ import unicode_literals from django.test import TestCase -from gestioncof.models import CofProfile, User +from .models import CofProfile, User class SimpleTest(TestCase): diff --git a/cof/urls.py b/cof/urls.py index b4c4da3c..2f02354d 100644 --- a/cof/urls.py +++ b/cof/urls.py @@ -1,99 +1,61 @@ # -*- coding: utf-8 -*- -""" -Fichier principal de configuration des urls du projet GestioCOF -""" - from __future__ import division from __future__ import print_function from __future__ import unicode_literals -import autocomplete_light +from django.conf.urls import url +from .petits_cours_views import DemandeListView +from . import views, petits_cours_views -from django.conf import settings -from django.conf.urls import include, url -from django.conf.urls.static import static -from django.contrib import admin -from django.views.generic.base import TemplateView -from django.contrib.auth import views as django_views -from django_cas_ng import views as django_cas_views - -from gestioncof import views as gestioncof_views, csv_views -from gestioncof.urls import export_patterns, petitcours_patterns, \ - surveys_patterns, events_patterns, calendar_patterns, \ - clubs_patterns -from gestioncof.autocomplete import autocomplete - -autocomplete_light.autodiscover() -admin.autodiscover() - -urlpatterns = [ - # Page d'accueil - url(r'^$', gestioncof_views.home, name='home'), - # Le BdA - url(r'^bda/', include('bda.urls')), - # Les exports - url(r'^export/', include(export_patterns)), - # Les petits cours - url(r'^petitcours/', include(petitcours_patterns)), - # Les sondages - url(r'^survey/', include(surveys_patterns)), - # Evenements - url(r'^event/', include(events_patterns)), - # Calendrier - url(r'^calendar/', include(calendar_patterns)), - # Clubs - url(r'^clubs/', include(clubs_patterns)), - # Authentification - url(r'^cof/denied$', TemplateView.as_view(template_name='cof-denied.html'), - name="cof-denied"), - url(r'^cas/login$', django_cas_views.login, name="cas_login_view"), - url(r'^cas/logout$', django_cas_views.logout), - url(r'^outsider/login$', gestioncof_views.login_ext), - url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}), - url(r'^login$', gestioncof_views.login, name="cof-login"), - url(r'^logout$', gestioncof_views.logout), - # Infos persos - url(r'^profile$', gestioncof_views.profile), - url(r'^outsider/password-change$', django_views.password_change), - url(r'^outsider/password-change-done$', - django_views.password_change_done, - name='password_change_done'), - # Inscription d'un nouveau membre - url(r'^registration$', gestioncof_views.registration), - url(r'^registration/clipper/(?P[\w-]+)$', - gestioncof_views.registration_form2, name="clipper-registration"), - url(r'^registration/user/(?P.+)$', - gestioncof_views.registration_form2, name="user-registration"), - url(r'^registration/empty$', gestioncof_views.registration_form2, - name="empty-registration"), - # Autocompletion - url(r'^autocomplete/registration$', autocomplete), - url(r'^autocomplete/', include('autocomplete_light.urls')), - # Interface admin - url(r'^admin/logout/', gestioncof_views.logout), - url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', - csv_views.admin_list_export, - {'fields': ['username', ]}), - url(r'^admin/', include(admin.site.urls)), - url(r'^grappelli/', include('grappelli.urls')), - # Liens utiles du COF et du BdA - url(r'^utile_cof$', gestioncof_views.utile_cof), - url(r'^utile_bda$', gestioncof_views.utile_bda), - url(r'^utile_bda/bda_diff$', gestioncof_views.liste_bdadiff), - url(r'^utile_cof/diff_cof$', gestioncof_views.liste_diffcof), - url(r'^utile_bda/bda_revente$', gestioncof_views.liste_bdarevente), - url(r'^k-fet/', include('kfet.urls')), +export_patterns = [ + url(r'^members$', views.export_members), + url(r'^mega/avecremarques$', views.export_mega_remarksonly), + url(r'^mega/participants$', views.export_mega_participants), + url(r'^mega/orgas$', views.export_mega_orgas), + url(r'^mega/(?P.+)$', views.export_mega_bytype), + url(r'^mega$', views.export_mega), ] -if settings.DEBUG: - import debug_toolbar - urlpatterns += [ - url(r'^__debug__/', include(debug_toolbar.urls)), - ] +petitcours_patterns = [ + url(r'^inscription$', petits_cours_views.inscription, + name='petits-cours-inscription'), + url(r'^demande$', petits_cours_views.demande, + name='petits-cours-demande'), + url(r'^demande-raw$', petits_cours_views.demande_raw, + name='petits-cours-demande-raw'), + url(r'^demandes$', DemandeListView.as_view(), + name='petits-cours-demandes-list'), + url(r'^demandes/(?P\d+)$', + petits_cours_views.details, + name='petits-cours-demande-details'), + url(r'^demandes/(?P\d+)/traitement$', + petits_cours_views.traitement, + name='petits-cours-demande-traitement'), + url(r'^demandes/(?P\d+)/retraitement$', + petits_cours_views.retraitement, + name='petits-cours-demande-retraitement'), +] - # Si on est en production, MEDIA_ROOT est servi par Apache. - # Il faut dire à Django de servir MEDIA_ROOT lui-même en développement. - urlpatterns += static(settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT) +surveys_patterns = [ + url(r'^(?P\d+)/status$', views.survey_status), + url(r'^(?P\d+)$', views.survey), +] + +events_patterns = [ + url(r'^(?P\d+)$', views.event), + url(r'^(?P\d+)/status$', views.event_status), +] + +calendar_patterns = [ + url(r'^subscription$', 'cof.views.calendar'), + url(r'^(?P[a-z0-9-]+)/calendar.ics$', + 'cof.views.calendar_ics') +] + +clubs_patterns = [ + url(r'^membres/(?P\w+)', views.membres_club, name='membres-club'), + url(r'^liste', views.liste_clubs, name='liste-clubs'), + url(r'^change_respo/(?P\w+)/(?P\d+)', + views.change_respo, name='change-respo'), +] diff --git a/gestioncof/views.py b/cof/views.py similarity index 97% rename from gestioncof/views.py rename to cof/views.py index 7c49559a..5958e732 100644 --- a/gestioncof/views.py +++ b/cof/views.py @@ -18,16 +18,16 @@ from django.contrib.sites.models import Site from django.utils import timezone import django.utils.six as six -from gestioncof.models import Survey, SurveyAnswer, SurveyQuestion, \ +from .models import Survey, SurveyAnswer, SurveyQuestion, \ SurveyQuestionAnswer -from gestioncof.models import Event, EventRegistration, EventOption, \ +from .models import Event, EventRegistration, EventOption, \ EventOptionChoice -from gestioncof.models import EventCommentField, EventCommentValue, \ +from .models import EventCommentField, EventCommentValue, \ CalendarSubscription -from gestioncof.shared import send_custom_mail -from gestioncof.models import CofProfile, Clipper, Club -from gestioncof.decorators import buro_required, cof_required -from gestioncof.forms import UserProfileForm, EventStatusFilterForm, \ +from .shared import send_custom_mail +from .models import CofProfile, Clipper, Club +from .decorators import buro_required, cof_required +from .forms import UserProfileForm, EventStatusFilterForm, \ SurveyForm, SurveyStatusFilterForm, RegistrationUserForm, \ RegistrationProfileForm, EventForm, CalendarForm, EventFormset, \ RegistrationPassUserForm, ClubsForm @@ -53,7 +53,7 @@ def home(request): def login(request): if request.user.is_authenticated(): - return redirect("gestioncof.views.home") + return redirect("cof.views.home") context = {} if request.method == "GET" and 'next' in request.GET: context['next'] = request.GET['next'] @@ -637,7 +637,7 @@ def export_mega(request): @buro_required def utile_cof(request): - return render(request, "gestioncof/utile_cof.html", {}) + return render(request, "cof/utile_cof.html", {}) @buro_required @@ -686,15 +686,15 @@ def calendar(request): subscription.token = uuid.uuid4() subscription.save() form.save_m2m() - return render(request, "gestioncof/calendar_subscription.html", + return render(request, "cof/calendar_subscription.html", {'form': form, 'success': True, 'token': str(subscription.token)}) else: - return render(request, "gestioncof/calendar_subscription.html", + return render(request, "cof/calendar_subscription.html", {'form': form, 'error': "Formulaire incorrect"}) else: - return render(request, "gestioncof/calendar_subscription.html", + return render(request, "cof/calendar_subscription.html", {'form': CalendarForm(instance=instance), 'token': instance.token if instance else None}) diff --git a/gestioncof/widgets.py b/cof/widgets.py similarity index 100% rename from gestioncof/widgets.py rename to cof/widgets.py diff --git a/gestioncof/templatetags/__init__.py b/gestioCOF/__init__.py similarity index 100% rename from gestioncof/templatetags/__init__.py rename to gestioCOF/__init__.py diff --git a/cof/asgi.py b/gestioCOF/asgi.py similarity index 100% rename from cof/asgi.py rename to gestioCOF/asgi.py diff --git a/gestioCOF/locale/__init__.py b/gestioCOF/locale/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestioCOF/locale/fr/__init__.py b/gestioCOF/locale/fr/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cof/locale/fr/formats.py b/gestioCOF/locale/fr/formats.py similarity index 100% rename from cof/locale/fr/formats.py rename to gestioCOF/locale/fr/formats.py diff --git a/cof/routing.py b/gestioCOF/routing.py similarity index 100% rename from cof/routing.py rename to gestioCOF/routing.py diff --git a/cof/settings_dev.py b/gestioCOF/settings_dev.py similarity index 95% rename from cof/settings_dev.py rename to gestioCOF/settings_dev.py index f6521222..9c1f6347 100644 --- a/cof/settings_dev.py +++ b/gestioCOF/settings_dev.py @@ -31,7 +31,6 @@ DEBUG = True # Application definition INSTALLED_APPS = ( - 'gestioncof', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -41,15 +40,18 @@ INSTALLED_APPS = ( 'grappelli', 'django.contrib.admin', 'django.contrib.admindocs', - 'bda', 'autocomplete_light', 'captcha', 'django_cas_ng', 'debug_toolbar', 'bootstrapform', - 'kfet', 'channels', 'widget_tweaks', + 'bda', + 'bds', + 'cof', + 'gestion', + 'kfet', ) MIDDLEWARE_CLASSES = ( @@ -65,7 +67,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.security.SecurityMiddleware', ) -ROOT_URLCONF = 'cof.urls' +ROOT_URLCONF = 'gestioCOF.urls' TEMPLATES = [ { @@ -81,15 +83,13 @@ TEMPLATES = [ 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', - 'gestioncof.shared.context_processor', + 'cof.shared.context_processor', 'kfet.context_processors.auth', ], }, }, ] -# WSGI_APPLICATION = 'cof.wsgi.application' - # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases @@ -158,7 +158,7 @@ CAS_REDIRECT_URL = '/' CAS_EMAIL_FORMAT = "%s@clipper.ens.fr" AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', - 'gestioncof.shared.COFCASBackend', + 'cof.shared.COFCASBackend', 'kfet.backends.GenericTeamBackend', ) @@ -176,7 +176,7 @@ CHANNEL_LAYERS = { "CONFIG": { "hosts": [(os.environ.get("REDIS_HOST", "localhost"), 6379)], }, - "ROUTING": "cof.routing.channel_routing", + "ROUTING": "gestioCOF.routing.channel_routing", } } @@ -198,4 +198,4 @@ DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR_CALLBACK': show_toolbar, } -FORMAT_MODULE_PATH = 'cof.locale' +FORMAT_MODULE_PATH = 'gestioCOF.locale' diff --git a/gestioCOF/urls.py b/gestioCOF/urls.py new file mode 100644 index 00000000..08418f1f --- /dev/null +++ b/gestioCOF/urls.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- + +""" +Fichier principal de configuration des urls du projet GestioCOF +""" + +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import autocomplete_light + +from django.conf import settings +from django.conf.urls import include, url +from django.conf.urls.static import static +from django.contrib import admin +from django.views.generic.base import TemplateView +from django.contrib.auth import views as django_views +from django_cas_ng import views as django_cas_views + +from cof import views as cof_views, csv_views +from cof.urls import export_patterns, petitcours_patterns, \ + surveys_patterns, events_patterns, calendar_patterns, \ + clubs_patterns +from cof.autocomplete import autocomplete + +autocomplete_light.autodiscover() +admin.autodiscover() + +urlpatterns = [ + # Page d'accueil + url(r'^$', cof_views.home, name='home'), + # Le BdA + url(r'^bda/', include('bda.urls')), + # Les exports + url(r'^export/', include(export_patterns)), + # Les petits cours + url(r'^petitcours/', include(petitcours_patterns)), + # Les sondages + url(r'^survey/', include(surveys_patterns)), + # Evenements + url(r'^event/', include(events_patterns)), + # Calendrier + url(r'^calendar/', include(calendar_patterns)), + # Clubs + url(r'^clubs/', include(clubs_patterns)), + # Authentification + url(r'^cof/denied$', TemplateView.as_view(template_name='cof-denied.html'), + name="cof-denied"), + url(r'^cas/login$', django_cas_views.login, name="cas_login_view"), + url(r'^cas/logout$', django_cas_views.logout), + url(r'^outsider/login$', cof_views.login_ext), + url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}), + url(r'^login$', cof_views.login, name="cof-login"), + url(r'^logout$', cof_views.logout), + # Infos persos + url(r'^profile$', cof_views.profile), + url(r'^outsider/password-change$', django_views.password_change), + url(r'^outsider/password-change-done$', + django_views.password_change_done, + name='password_change_done'), + # Inscription d'un nouveau membre + url(r'^registration$', cof_views.registration), + url(r'^registration/clipper/(?P[\w-]+)$', + cof_views.registration_form2, name="clipper-registration"), + url(r'^registration/user/(?P.+)$', + cof_views.registration_form2, name="user-registration"), + url(r'^registration/empty$', cof_views.registration_form2, + name="empty-registration"), + # Autocompletion + url(r'^autocomplete/registration$', autocomplete), + url(r'^autocomplete/', include('autocomplete_light.urls')), + # Interface admin + url(r'^admin/logout/', cof_views.logout), + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', + csv_views.admin_list_export, + {'fields': ['username', ]}), + url(r'^admin/', include(admin.site.urls)), + url(r'^grappelli/', include('grappelli.urls')), + # Liens utiles du COF et du BdA + url(r'^utile_cof$', cof_views.utile_cof), + url(r'^utile_bda$', cof_views.utile_bda), + url(r'^utile_bda/bda_diff$', cof_views.liste_bdadiff), + url(r'^utile_cof/diff_cof$', cof_views.liste_diffcof), + url(r'^utile_bda/bda_revente$', cof_views.liste_bdarevente), + url(r'^k-fet/', include('kfet.urls')), +] + +if settings.DEBUG: + import debug_toolbar + urlpatterns += [ + url(r'^__debug__/', include(debug_toolbar.urls)), + ] + + # Si on est en production, MEDIA_ROOT est servi par Apache. + # Il faut dire à Django de servir MEDIA_ROOT lui-même en développement. + urlpatterns += static(settings.MEDIA_URL, + document_root=settings.MEDIA_ROOT) diff --git a/gestion/__init__.py b/gestion/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestion/admin.py b/gestion/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/gestion/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/gestion/migrations/__init__.py b/gestion/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gestion/models.py b/gestion/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/gestion/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/gestion/tests.py b/gestion/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/gestion/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/gestion/views.py b/gestion/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/gestion/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/gestioncof/templates/gestioncof/utile_cof.html b/gestioncof/templates/gestioncof/utile_cof.html deleted file mode 100644 index ae024949..00000000 --- a/gestioncof/templates/gestioncof/utile_cof.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "base_title.html" %} - -{% block homelink %} -{% endblock %} - -{% block realcontent %} -

    Liens utiles du COF

    -

    COF

    - - -

    Mega

    - - -

    Note : pour ouvrir les fichiers .csv avec Excel, il faut - passer par Fichier > Importer et sélectionner la - virgule comme séparateur.

    -{% endblock %} diff --git a/gestioncof/urls.py b/gestioncof/urls.py deleted file mode 100644 index ad108005..00000000 --- a/gestioncof/urls.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -from django.conf.urls import url -from gestioncof.petits_cours_views import DemandeListView -from gestioncof import views, petits_cours_views - -export_patterns = [ - url(r'^members$', views.export_members), - url(r'^mega/avecremarques$', views.export_mega_remarksonly), - url(r'^mega/participants$', views.export_mega_participants), - url(r'^mega/orgas$', views.export_mega_orgas), - url(r'^mega/(?P.+)$', views.export_mega_bytype), - url(r'^mega$', views.export_mega), -] - -petitcours_patterns = [ - url(r'^inscription$', petits_cours_views.inscription, - name='petits-cours-inscription'), - url(r'^demande$', petits_cours_views.demande, - name='petits-cours-demande'), - url(r'^demande-raw$', petits_cours_views.demande_raw, - name='petits-cours-demande-raw'), - url(r'^demandes$', DemandeListView.as_view(), - name='petits-cours-demandes-list'), - url(r'^demandes/(?P\d+)$', - petits_cours_views.details, - name='petits-cours-demande-details'), - url(r'^demandes/(?P\d+)/traitement$', - petits_cours_views.traitement, - name='petits-cours-demande-traitement'), - url(r'^demandes/(?P\d+)/retraitement$', - petits_cours_views.retraitement, - name='petits-cours-demande-retraitement'), -] - -surveys_patterns = [ - url(r'^(?P\d+)/status$', views.survey_status), - url(r'^(?P\d+)$', views.survey), -] - -events_patterns = [ - url(r'^(?P\d+)$', views.event), - url(r'^(?P\d+)/status$', views.event_status), -] - -calendar_patterns = [ - url(r'^subscription$', 'gestioncof.views.calendar'), - url(r'^(?P[a-z0-9-]+)/calendar.ics$', - 'gestioncof.views.calendar_ics') -] - -clubs_patterns = [ - url(r'^membres/(?P\w+)', views.membres_club, name='membres-club'), - url(r'^liste', views.liste_clubs, name='liste-clubs'), - url(r'^change_respo/(?P\w+)/(?P\d+)', - views.change_respo, name='change-respo'), -] diff --git a/kfet/autocomplete.py b/kfet/autocomplete.py index 2a24a51e..ffdfd72c 100644 --- a/kfet/autocomplete.py +++ b/kfet/autocomplete.py @@ -7,7 +7,7 @@ from builtins import * from django.shortcuts import render from django.http import Http404 from django.db.models import Q -from gestioncof.models import User, Clipper +from cof.models import User, Clipper from kfet.decorators import teamkfet_required from kfet.models import Account diff --git a/kfet/backends.py b/kfet/backends.py index ba3bce9d..a6a2bb23 100644 --- a/kfet/backends.py +++ b/kfet/backends.py @@ -7,7 +7,7 @@ from builtins import * import hashlib from django.contrib.auth.models import User, Permission -from gestioncof.models import CofProfile +from cof.models import CofProfile from kfet.models import Account, GenericTeamToken class KFetBackend(object): diff --git a/kfet/forms.py b/kfet/forms.py index 0c563b04..e68a0d20 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -16,7 +16,7 @@ from django.utils import timezone from kfet.models import (Account, Checkout, Article, OperationGroup, Operation, CheckoutStatement, ArticleCategory, Settings, AccountNegative, Transfer, TransferGroup, Supplier, Inventory, InventoryArticle) -from gestioncof.models import CofProfile +from cof.models import CofProfile # ----- # Widgets diff --git a/kfet/migrations/0001_initial.py b/kfet/migrations/0001_initial.py index 8f9b14fa..84d81205 100644 --- a/kfet/migrations/0001_initial.py +++ b/kfet/migrations/0001_initial.py @@ -10,7 +10,7 @@ import datetime class Migration(migrations.Migration): dependencies = [ - ('gestioncof', '0007_alter_club'), + ('cof', '0007_alter_club'), ] operations = [ @@ -24,7 +24,7 @@ class Migration(migrations.Migration): ('promo', models.IntegerField(null=True, blank=True, choices=[(1980, 1980), (1981, 1981), (1982, 1982), (1983, 1983), (1984, 1984), (1985, 1985), (1986, 1986), (1987, 1987), (1988, 1988), (1989, 1989), (1990, 1990), (1991, 1991), (1992, 1992), (1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016)], default=2015)), ('nickname', models.CharField(max_length=255, blank=True, default='')), ('password', models.CharField(max_length=255, blank=True, null=True, unique=True, default=None)), - ('cofprofile', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='account_kfet', to='gestioncof.CofProfile')), + ('cofprofile', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='account_kfet', to='cof.CofProfile')), ], ), migrations.CreateModel( diff --git a/kfet/models.py b/kfet/models.py index 419cd0a0..b2e56d49 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -9,7 +9,7 @@ from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied, ValidationError from django.core.validators import RegexValidator from django.contrib.auth.models import User -from gestioncof.models import CofProfile +from cof.models import CofProfile from django.utils.six.moves import reduce from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible diff --git a/kfet/templates/kfet/base_nav.html b/kfet/templates/kfet/base_nav.html index b5c98375..79a7bd96 100644 --- a/kfet/templates/kfet/base_nav.html +++ b/kfet/templates/kfet/base_nav.html @@ -51,7 +51,7 @@ {% endif %} {% if user.is_authenticated %} -
  • +
  • {% endif %} diff --git a/kfet/views.py b/kfet/views.py index 7083d489..6da59430 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -22,7 +22,7 @@ from django.db.models import F, Sum, Prefetch, Count, Func from django.db.models.functions import Coalesce from django.utils import timezone from django.utils.crypto import get_random_string -from gestioncof.models import CofProfile, Clipper +from cof.models import CofProfile, Clipper from kfet.decorators import teamkfet_required from kfet.models import (Account, Checkout, Article, Settings, AccountNegative, CheckoutStatement, GenericTeamToken, Supplier, SupplierArticle, Inventory, diff --git a/provisioning/bootstrap.sh b/provisioning/bootstrap.sh index 413c445e..04234e2d 100644 --- a/provisioning/bootstrap.sh +++ b/provisioning/bootstrap.sh @@ -36,7 +36,7 @@ chown -R ubuntu:www-data /var/www/static # Mise en place du .bash_profile pour tout configurer lors du `vagrant ssh` cat >> ~ubuntu/.bashrc <