From 1de0b1ad0e8bc47173623d5b4e1ea327c2aca0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sat, 20 Feb 2016 03:00:08 +0100 Subject: [PATCH] Signup about done. Also enabled apps again. --- bornhack/settings/base.py | 6 +- bornhack/static_src/css/bornhack.css | 4 + bornhack/templates/account/login.html | 30 ++++--- .../templates/account/password_reset.html | 22 +++++ .../account/password_reset_done.html | 14 +++ .../account/password_reset_from_key.html | 31 +++++++ .../account/password_reset_from_key_done.html | 15 ++++ bornhack/templates/account/signup.html | 27 +++--- bornhack/templates/base.html | 8 +- bornhack/urls.py | 85 ++++++++++--------- camps/migrations/0001_initial.py | 78 +++++++++++++++++ camps/migrations/0002_auto_20160117_1718.py | 21 +++++ camps/templates/camps/signup.html | 10 --- profiles/migrations/0001_initial.py | 29 +++++++ .../templates/profiles/profile_detail.html | 5 +- 15 files changed, 299 insertions(+), 86 deletions(-) create mode 100644 bornhack/templates/account/password_reset.html create mode 100644 bornhack/templates/account/password_reset_done.html create mode 100644 bornhack/templates/account/password_reset_from_key.html create mode 100644 bornhack/templates/account/password_reset_from_key_done.html create mode 100644 camps/migrations/0001_initial.py create mode 100644 camps/migrations/0002_auto_20160117_1718.py delete mode 100644 camps/templates/camps/signup.html create mode 100644 profiles/migrations/0001_initial.py diff --git a/bornhack/settings/base.py b/bornhack/settings/base.py index 3252a30f..0190ed7b 100644 --- a/bornhack/settings/base.py +++ b/bornhack/settings/base.py @@ -25,8 +25,8 @@ INSTALLED_APPS = [ 'allauth.account', 'bootstrap3', - # 'profiles', - # 'camps', + 'profiles', + 'camps', ] STATIC_URL = '/static/' @@ -79,6 +79,6 @@ AUTHENTICATION_BACKENDS = ( ACCOUNT_AUTHENTICATION_METHOD = 'email' ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = True -ACCOUNT_EMAIL_SUBJECT_PREFIX = '[bornhack]' +ACCOUNT_EMAIL_SUBJECT_PREFIX = '[bornhack] ' ACCOUNT_USERNAME_REQUIRED = False LOGIN_URL = '/login/' diff --git a/bornhack/static_src/css/bornhack.css b/bornhack/static_src/css/bornhack.css index 01296260..2eb4f249 100644 --- a/bornhack/static_src/css/bornhack.css +++ b/bornhack/static_src/css/bornhack.css @@ -2,6 +2,10 @@ body { margin-top: 90px; } +* { + border-radius: 0 !important; +} + a, a:active, a:focus { outline: none; } diff --git a/bornhack/templates/account/login.html b/bornhack/templates/account/login.html index 6defb745..98c11dd2 100644 --- a/bornhack/templates/account/login.html +++ b/bornhack/templates/account/login.html @@ -4,23 +4,25 @@ {% load account %} {% load bootstrap3 %} -{% block body_class %}{{ block.super }} narrow{% endblock %} - {% block content %} -

{% trans "Login" %}

+
+
+

{% trans "Login" %}

-

{% blocktrans %}If you have not created an account yet, then please - sign up first.{% endblocktrans %}

+

{% blocktrans %}If you have not created an account yet, then please + sign up first.{% endblocktrans %}

- + +
+
{% endblock %} diff --git a/bornhack/templates/account/password_reset.html b/bornhack/templates/account/password_reset.html new file mode 100644 index 00000000..53e1e0fb --- /dev/null +++ b/bornhack/templates/account/password_reset.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} + +{% load account %} +{% load bootstrap3 %} + +{% block content %} + +
+
+

Lost your password?

+

+ Lost your password? Input your email, and we will send you an e-mail + with instructions for resetting your password. +

+ + +
+{% endblock %} diff --git a/bornhack/templates/account/password_reset_done.html b/bornhack/templates/account/password_reset_done.html new file mode 100644 index 00000000..1acab9fa --- /dev/null +++ b/bornhack/templates/account/password_reset_done.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% load account %} + +{% block content %} +
+
+

Reset e-mail sent

+

+ We have now sent an e-mail with instructions for how to reset your + password. +

+
+{% endblock %} diff --git a/bornhack/templates/account/password_reset_from_key.html b/bornhack/templates/account/password_reset_from_key.html new file mode 100644 index 00000000..0679a2ed --- /dev/null +++ b/bornhack/templates/account/password_reset_from_key.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} + +{% load account %} +{% load bootstrap3 %} + +{% block content %} +
+
+ +

{% if token_fail %}Invalidt link{% else %}Reset password{% endif %}

+ {% if token_fail %} +

+ The given token is invalid. +

+

+ Request new reset +

+ {% else %} + {% if form %} + + {% else %} +

Your password has been reset

+ {% endif %} + {% endif %} +
+
+{% endblock %} diff --git a/bornhack/templates/account/password_reset_from_key_done.html b/bornhack/templates/account/password_reset_from_key_done.html new file mode 100644 index 00000000..2dfda23a --- /dev/null +++ b/bornhack/templates/account/password_reset_from_key_done.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% load account %} + +{% block content %} +
+
+

Password reset

+

+ Your password has been reset. You can now login +

+
+{% endblock %} + + diff --git a/bornhack/templates/account/signup.html b/bornhack/templates/account/signup.html index ac4b3119..1361b8f9 100644 --- a/bornhack/templates/account/signup.html +++ b/bornhack/templates/account/signup.html @@ -1,18 +1,21 @@ -{% extends 'base.html' %} -{% load bootstrap3 %} +{% extends "base.html" %} -{% block body_class %}{{ block.super }} narrow{% endblock %} +{% load i18n %} +{% load account %} +{% load bootstrap3 %} {% block content %} -
- +
+
+

{% trans "Signup" %}

+ + +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/bornhack/templates/base.html b/bornhack/templates/base.html index 746e2ad0..9c988265 100644 --- a/bornhack/templates/base.html +++ b/bornhack/templates/base.html @@ -33,9 +33,15 @@
diff --git a/bornhack/urls.py b/bornhack/urls.py index b407f28d..77754947 100644 --- a/bornhack/urls.py +++ b/bornhack/urls.py @@ -1,11 +1,11 @@ -# from allauth.account.views import ( -# SignupView, -# LoginView, -# LogoutView, -# ConfirmEmailView, -# EmailVerificationSentView, -# PasswordResetView -# ) +from allauth.account.views import ( + SignupView, + LoginView, + LogoutView, + ConfirmEmailView, + EmailVerificationSentView, + PasswordResetView +) from django.conf.urls import include, url from django.contrib import admin from django.views.generic import TemplateView @@ -16,40 +16,41 @@ urlpatterns = [ TemplateView.as_view(template_name='frontpage.html'), name='frontpage' ), - # url( - # r'^login/$', - # LoginView.as_view(), - # name='account_login', - # ), - # url( - # r'^logout/$', - # LogoutView.as_view(), - # name='account_logout', - # ), - # url( - # r'^confirm/(?P\S+)$', - # ConfirmEmailView.as_view(), - # name='account_confirm_email', - # ), - # url( - # r'^signup/done/$', - # EmailVerificationSentView.as_view(), - # name='account_email_verification_sent', - # ), - # url( - # r'^signup/$', - # SignupView.as_view(), - # name='account_signup', - # ), - # url( - # r'^reset-password/$', - # PasswordResetView.as_view(), - # name='account_reset_password', - # ), - # url( - # r'^profile/', - # include('profiles.urls', namespace='profiles') - # ), + #url( + #r'^login/$', + #LoginView.as_view(), + #name='account_login', + #), + url( + r'^logout/$', + LogoutView.as_view(), + name='account_logout', + ), + #url( + #r'^confirm/(?P\S+)$', + #ConfirmEmailView.as_view(), + #name='account_confirm_email', + #), + #url( + #r'^signup/done/$', + #EmailVerificationSentView.as_view(), + #name='account_email_verification_sent', + #), + #url( + #r'^signup/$', + #SignupView.as_view(), + #name='account_signup', + #), + #url( + #r'^reset-password/$', + #PasswordResetView.as_view(), + #name='account_reset_password', + #), + url( + r'^profile/', + include('profiles.urls', namespace='profiles') + ), + url(r'^accounts/', include('allauth.urls')), url(r'^admin/', include(admin.site.urls)), ] diff --git a/camps/migrations/0001_initial.py b/camps/migrations/0001_initial.py new file mode 100644 index 00000000..b0fa0fa8 --- /dev/null +++ b/camps/migrations/0001_initial.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import uuid +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Camp', + fields=[ + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('uuid', models.UUIDField(default=uuid.uuid4, serialize=False, editable=False, primary_key=True)), + ('name', models.CharField(max_length=255, help_text='Name of the camp, ie. Bornhack.', verbose_name='Name')), + ('start', models.DateTimeField(help_text='When the camp starts.', unique=True, verbose_name='Start date')), + ('end', models.DateTimeField(help_text='When the camp ends.', unique=True, verbose_name='End date')), + ], + options={ + 'verbose_name_plural': 'Camps', + 'verbose_name': 'Camp', + }, + ), + migrations.CreateModel( + name='Day', + fields=[ + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('uuid', models.UUIDField(default=uuid.uuid4, serialize=False, editable=False, primary_key=True)), + ('date', models.DateField(help_text='What date?', verbose_name='Date')), + ('camp', models.ForeignKey(to='camps.Camp', help_text='Which camp does this day belong to.', verbose_name='Camp')), + ], + options={ + 'verbose_name_plural': 'Days', + 'verbose_name': 'Day', + }, + ), + migrations.CreateModel( + name='Expense', + fields=[ + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('uuid', models.UUIDField(default=uuid.uuid4, serialize=False, editable=False, primary_key=True)), + ('description', models.CharField(max_length=255, help_text='What this expense covers.', verbose_name='Description')), + ('amount', models.DecimalField(max_digits=7, help_text='The amount of the expense.', verbose_name='Amount', decimal_places=2)), + ('currency', models.CharField(max_length=3, choices=[('btc', 'BTC'), ('dkk', 'DKK'), ('eur', 'EUR'), ('sek', 'SEK')], help_text='What currency the amount is in.', verbose_name='Currency')), + ('camp', models.ForeignKey(to='camps.Camp', help_text='The camp to which this expense relates to.', verbose_name='Camp')), + ('covered_by', models.ForeignKey(to=settings.AUTH_USER_MODEL, blank=True, help_text='Which user, if any, covered this expense.', verbose_name='Covered by', null=True)), + ], + options={ + 'verbose_name_plural': 'Expenses', + 'verbose_name': 'Expense', + }, + ), + migrations.CreateModel( + name='Signup', + fields=[ + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('uuid', models.UUIDField(default=uuid.uuid4, serialize=False, editable=False, primary_key=True)), + ('cost', models.DecimalField(default=1500.0, decimal_places=2, help_text='What the user should/is willing to pay for this signup.', verbose_name='Cost', max_digits=7)), + ('paid', models.BooleanField(help_text='Whether the user has paid.', verbose_name='Paid?', default=False)), + ('camp', models.ForeignKey(to='camps.Camp', help_text='The camp that has been signed up for.', verbose_name='Camp')), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, help_text='The user that has signed up.', verbose_name='User')), + ], + options={ + 'verbose_name_plural': 'Signups', + 'verbose_name': 'Signup', + }, + ), + ] diff --git a/camps/migrations/0002_auto_20160117_1718.py b/camps/migrations/0002_auto_20160117_1718.py new file mode 100644 index 00000000..5f8eb965 --- /dev/null +++ b/camps/migrations/0002_auto_20160117_1718.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-01-17 17:18 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('camps', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='day', + name='camp', + field=models.ForeignKey(help_text='Which camp does this day belong to.', on_delete=django.db.models.deletion.CASCADE, related_name='days', to='camps.Camp', verbose_name='Camp'), + ), + ] diff --git a/camps/templates/camps/signup.html b/camps/templates/camps/signup.html deleted file mode 100644 index ecd2df2f..00000000 --- a/camps/templates/camps/signup.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} - -
- {{ form }} - -
- -{% endblock %} \ No newline at end of file diff --git a/profiles/migrations/0001_initial.py b/profiles/migrations/0001_initial.py new file mode 100644 index 00000000..74b67103 --- /dev/null +++ b/profiles/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Profile', + fields=[ + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('uuid', models.UUIDField(serialize=False, editable=False, primary_key=True, default=uuid.uuid4)), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, help_text='The django user this profile belongs to.', verbose_name='User')), + ], + options={ + 'verbose_name_plural': 'Profiles', + 'verbose_name': 'Profile', + }, + ), + ] diff --git a/profiles/templates/profiles/profile_detail.html b/profiles/templates/profiles/profile_detail.html index 4a604ec5..62eb9e5d 100644 --- a/profiles/templates/profiles/profile_detail.html +++ b/profiles/templates/profiles/profile_detail.html @@ -5,8 +5,5 @@

Yeah! You now have a BornHack user!

-

- You have also been added to our announcement mailing list. It is on this list that we will announce more information about the camp. -

-{% endblock %} \ No newline at end of file +{% endblock %}