Unverified Commit b7b87017 authored by Julien Palard's avatar Julien Palard
Browse files

Rename references to app.

parent ffbff482
......@@ -50,7 +50,7 @@ pip install -r requirements.txt
./manage.py migrate
./manage.py loaddata initial # To get some users and exercises
# (Initial data can be updated using:
./manage.py dumpdata -e contenttypes -e sessions -o website/fixtures/initial.json)
./manage.py dumpdata -e contenttypes -e sessions -o hkis/fixtures/initial.json)
./manage.py createsuperuser
./manage.py runserver
```
......
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import website.routing
import hkis.routing
application = ProtocolTypeRouter(
{
"websocket": AuthMiddlewareStack(
URLRouter(website.routing.websocket_urlpatterns)
),
"websocket": AuthMiddlewareStack(URLRouter(hkis.routing.websocket_urlpatterns)),
}
)
......@@ -37,7 +37,7 @@ INTERNAL_DOMAINS = ["www.hackinscience.org"]
# Application definition
INSTALLED_APPS = [
"website",
"hkis",
"moulinette",
"registration",
"modeltranslation",
......@@ -119,8 +119,8 @@ TEMPLATES = [
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"website.context_processors.version",
"website.context_processors.menu",
"hkis.context_processors.version",
"hkis.context_processors.menu",
]
},
}
......@@ -179,7 +179,7 @@ STATIC_URL = "/static/"
# Django registration
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_FORM = "website.forms.HkisRegistrationForm"
REGISTRATION_FORM = "hkis.forms.HkisRegistrationForm"
LOGIN_REDIRECT_URL = "/exercises/"
LOGOUT_REDIRECT_URL = "/"
......@@ -279,7 +279,7 @@ ALLOWED_STYLES: List[str] = []
GIT_HEAD = "master" # Changed in production to the current commit hash, can be used for static file invalidation.
AUTH_USER_MODEL = "website.User"
AUTH_USER_MODEL = "hkis.User"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
......
......@@ -5,7 +5,7 @@ from django.urls import path, include
urlpatterns = [
path("", include("website.urls")),
path("admin/", admin.site.urls),
path("__debug__/", include(debug_toolbar.urls)),
path("", include("hkis.urls")),
]
......@@ -7,7 +7,7 @@ from django_ace import AceWidget
from modeltranslation.admin import TranslationAdmin
from website.models import (
from hkis.models import (
Answer,
Exercise,
Snippet,
......
......@@ -5,7 +5,7 @@ from django_filters import rest_framework as filters
from rest_framework import viewsets, response, serializers, routers, permissions
import django_filters
from website.models import Answer, Exercise, Snippet, User, Category, Page
from hkis.models import Answer, Exercise, Snippet, User, Category, Page
class DjangoModelPermissionsStrict(permissions.DjangoModelPermissions):
......@@ -275,7 +275,7 @@ class ExerciseViewSet(viewsets.ModelViewSet):
class CanViewAnswer(permissions.DjangoModelPermissions):
def has_permission(self, request, view):
return request.user.has_perm("website.view_answer")
return request.user.has_perm("hkis.view_answer")
router = routers.DefaultRouter()
......
......@@ -2,4 +2,4 @@ from django.apps import AppConfig
class WebsiteConfig(AppConfig):
name = "website"
name = "hkis"
......@@ -8,9 +8,9 @@ from channels.generic.websocket import AsyncJsonWebsocketConsumer
from django.utils.timezone import now
from moulinette.tasks import check_answer, run_snippet
from website.models import Answer, Exercise, Snippet, User
from website.utils import markdown_to_bootstrap
from website.serializers import AnswerSerializer, SnippetSerializer
from hkis.models import Answer, Exercise, Snippet, User
from hkis.utils import markdown_to_bootstrap
from hkis.serializers import AnswerSerializer, SnippetSerializer
logger = logging.getLogger(__name__)
......
from django.conf import settings
from website.models import Page
from hkis.models import Page
def version(request):
......
This diff is collapsed.
......@@ -2,7 +2,7 @@ from django import forms
from django.utils.translation import gettext_lazy as _
from django_ace import AceWidget
from registration.forms import RegistrationForm
from website.models import Answer
from hkis.models import Answer
class AnswerForm(forms.ModelForm):
......
......@@ -18,61 +18,61 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 2.4.1\n"
#: website/admin.py:207
#: hkis/admin.py:207
msgid "team"
msgstr "équipe"
#: website/admin.py:224
#: hkis/admin.py:224
msgid "exercise author"
msgstr "auteur de l'exercice"
#: website/admin.py:228
#: hkis/admin.py:228
msgid "My exercises only"
msgstr "Mes exercices"
#: website/forms.py:28
#: hkis/forms.py:28
msgid "E-mail (optional)"
msgstr "E-mail (facultatif)"
#: website/models.py:212
#: hkis/models.py:212
msgid "Exercises should have a check script in order to be published."
msgstr "Un exercice doit avoir une moulinette de correction pour être publié."
#: website/models.py:216
#: hkis/models.py:216
msgid "Exercises should have a wording in order to be published."
msgstr "Un exercice doit contenir un sujet avant d'être publié."
#: website/models.py:433
#: hkis/models.py:433
msgid "Pending"
msgstr "En attente d'approbation"
#: website/models.py:434
#: hkis/models.py:434
msgid "Member"
msgstr "Membre"
#: website/models.py:435
#: hkis/models.py:435
msgid "Staff"
msgstr "Staff"
#: website/templates/hkis/answer_form.html:8
#: website/templates/registration/registration_form.html:9
#: hkis/templates/hkis/answer_form.html:8
#: hkis/templates/registration/registration_form.html:9
msgid "Submit"
msgstr "Envoyer"
#: website/templates/hkis/base.html:8
#: hkis/templates/hkis/base.html:8
msgid "Welcome!"
msgstr "Bienvenue !"
#: website/templates/hkis/exercise.html:50
#: hkis/templates/hkis/exercise.html:50
msgid "Instructions"
msgstr "Énoncé"
#: website/templates/hkis/exercise.html:61
#: hkis/templates/hkis/exercise.html:61
#, python-format
msgid "Created by %(first_name)s %(last_name)s"
msgstr "Par %(first_name)s %(last_name)s"
#: website/templates/hkis/exercise.html:70
#: hkis/templates/hkis/exercise.html:70
msgid ""
"\n"
" There's no corrections yet, hit the `Submit` button to send "
......@@ -80,31 +80,31 @@ msgid ""
" "
msgstr "\nIl n'y a pas encore de message de corretion pour cet exercice. Cliquez sur le bouton « Envoyer » pour envoyer votre code à la moulinette de correction."
#: website/templates/hkis/exercise.html:75
#: hkis/templates/hkis/exercise.html:75
msgid "Keyboard shortcuts:"
msgstr "Raccourcis claviers :"
#: website/templates/hkis/exercise.html:77
#: hkis/templates/hkis/exercise.html:77
msgid "Ctrl-Enter: Send your code to the correction bot."
msgstr "Ctrl-Entrée : Envoie votre code à la moulinette de correction."
#: website/templates/hkis/exercise.html:78
#: hkis/templates/hkis/exercise.html:78
msgid "Escape: Get back to the instructions tab."
msgstr "Échap. : Retourne sur l'énoncé."
#: website/templates/hkis/exercise.html:96
#: hkis/templates/hkis/exercise.html:96
msgid "Submit (Ctrl-Enter)"
msgstr "Envoyer (Ctrl-Entrée)"
#: website/templates/hkis/exercise.html:102
#: hkis/templates/hkis/exercise.html:102
msgid "See solutions"
msgstr "Voir les solutions"
#: website/templates/hkis/index.html:4
#: hkis/templates/hkis/index.html:4
msgid "Python Exercises"
msgstr "Exercices Python"
#: website/templates/hkis/index.html:32
#: hkis/templates/hkis/index.html:32
msgid ""
"Hackinscience is an interactive Python exercise platform: <br/>\n"
" Write code, get instant feedback from our correction bot <br/>\n"
......@@ -118,47 +118,47 @@ msgstr ""
" avec des informations détaillées de ce qui s'est mal passé afin "
"d'éviter tout blocage."
#: website/templates/hkis/index.html:36 website/templates/hkis/layout.html:44
#: website/templates/registration/login.html:19
#: hkis/templates/hkis/index.html:36 website/templates/hkis/layout.html:44
#: hkis/templates/registration/login.html:19
msgid "Sign in"
msgstr "Connexion"
#: website/templates/hkis/index.html:37
#: hkis/templates/hkis/index.html:37
msgid "Sign up"
msgstr "Inscription"
#: website/templates/hkis/layout.html:23
#: website/templates/hkis/leaderboard.html:4
#: hkis/templates/hkis/layout.html:23
#: hkis/templates/hkis/leaderboard.html:4
msgid "Leaderboard"
msgstr "Classement"
#: website/templates/hkis/layout.html:26 website/templates/hkis/teams.html:4
#: website/templates/hkis/teams.html:10
#: hkis/templates/hkis/layout.html:26 website/templates/hkis/teams.html:4
#: hkis/templates/hkis/teams.html:10
msgid "Teams"
msgstr "Équipes"
#: website/templates/hkis/layout.html:32
#: hkis/templates/hkis/layout.html:32
msgid "Profile"
msgstr "Profil"
#: website/templates/hkis/layout.html:36
#: hkis/templates/hkis/layout.html:36
msgid "Admin"
msgstr "Admin"
#: website/templates/hkis/layout.html:42
#: hkis/templates/hkis/layout.html:42
msgid "Log out"
msgstr "Déconnexion"
#: website/templates/hkis/page.html:39
#: hkis/templates/hkis/page.html:39
#, python-format
msgid "Solved by %(nb)s"
msgstr "Résolu %(nb)s fois"
#: website/templates/hkis/profile_update.html:7
#: hkis/templates/hkis/profile_update.html:7
msgid "Statistics"
msgstr "Statistiques"
#: website/templates/hkis/profile_update.html:9
#: hkis/templates/hkis/profile_update.html:9
#, python-format
msgid ""
"You subscribed on %(date_joined)s, and sent %(submit_qty)s answers to the "
......@@ -167,7 +167,7 @@ msgstr ""
"Vous avez rejoint hackinscience le %(date_joined)s, et envoyé %(submit_qty)s "
"réponses à la moulinette de correction."
#: website/templates/hkis/profile_update.html:15
#: hkis/templates/hkis/profile_update.html:15
#, python-format
msgid ""
"You resolved %(done_qty)s exercises, that's %(done_pct)s of all exercises."
......@@ -175,7 +175,7 @@ msgstr ""
"Vous avez résolu %(done_qty)s exercices, c'est %(done_pct)s de tous les "
"exercices."
#: website/templates/hkis/profile_update.html:21
#: hkis/templates/hkis/profile_update.html:21
#, python-format
msgid ""
"You have %(points)s points which ranks you %(rank)s over %(participants)s "
......@@ -184,17 +184,17 @@ msgstr ""
"Vous avez %(points)s points, ce qui vous classe %(rank)s sur "
"%(participants)s participants."
#: website/templates/hkis/profile_update.html:25
#: hkis/templates/hkis/profile_update.html:25
msgid "You're not ranked yet."
msgstr "Vous n'êtes pas encore classé."
#: website/templates/hkis/profile_update.html:35
#: hkis/templates/hkis/profile_update.html:35
msgid "You're not in a team, but you can join or create one!"
msgstr ""
"Vous n'êtes dans aucune équipe, mais pous pouvez en rejoindre ou en créer "
"une !"
#: website/templates/hkis/profile_update.html:42
#: hkis/templates/hkis/profile_update.html:42
#, python-format
msgid ""
"You're almost in the <a href=\"%(url)s\">%(name)s</a> team (waiting for "
......@@ -203,152 +203,152 @@ msgstr ""
"Vous êtes presque dans l'équipe <a href=\"%(url)s\">%(name)s</a> (en attente "
"d'approbation)."
#: website/templates/hkis/profile_update.html:47
#: hkis/templates/hkis/profile_update.html:47
#, python-format
msgid "You're staff in the <a href=\"%(url)s\">%(name)s</a> team."
msgstr "Vous êtes staff dans l'équipe <a href=\"%(url)s\">%(name)s</a>."
#: website/templates/hkis/profile_update.html:52
#: hkis/templates/hkis/profile_update.html:52
#, python-format
msgid "You're in the <a href=\"%(url)s\">%(name)s</a> team."
msgstr "Vous êtes membre de <a href=\"%(url)s\">%(name)s</a>."
#: website/templates/hkis/profile_update.html:59
#: hkis/templates/hkis/profile_update.html:59
msgid "Leave team"
msgstr "Quitter l'équipe"
#: website/templates/hkis/profile_update.html:68
#: hkis/templates/hkis/profile_update.html:68
msgid "Join team"
msgstr "Rejoindre l'équipe"
#: website/templates/hkis/profile_update.html:91
#: hkis/templates/hkis/profile_update.html:91
msgid "Personal informations"
msgstr "Informations personnelles"
#: website/templates/hkis/profile_update.html:104
#: hkis/templates/hkis/profile_update.html:104
msgid "Change your password"
msgstr "Changer de mot de passe"
#: website/templates/hkis/profile_update.html:106
#: hkis/templates/hkis/profile_update.html:106
msgid "Update"
msgstr "Mettre à jour"
#: website/templates/hkis/solutions.html:22
#: hkis/templates/hkis/solutions.html:22
msgid "Solutions for exercise:"
msgstr "Solutions de l'exercice :"
#: website/templates/hkis/solutions.html:24
#: hkis/templates/hkis/solutions.html:24
msgid "Shared solutions"
msgstr "Les solutions partagées"
#: website/templates/hkis/solutions.html:50
#: hkis/templates/hkis/solutions.html:50
#, python-format
msgid "Solution shared by %(username)s on %(date)s:"
msgstr "Solution partagée par %(username)s le %(date)s :"
#: website/templates/hkis/solutions.html:62
#: hkis/templates/hkis/solutions.html:62
msgid "No solution shared yet :("
msgstr "Aucun solution partagée pour le moment :("
#: website/templates/hkis/solutions.html:65
#: hkis/templates/hkis/solutions.html:65
msgid "(You're not allowed to see them until you resolved the exercise.)"
msgstr ""
"(Vous n'êtes pas autorisé à les voir tant que vous n'avez pas résolu "
"l'exercice.)"
#: website/templates/hkis/solutions.html:68
#: hkis/templates/hkis/solutions.html:68
msgid "My answers"
msgstr "Mes réponses"
#: website/templates/hkis/solutions.html:70
#: hkis/templates/hkis/solutions.html:70
msgid "You haven't submitted anything for this exercise yet."
msgstr "Vous n'avez pas envoyé de réponse pour cet exercice pour le moment."
#: website/templates/hkis/solutions.html:95
#: hkis/templates/hkis/solutions.html:95
#, python-format
msgid "Submitted on %(date)s:"
msgstr "Envoyé le %(date)s :"
#: website/templates/hkis/solutions.html:112
#: hkis/templates/hkis/solutions.html:112
msgid "Unshare it"
msgstr "Annuler le partage"
#: website/templates/hkis/solutions.html:119
#: hkis/templates/hkis/solutions.html:119
msgid "Share it with other students!"
msgstr "Partagez votre solution avec les autres !"
#: website/templates/hkis/solutions.html:126
#: hkis/templates/hkis/solutions.html:126
msgid "Delete this answer"
msgstr "Supprimer cette réponse"
#: website/templates/hkis/team.html:4 website/templates/hkis/team.html:10
#: hkis/templates/hkis/team.html:4 website/templates/hkis/team.html:10
#, python-format
msgid "Team %(name)s"
msgstr "Équipe %(name)s"
#: website/templates/hkis/team.html:53
#: hkis/templates/hkis/team.html:53
msgid "Remove"
msgstr "Exclure"
#: website/templates/hkis/team.html:61
#: hkis/templates/hkis/team.html:61
msgid "Accept"
msgstr "Accepter"
#: website/templates/hkis/team.html:67
#: hkis/templates/hkis/team.html:67
msgid "Reject"
msgstr "Rejeter"
#: website/templates/registration/login.html:4
#: hkis/templates/registration/login.html:4
msgid "Sign in to Hackinscience"
msgstr "Se connecter à Hackinscience"
#: website/templates/registration/login.html:16
#: hkis/templates/registration/login.html:16
msgid "Forgot your password?"
msgstr "Mot de passe oublié ?"
#: website/templates/registration/login.html:25
#: hkis/templates/registration/login.html:25
msgid "New to Hackinscience?"
msgstr "Nouveau sur Hackinscience ?"
#: website/templates/registration/login.html:25
#: hkis/templates/registration/login.html:25
msgid "Create an account."
msgstr "Créer un compte."
#: website/templates/registration/password_change_form.html:4
#: website/templates/registration/password_change_form.html:8
#: hkis/templates/registration/password_change_form.html:4
#: hkis/templates/registration/password_change_form.html:8
msgid "Change password"
msgstr "Changer de mot de passe"
#: website/templates/registration/password_change_form.html:9
#: website/templates/registration/registration_form.html:10
#: hkis/templates/registration/password_change_form.html:9
#: hkis/templates/registration/registration_form.html:10
msgid "Back"
msgstr "Retour"
#: website/templates/registration/password_reset_confirm.html:10
#: hkis/templates/registration/password_reset_confirm.html:10
msgid "Confirm password reset"
msgstr "Confirmer le changement de mot de passe"
#: website/templates/registration/password_reset_confirm.html:14
#: hkis/templates/registration/password_reset_confirm.html:14
msgid "Enter your new password below to reset your password:"
msgstr "Entrez votre nouveau mot de passe ci-dessous pour le réinitialiser :"
#: website/templates/registration/password_reset_confirm.html:18
#: hkis/templates/registration/password_reset_confirm.html:18
msgid "Set password"
msgstr "Changer le mot de passe"
#: website/templates/registration/password_reset_confirm.html:22
#: hkis/templates/registration/password_reset_confirm.html:22
msgid ""
"Password reset unsuccessful. Please <a href=\"{{ url }}\">try again.</a>"
msgstr ""
"Le reset du mot de passe a échoué. Merci <a href=\"{{ url }}\">de réessayer."
"</a>"
#: website/templates/registration/password_reset_form.html:4
#: website/templates/registration/password_reset_form.html:10
#: hkis/templates/registration/password_reset_form.html:4
#: hkis/templates/registration/password_reset_form.html:10
msgid "Reset password"
msgstr "Réinitiation de mot de passe"
#: website/templates/registration/registration_form.html:4
#: hkis/templates/registration/registration_form.html:4
msgid "Register"
msgstr "S'enregistrer"
......
......@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: website/static/js/exercise.js:34
#: hkis/static/js/exercise.js:34
msgid ""
"This will send this answer to a human for manual review, so it can be "
"enhanced, are you sure?"
......@@ -25,23 +25,23 @@ msgstr ""
"Cette réponse sera envoyée à un human pour relecture, dans l'espoir de "
"l'améliorer. L'envoyer maintenant ?"
#: website/static/js/exercise.js:49
#: hkis/static/js/exercise.js:49
msgid "Waiting for correction..."
msgstr "Correction en cours…"
#: website/static/js/exercise.js:63
#: hkis/static/js/exercise.js:63
msgid "Your new <a href=\"%(url)s\">rank</a> is: %(new_rank)s"
msgstr ""
"Votre êtes maintenant %(new_rank)sème au <a href=\"%(url)s\">classement</a>."
#: website/static/js/exercise.js:70
#: hkis/static/js/exercise.js:70
#, javascript-format
msgid "<a href=\"%s\">Login</a> to backup your code and progression."
msgstr ""
"<a href=\"%s\">Connectez-vous</a> pour sauvegarder votre code et votre "
"progression."
#: website/static/js/exercise.js:78
#: hkis/static/js/exercise.js:78
msgid ""
"Flag this answer as particularly unhelpfull,\n"
"It'll be reviewed by a human."
......@@ -49,38 +49,38 @@ msgstr ""
"Marquer cette correction comme particulièrement innutile,\n"
"un humain passera la relire."
#: website/static/js/exercise.js:81
#: hkis/static/js/exercise.js:81
msgid "Report as unhelpfull"
msgstr "Signaler comme peu utile"
#: website/static/js/exercise.js:88
#: hkis/static/js/exercise.js:88
msgid "Reported"
msgstr "Signalé"
#: website/static/js/exercise.js:89
#: hkis/static/js/exercise.js:89
msgid "Thanks for the feedback!"
msgstr "Merci, je regarde ça bientôt !"
#: website/static/js/exercise.js:116
#: hkis/static/js/exercise.js:116
msgid "Connecting to correction server…"
msgstr "Connexion au serveur de correction en cours…"
#: website/static/js/exercise.js:130
#: hkis/static/js/exercise.js:130
msgid "Connected to correction server."
msgstr "Connecté au serveur de correction!"
#: website/static/js/exercise.js:141
#: hkis/static/js/exercise.js:141
msgid "Connection to correction server lost, will retry in 5s…"
msgstr ""
"La connexion au serveur de correction a échouée. Nouvelle tentative dans 5s…"
#: website/static/js/exercise.js:144
#: hkis/static/js/exercise.js:144
msgid "Cannot connect to correction server, will retry in 5s…"
msgstr ""
"Impossible de se connecter au serveur de correction. Nouvelle tentative dans "
"5s…"
#: website/static/js/exercise.js:213
#: hkis/static/js/exercise.js:213
msgid "Are you sure you want to delete this answer?"
msgstr "Êtes-vous sûr de vouloir supprimer cette réponse ?"
......
from django.core.management.base import BaseCommand
from website.models import Exercise
from hkis.models import Exercise
from django.db.models import Min
......
from django.core.management.base import BaseCommand
from website.models import User, Team
from hkis.models import User, Team