Merge branch 'develop_login'
This commit is contained in:
commit
249517a58b
0
ofu_app/apps/registration/__init__.py
Normal file
0
ofu_app/apps/registration/__init__.py
Normal file
3
ofu_app/apps/registration/admin.py
Normal file
3
ofu_app/apps/registration/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
5
ofu_app/apps/registration/apps.py
Normal file
5
ofu_app/apps/registration/apps.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class RegistrationConfig(AppConfig):
|
||||||
|
name = 'apps.registration'
|
||||||
11
ofu_app/apps/registration/forms.py
Normal file
11
ofu_app/apps/registration/forms.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from django import forms
|
||||||
|
from django.contrib.auth.forms import UserCreationForm
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
|
class SignUpForm(UserCreationForm):
|
||||||
|
email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = User
|
||||||
|
fields = ('username', 'email', 'password1', 'password2', )
|
||||||
27
ofu_app/apps/registration/migrations/0001_initial.py
Normal file
27
ofu_app/apps/registration/migrations/0001_initial.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.2 on 2017-10-29 11:07
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Profile',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('email_confirmed', models.BooleanField(default=False)),
|
||||||
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
0
ofu_app/apps/registration/migrations/__init__.py
Normal file
0
ofu_app/apps/registration/migrations/__init__.py
Normal file
17
ofu_app/apps/registration/models.py
Normal file
17
ofu_app/apps/registration/models.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from django.db import models
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
from django.db.models.signals import post_save
|
||||||
|
from django.dispatch import receiver
|
||||||
|
|
||||||
|
|
||||||
|
class Profile(models.Model):
|
||||||
|
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||||
|
email_confirmed = models.BooleanField(default=False)
|
||||||
|
# other fields...
|
||||||
|
|
||||||
|
|
||||||
|
@receiver(post_save, sender=User)
|
||||||
|
def update_user_profile(sender, instance, created, **kwargs):
|
||||||
|
if created:
|
||||||
|
Profile.objects.create(user=instance)
|
||||||
|
instance.profile.save()
|
||||||
3
ofu_app/apps/registration/tests.py
Normal file
3
ofu_app/apps/registration/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
11
ofu_app/apps/registration/tokens.py
Normal file
11
ofu_app/apps/registration/tokens.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||||
|
from django.utils import six
|
||||||
|
|
||||||
|
class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
|
||||||
|
def _make_hash_value(self, user, timestamp):
|
||||||
|
return (
|
||||||
|
six.text_type(user.pk) + six.text_type(timestamp) +
|
||||||
|
six.text_type(user.profile.email_confirmed)
|
||||||
|
)
|
||||||
|
|
||||||
|
account_activation_token = AccountActivationTokenGenerator()
|
||||||
9
ofu_app/apps/registration/urls.py
Normal file
9
ofu_app/apps/registration/urls.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from django.conf.urls import url
|
||||||
|
from apps.registration import views as core_views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
url(r'^$', core_views.signup, name='signup'),
|
||||||
|
url(r'^account_activation_sent/$', core_views.account_activation_sent, name='account_activation_sent'),
|
||||||
|
url(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
|
||||||
|
core_views.activate, name='activate'),
|
||||||
|
]
|
||||||
58
ofu_app/apps/registration/views.py
Normal file
58
ofu_app/apps/registration/views.py
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
from django.contrib.sites.shortcuts import get_current_site
|
||||||
|
from django.shortcuts import render, redirect
|
||||||
|
from django.utils.encoding import force_bytes
|
||||||
|
from django.utils.http import urlsafe_base64_encode
|
||||||
|
from django.template.loader import render_to_string
|
||||||
|
from apps.registration.forms import SignUpForm
|
||||||
|
from apps.registration.tokens import account_activation_token
|
||||||
|
from django.contrib.auth import login
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
from django.utils.encoding import force_text
|
||||||
|
from django.utils.http import urlsafe_base64_decode
|
||||||
|
from django.core.mail import send_mail
|
||||||
|
from django.shortcuts import HttpResponse
|
||||||
|
|
||||||
|
|
||||||
|
def signup(request):
|
||||||
|
if request.method == 'POST':
|
||||||
|
form = SignUpForm(request.POST)
|
||||||
|
if form.is_valid():
|
||||||
|
user = form.save(commit=False)
|
||||||
|
user.is_active = False
|
||||||
|
user.save()
|
||||||
|
current_site = request.META['HTTP_HOST']
|
||||||
|
subject = 'Activate Your MySite Account'
|
||||||
|
message = render_to_string('registration/account_activation_email.jinja', {
|
||||||
|
'user': user,
|
||||||
|
'domain': current_site,
|
||||||
|
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
|
||||||
|
'token': account_activation_token.make_token(user),
|
||||||
|
})
|
||||||
|
|
||||||
|
send_mail(from_email="signup.basta@gmail.com", recipient_list=[user.email], subject=subject,
|
||||||
|
message=message)
|
||||||
|
return redirect('account_activation_sent')
|
||||||
|
else:
|
||||||
|
form = SignUpForm()
|
||||||
|
return render(request, 'registration/signup.jinja', {'form': form})
|
||||||
|
|
||||||
|
|
||||||
|
def activate(request, uidb64, token):
|
||||||
|
try:
|
||||||
|
uid = force_text(urlsafe_base64_decode(uidb64))
|
||||||
|
user = User.objects.get(pk=uid)
|
||||||
|
except (TypeError, ValueError, OverflowError, User.DoesNotExist):
|
||||||
|
user = None
|
||||||
|
|
||||||
|
if user is not None and account_activation_token.check_token(user, token):
|
||||||
|
user.is_active = True
|
||||||
|
user.profile.email_confirmed = True
|
||||||
|
user.save()
|
||||||
|
login(request, user)
|
||||||
|
return render(request, 'registration/account_activation_success.jinja')
|
||||||
|
else:
|
||||||
|
return render(request, 'registration/account_activation_invalid.jinja')
|
||||||
|
|
||||||
|
|
||||||
|
def account_activation_sent(request):
|
||||||
|
return render(request, 'registration/account_activation_sent.jinja', {})
|
||||||
0
ofu_app/ofu_app/models.py
Normal file
0
ofu_app/ofu_app/models.py
Normal file
@ -34,14 +34,18 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'django.contrib.sites',
|
||||||
'django_jinja',
|
'django_jinja',
|
||||||
'apps.food',
|
'apps.food',
|
||||||
'apps.events',
|
'apps.events',
|
||||||
'apps.donar',
|
'apps.donar',
|
||||||
|
'apps.registration',
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'analytical',
|
'analytical',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SITE_ID = 1
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'DEFAULT_PERMISSION_CLASSES': [
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
'rest_framework.permissions.IsAdminUser',
|
'rest_framework.permissions.IsAdminUser',
|
||||||
@ -59,7 +63,6 @@ REST_FRAMEWORK = {
|
|||||||
# ]
|
# ]
|
||||||
|
|
||||||
ROOT_URLCONF = 'ofu_app.urls'
|
ROOT_URLCONF = 'ofu_app.urls'
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django_jinja.backend.Jinja2',
|
'BACKEND': 'django_jinja.backend.Jinja2',
|
||||||
@ -162,5 +165,19 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|||||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
|
|
||||||
|
# monitoring
|
||||||
PIWIK_DOMAIN_PATH = 'mg-server.ddns.net/piwik'
|
PIWIK_DOMAIN_PATH = 'mg-server.ddns.net/piwik'
|
||||||
PIWIK_SITE_ID = '1'
|
PIWIK_SITE_ID = '1'
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = 'home'
|
||||||
|
|
||||||
|
# Sign Up E-Mail authentication
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
|
EMAIL_HOST = 'smtp.gmail.com'
|
||||||
|
EMAIL_HOST_USER = 'signup.basta@gmail.com'
|
||||||
|
EMAIL_HOST_PASSWORD = '1\SL^QzlSuP<`8gkP4Fd'
|
||||||
|
EMAIL_PORT = '587'
|
||||||
|
EMAIL_USE_TLS = True
|
||||||
|
|
||||||
|
ACCOUNT_EMAIL_UNIQUE = True
|
||||||
|
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = True
|
||||||
|
|||||||
@ -15,10 +15,15 @@ Including another URLconf
|
|||||||
"""
|
"""
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.contrib.auth import views as auth_views
|
||||||
from ofu_app import views
|
from ofu_app import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
url(r'^login/$', auth_views.login, {'template_name': 'registration/login.jinja'}, name='login'),
|
||||||
|
url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'^admin/', admin.site.urls),
|
||||||
|
# url(r'^signup/$', core_views.signup, name='signup'),
|
||||||
|
url(r"^account/", include("apps.registration.urls")),
|
||||||
|
|
||||||
url(r'^$', views.home, name="home"),
|
url(r'^$', views.home, name="home"),
|
||||||
# -- Apps --
|
# -- Apps --
|
||||||
|
|||||||
@ -55,12 +55,7 @@
|
|||||||
|
|
||||||
#menu-button {
|
#menu-button {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 12px;;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu-button i {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,51 +40,56 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-2">
|
<div class="col-2 text-center m-auto">
|
||||||
|
{% if request.user.is_authenticated() %}
|
||||||
|
<a href="{{ url('logout') }}"><i class="fa fa-user" aria-hidden="true"></i></a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ url('login') }}"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8 pt-2">
|
||||||
{% block headline %}{% endblock %}</div>
|
{% block headline %}{% endblock %}</div>
|
||||||
<div class="col-2">
|
<div class="col-2 text-center m-auto">
|
||||||
<div id="menu-button"><i class="fa fa-bars" aria-hidden="true"></i>
|
<div id="menu-button"><i class="fa fa-bars" aria-hidden="true"></i>
|
||||||
{{ nav.main_nav() }}
|
{{ nav.main_nav() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% block bottom_nav %}{% endblock %}
|
<div class="row">{% block bottom_nav %}{% endblock %}</div>
|
||||||
<div class="container-fluid bg-dark text-white">
|
<div class="test row bg-dark text-white">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block test %}
|
{% block test %}
|
||||||
<div class="text-center bg-warning pb-2" style="font-size: 12px !important;">
|
<div class="row text-center bg-warning pb-2 pl-3 pr-3" style="font-size: 12px !important;">
|
||||||
<p>Hinweis: Diese Seite dient <strong>nur</strong> zu Testzwecken.
|
<div class="col-12 text-center">
|
||||||
|
Hinweis: Diese Seite dient <strong>nur</strong> zu Testzwecken.
|
||||||
Wir garantieren weder die Vollständigkeit, noch
|
Wir garantieren weder die Vollständigkeit, noch
|
||||||
die Korrektheit der dargestellten Daten.</p>
|
die Korrektheit der dargestellten Daten.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<footer>
|
<footer>
|
||||||
<div class="container-fluid bg-dark text-white">
|
<div class="row bg-dark text-white">
|
||||||
<div class="row pt-2 text-center">
|
<div class="col-6">
|
||||||
<div class="col">
|
<p class="text-right mb-0"><a href="{{ url('impressum') }}#bug-report">Bug Report</a></p>
|
||||||
<p class="text-right"><a href="{{ url('impressum') }}#bug-report">Bug Report</a></p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col-6">
|
||||||
<p class="text-left"><a href="{{ url('impressum') }}">Impressum</a></p>
|
<p class="text-left mb-0"><a href="{{ url('impressum') }}">Impressum</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row text-center">
|
<div class="row text-center bg-dark text-white pb-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
© Copyright 2017, Michael Götz
|
© Copyright 2017, Michael Götz
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<!-- Optional JavaScript -->
|
<!-- Optional JavaScript -->
|
||||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<p class="text-center">Day: {{ day.strftime("%d.%m.%Y") }}</p>
|
<p class="text-center">Day: {{ day.strftime("%d.%m.%Y") }}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ macros.day_menu(title='Feki', location_menu=feki_menu, fail_text='Die Feki Mensa hat heute geschlossen.', css_id="feki") }}
|
{{ macros.day_menu(title='Feki', location_menu=feki_menu, fail_text='Die Feki Mensa hat heute geschlossen.', css_id="feki") }}
|
||||||
{{ macros.day_menu(title='Austraße', location_menu=austr_menu, fail_text='Die Austr Mensa hat heute geschlossen.', css_id="austr") }}
|
{{ macros.day_menu(title='Austraße', location_menu=austr_menu, fail_text='Die Austr Mensa hat heute geschlossen.', css_id="austr") }}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block bottom_nav %}
|
{% block bottom_nav %}
|
||||||
<nav id="food-nav" class="navbar navbar-default bg-light">
|
<nav id="food-nav" class="navbar navbar-default bg-light">
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<a class="nav-link" href="{{ url('daily-food') }}"> Daily </a>
|
<a class="nav-link" href="{{ url('daily-food') }}"> Daily </a>
|
||||||
<a class="nav-link" href="{{ url('weekly-food') }}"> Weekly </a>
|
<a class="nav-link" href="{{ url('weekly-food') }}"> Weekly </a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<p class="text-center">Week: {{ day.strftime("%d.%m.%Y") }} - {{ lastday.strftime("%d.%m.%Y") }}</p>
|
<p class="text-center">Week: {{ day.strftime("%d.%m.%Y") }} - {{ lastday.strftime("%d.%m.%Y") }}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ macros.week_menu(title='Feki', location_menus=feki_menu, fail_text='Die Feki Mensa hat heute geschlossen.') }}
|
{{ macros.week_menu(title='Feki', location_menus=feki_menu, fail_text='Die Feki Mensa hat heute geschlossen.') }}
|
||||||
{{ macros.week_menu(title='Austraße', location_menus=austr_menu, fail_text='Die Austr Mensa hat heute geschlossen.') }}
|
{{ macros.week_menu(title='Austraße', location_menus=austr_menu, fail_text='Die Austr Mensa hat heute geschlossen.') }}
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
{% import '/macros/overview_pages.jinja' as macros %}
|
{% import '/macros/overview_pages.jinja' as macros %}
|
||||||
{% block headline %}
|
{% block headline %}
|
||||||
<header class="">
|
<header class="">
|
||||||
<h1 class="text-center" style="font-size: 20px">BaStA</h1>
|
<h1 class="text-center mb-0" style="font-size: 20px">BaStA</h1>
|
||||||
<p class="text-center">Bamberger Studierenden App</p>
|
<p class="text-center">Bamberger Studierenden App</p>
|
||||||
</header>
|
</header>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container text-dark">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row text-dark">
|
||||||
{{ macros.home_item_with_icon(icon='fa-cutlery', url_id='daily-food', title='Food') }}
|
{{ macros.home_item_with_icon(icon='fa-cutlery', url_id='daily-food', title='Food') }}
|
||||||
{{ macros.home_item_with_icon(icon='fa-calendar-o', url_id='day-events', title='Events') }}
|
{{ macros.home_item_with_icon(icon='fa-calendar-o', url_id='day-events', title='Events') }}
|
||||||
{{ macros.home_item_with_icon(icon='fa-compass', url_id='donar', title='Nav') }}
|
{{ macros.home_item_with_icon(icon='fa-compass', url_id='donar', title='Nav') }}
|
||||||
|
|||||||
@ -83,9 +83,9 @@
|
|||||||
<div class="col-sm-12 col-md-5 col-lg-5 col-xl-5">{{ happy_hour.description }}</div>
|
<div class="col-sm-12 col-md-5 col-lg-5 col-xl-5">{{ happy_hour.description }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Leider gibt es heute keine Happy Hours :(</p>
|
<p>Leider gibt es heute keine Happy Hours :(</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
{% autoescape off %}
|
||||||
|
Hi {{ user.username }},
|
||||||
|
|
||||||
|
Please click on the link below to confirm your registration:
|
||||||
|
http://{{ domain }}{{ url('activate', args=[uid, token]) }}
|
||||||
|
|
||||||
|
|
||||||
|
And a great welcome
|
||||||
|
The BaStA Team
|
||||||
|
{% endautoescape %}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.jinja' %}
|
||||||
|
|
||||||
|
{% block headline %}<h3 class="text-center">BaStA Login</h3>{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="col-12 text-center p-3 bg-light text-dark">
|
||||||
|
<h3>Fail</h3>
|
||||||
|
<p>Your user account couldn't be activated</p>
|
||||||
|
<p>Please try it again or inform the Administrator.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
12
ofu_app/templates/registration/account_activation_sent.jinja
Normal file
12
ofu_app/templates/registration/account_activation_sent.jinja
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{% extends 'base.jinja' %}
|
||||||
|
|
||||||
|
{% block headline %}<h3 class="text-center">BaStA Login</h3>{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="col-12 text-center p-3 bg-light text-dark">
|
||||||
|
<h3>Sent</h3>
|
||||||
|
<p>Your user account was created and the confirmation mail was sent</p>
|
||||||
|
<p>Please confirm your email address.</p>
|
||||||
|
<a href="{{ url('home') }}">Back to Home</a>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.jinja' %}
|
||||||
|
|
||||||
|
{% block headline %}<h3 class="text-center">BaStA Login</h3>{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="col-12 text-center p-3 bg-light text-dark">
|
||||||
|
<h3>Success</h3>
|
||||||
|
<p>Your user account is now activated.</p>
|
||||||
|
<a href="{{ url('home') }}">Click here to show home</a>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
34
ofu_app/templates/registration/login.jinja
Normal file
34
ofu_app/templates/registration/login.jinja
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{% extends 'base.jinja' %}
|
||||||
|
|
||||||
|
{% block headline %}<h3 class="text-center">BaStA Login</h3>{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="col-12 text-center p-3 bg-light text-dark">
|
||||||
|
<h3>Login</h3>
|
||||||
|
<form method="post" action="{{ url('login') }}">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% if form.errors %}
|
||||||
|
<div class="message is-danger">
|
||||||
|
<div class="message-body">
|
||||||
|
Your username and password didn't match. Please try again.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<label for="id_username" class="label">Username:</label>
|
||||||
|
<p class="control">
|
||||||
|
<input id="id_username" class="input" maxlength="254" name="username" type="text">
|
||||||
|
</p>
|
||||||
|
<label for="id_password" class="label">Password:</label>
|
||||||
|
<p class="control">
|
||||||
|
<input id="id_password" class="input" name="password" type="password">
|
||||||
|
</p>
|
||||||
|
<input type="submit" class="button is-pulled-right" value="Login"/>
|
||||||
|
<input type="hidden" name="next" value="{{ next }}"/>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-12 text-center p-3 bg-light text-dark">
|
||||||
|
<p>Du hast noch keinen Account? <a href="{{ url('signup') }}">Hier</a> geht's zur Registrierung</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
50
ofu_app/templates/registration/signup.jinja
Normal file
50
ofu_app/templates/registration/signup.jinja
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{% extends 'base.jinja' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="col-12 text-left p-3 bg-light text-dark">
|
||||||
|
<h2>Sign up</h2>
|
||||||
|
<form method="post" action="{{ url('signup') }}">
|
||||||
|
{% csrf_token %}
|
||||||
|
<label for="username" class="label">Username:</label>
|
||||||
|
<p>
|
||||||
|
<input id="username" type="text" name="username" required autofocus maxlength="150" id="id_username"/>
|
||||||
|
<small style="color: grey">Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und
|
||||||
|
@/./+/-/_.
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<label for="email" class="label">E-Mail:</label>
|
||||||
|
<p>
|
||||||
|
<input id="email" type="email" name="email" required maxlength="254" id="id_email"/>
|
||||||
|
<small style="color: grey">Required. Inform a valid email address.</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<label for="password1" class="label">Password:</label>
|
||||||
|
<p>
|
||||||
|
<input id="password1" type="password" name="password1" required id="id_password1"/>
|
||||||
|
<small style="color: grey">
|
||||||
|
<ul>
|
||||||
|
<li>Das Passwort darf nicht zu ähnlich zu Ihren anderen
|
||||||
|
persönlichen Informationen sein.
|
||||||
|
</li>
|
||||||
|
<li>Das Passwort muss mindestens 8 Zeichen
|
||||||
|
enthalten.
|
||||||
|
</li>
|
||||||
|
<li>Das Passwort darf nicht allgemein üblich sein.</li>
|
||||||
|
<li>Das
|
||||||
|
Passwort darf nicht komplett aus Ziffern bestehen.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
<label for="password2" class="label">Retype Password:</label>
|
||||||
|
<p>
|
||||||
|
<input id="password2" type="password" name="password2" required id="id_password2"/>
|
||||||
|
<small style="color: grey">Bitte das selbe Passwort zur Bestätigung erneut eingeben.</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<input type="submit" class="button is-pulled-right" value="Sign up"/>
|
||||||
|
<input type="hidden" name="next" value="{{ next }}"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user