diff --git a/apps/tbde/admin.py b/apps/tbde/admin.py index 2cf498f..dfe2a34 100644 --- a/apps/tbde/admin.py +++ b/apps/tbde/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.utils.translation import gettext_lazy as _ -from tbde.models import Ticket, Reward +from .models import Ticket, Reward @admin.register(Ticket) diff --git a/apps/tbde/urls.py b/apps/tbde/urls.py index 1033d16..ed649ea 100644 --- a/apps/tbde/urls.py +++ b/apps/tbde/urls.py @@ -1 +1,9 @@ # Copyright (C) 2020 by BDE ENS Paris-Saclay + +from django.urls import path + +from .views import TombolaView + +urlpatterns = [ + path('', TombolaView.as_view()), +] \ No newline at end of file diff --git a/apps/tbde/views.py b/apps/tbde/views.py new file mode 100644 index 0000000..b749b6b --- /dev/null +++ b/apps/tbde/views.py @@ -0,0 +1,7 @@ +# Copyright (C) 2020 by BDE ENS Paris-Saclay + +from django.views.generic import TemplateView + + +class TombolaView(TemplateView): + template_name = "tombola.html" diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..9d71463 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,127 @@ +{% load static i18n %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} + + + + + + + {% block title %}{{ title }}{% endblock title %} - {{ request.site.name }} + + + + {# Favicon #} + + + + + + + + + + {% if no_cache %} + + {% endif %} + + {# Bootstrap CSS #} + + + + {# JQuery, Bootstrap and Turbolinks JavaScript #} + + + + + + {# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #} + {% if form.media %} + {{ form.media }} + {% endif %} + + {% block extracss %}{% endblock %} + + +
+ +
+ {% block contenttitle %}

{{ title }}

{% endblock %} + {% block content %} +

Default content...

+ {% endblock content %} +
+
+ + +{% block extrajavascript %} +{% endblock extrajavascript %} + + diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html new file mode 100644 index 0000000..3b044b7 --- /dev/null +++ b/templates/registration/logged_out.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block content %} +

{% trans "Thanks for spending some quality time with the Web site today." %}

+

{% trans 'Log in again' %}

+{% endblock %} diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..04ef8d7 --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-2.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} + +{% block title %}{% trans "Log in" %}{% endblock %} +{% block contenttitle %}

{% trans "Log in" %}

{% endblock %} + +{% block content %} + {% if user.is_authenticated %} +

+ {% blocktrans trimmed %} + You are authenticated as {{ username }}, but are not authorized to + access this page. Would you like to login to a different account? + {% endblocktrans %} +

+ {% endif %} + +
{% csrf_token %} + {{ form | crispy }} + + {% trans 'Forgotten your password or username?' %} +
+{% endblock %} diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 0000000..150a00e --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block content %} +

{% trans 'Your password was changed.' %}

+{% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html new file mode 100644 index 0000000..01133e4 --- /dev/null +++ b/templates/registration/password_change_form.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} + +{% block content %} +
{% csrf_token %} +

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

+ {{ form | crispy }} + +
+{% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..bb91a3c --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block content %} +

{% trans "Your password has been set. You may go ahead and log in now." %}

+

+ {% trans 'Log in' %} +

+{% endblock %} diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..5db0e81 --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} + +{% block content %} + {% if validlink %} +

{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

+
{% csrf_token %} + {{ form | crispy }} + +
+ {% else %} +

{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

+ {% endif %} +{% endblock %} diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html new file mode 100644 index 0000000..a215ab9 --- /dev/null +++ b/templates/registration/password_reset_done.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block content %} +

{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}

+

{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}

+{% endblock %} diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html new file mode 100644 index 0000000..61adaa9 --- /dev/null +++ b/templates/registration/password_reset_form.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} + +{% block content %} +

{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}

+
{% csrf_token %} + {{ form | crispy }} + +
+{% endblock %} diff --git a/templates/tombola.html b/templates/tombola.html new file mode 100644 index 0000000..621dc7c --- /dev/null +++ b/templates/tombola.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% load i18n static %} + +{# Remove page title #} +{% block contenttitle %}{% endblock %} + +{% block content %} + +{% endblock %} + diff --git a/tombola/urls.py b/tombola/urls.py index a3e1ad5..126ed1d 100644 --- a/tombola/urls.py +++ b/tombola/urls.py @@ -15,9 +15,13 @@ Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ + from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ + path('accounts/', include('django.contrib.auth.urls')), + path('i18n/', include('django.conf.urls.i18n')), path('admin/', admin.site.urls), + path('', include('tbde.urls')), ]