From 28a747ac17e7b3017cccfb0546a04e659e62e7ba Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sat, 10 Aug 2019 19:00:16 +0200 Subject: [PATCH] start frontend --- note_kfet/settings.py | 11 +- static/css/base.css | 17 +++ templates/base.html | 106 ++++++++++++++++++ .../note/transaction_form.html | 22 +--- templates/registration/logged_out.html | 16 +++ templates/registration/login.html | 8 ++ .../registration/password_change_done.html | 11 ++ .../registration/password_change_form.html | 11 ++ .../registration/password_reset_complete.html | 11 ++ .../registration/password_reset_confirm.html | 11 ++ .../registration/password_reset_done.html | 11 ++ .../registration/password_reset_email.html | 13 +++ .../registration/password_reset_form.html | 11 ++ 13 files changed, 235 insertions(+), 24 deletions(-) create mode 100644 static/css/base.css create mode 100644 templates/base.html rename {note/templates => templates}/note/transaction_form.html (66%) create mode 100644 templates/registration/logged_out.html create mode 100644 templates/registration/login.html create mode 100644 templates/registration/password_change_done.html create mode 100644 templates/registration/password_change_form.html create mode 100644 templates/registration/password_reset_complete.html create mode 100644 templates/registration/password_reset_confirm.html create mode 100644 templates/registration/password_reset_done.html create mode 100644 templates/registration/password_reset_email.html create mode 100644 templates/registration/password_reset_form.html diff --git a/note_kfet/settings.py b/note_kfet/settings.py index 3f7554b1..c7814b10 100644 --- a/note_kfet/settings.py +++ b/note_kfet/settings.py @@ -30,13 +30,12 @@ ALLOWED_HOSTS = [] INSTALLED_APPS = [ # Theme overrides Django Admin templates - 'theme', + # 'theme', # External apps 'polymorphic', 'guardian', 'reversion', - # Django contrib 'django.contrib.admin', 'django.contrib.admindocs', @@ -71,7 +70,7 @@ ROOT_URLCONF = 'note_kfet.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [os.path.join(BASE_DIR,'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -150,7 +149,11 @@ USE_TZ = True # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/var/www/example.com/static/" -STATIC_ROOT = os.path.join(BASE_DIR, 'static') +STATIC_ROOT = os.path.realpath(__file__) +STATICFILES_DIRS = [ + os.path.join(BASE_DIR,'static')] + +CRISPY_TEMPLATE_PACK = 'bootstrap4' # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" diff --git a/static/css/base.css b/static/css/base.css new file mode 100644 index 00000000..0407d419 --- /dev/null +++ b/static/css/base.css @@ -0,0 +1,17 @@ +/* Footer en bas */ +html { + position: relative; + min-height: 100%; +} +body { + margin-bottom: 70px; /* Margin bottom by footer height */ +} +.footer { + position: absolute; + bottom: 0; + width: 100%; + height: 60px; /* Set the fixed height of the footer here */ + line-height: 60px; /* Vertically center the text there */ + background-color: #f5f5f5; +} +/* Affichage des accords dans les interlignes */ diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 00000000..12fe5548 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,106 @@ +{% load static %} + + + + + + +{% block title %}NoteKfet2020{% endblock title %} + + + + +{% block css %} + + + + +{% endblock %} + + + +
+ +
+
+
+ +
+
+ {% block content %} +

Default content...

+ {% endblock content %} + +
+
+
+
+ + + {% block javascript %} + + + + + + + + + + + {% endblock javascript %} + + + diff --git a/note/templates/note/transaction_form.html b/templates/note/transaction_form.html similarity index 66% rename from note/templates/note/transaction_form.html rename to templates/note/transaction_form.html index ebd805bb..ff8504bc 100644 --- a/note/templates/note/transaction_form.html +++ b/templates/note/transaction_form.html @@ -1,28 +1,10 @@ -{% extends "admin/base_site.html" %} +{% extends "base.html" %} {% comment %} SPDX-License-Identifier: GPL-2.0-or-later {% endcomment %} {% load i18n static %} -{% block breadcrumbs %} - -{% endblock %} - -{% block extrahead %}{{ block.super }} - {# Load Django Admin widgets #} - - - {{ form.media }} -{% endblock %} - -{% block extrastyle %}{{ block.super }} - -{% endblock %} - {% block content %}
{% csrf_token %} {% if form.non_field_errors %} @@ -52,4 +34,4 @@ SPDX-License-Identifier: GPL-2.0-or-later
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html new file mode 100644 index 00000000..48949e84 --- /dev/null +++ b/templates/registration/logged_out.html @@ -0,0 +1,16 @@ +{% extends "registration/logged_out.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +

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

+

{% trans 'Log in again' %}

+{% endblock %} \ No newline at end of file diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 00000000..8d10a1b9 --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,8 @@ +{% extends "admin/login.html" %} +{% comment %} +SPDX-License-Identifier: GPL-2.0-or-later +{% endcomment %} + +{% load i18n %} + +{% block title %}{% trans "Log in" %}{% endblock %} \ No newline at end of file diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 00000000..d42fbfd9 --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,11 @@ +{% extends "registration/password_change_done.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html new file mode 100644 index 00000000..07ab38c9 --- /dev/null +++ b/templates/registration/password_change_form.html @@ -0,0 +1,11 @@ +{% extends "registration/password_change_form.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 00000000..f0ec4b8f --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,11 @@ +{% extends "registration/password_reset_complete.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 00000000..62a761d5 --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,11 @@ +{% extends "registration/password_reset_confirm.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html new file mode 100644 index 00000000..ea67e596 --- /dev/null +++ b/templates/registration/password_reset_done.html @@ -0,0 +1,11 @@ +{% extends "registration/password_reset_done.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/registration/password_reset_email.html b/templates/registration/password_reset_email.html new file mode 100644 index 00000000..f43d80c3 --- /dev/null +++ b/templates/registration/password_reset_email.html @@ -0,0 +1,13 @@ +{% load i18n %}{% autoescape off %} +{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} +{% endblock %} + +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} + +{% endautoescape %} diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html new file mode 100644 index 00000000..865d5160 --- /dev/null +++ b/templates/registration/password_reset_form.html @@ -0,0 +1,11 @@ +{% extends "registration/password_reset_form.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %}