From fd64742b175bd7983541bc587865e6cebd0d2a84 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 23:39:02 +0100 Subject: [PATCH] Revamping profile pages --- bornhack/settings/base.py | 6 +- bornhack/templates/account/email_confirm.html | 32 ------- bornhack/templates/account/logout.html | 18 ---- bornhack/urls.py | 30 ++----- profiles/templates/account/email.html | 85 +++++++++++++++++++ profiles/templates/account/email_confirm.html | 34 ++++++++ .../templates/account/email_confirmed.html | 0 .../templates/account/login.html | 0 profiles/templates/account/logout.html | 19 +++++ .../password_change.html} | 8 +- .../templates/account/password_reset.html | 0 .../account/password_reset_done.html | 0 .../account/password_reset_from_key.html | 0 .../account/password_reset_from_key_done.html | 0 .../templates/account/signup.html | 0 .../templates/account/verification_sent.html | 0 profiles/templates/profiles/profile_base.html | 24 ++++++ .../templates/profiles/profile_detail.html | 15 ++-- 18 files changed, 180 insertions(+), 91 deletions(-) delete mode 100644 bornhack/templates/account/email_confirm.html delete mode 100644 bornhack/templates/account/logout.html create mode 100644 profiles/templates/account/email.html create mode 100644 profiles/templates/account/email_confirm.html rename {bornhack => profiles}/templates/account/email_confirmed.html (100%) rename {bornhack => profiles}/templates/account/login.html (100%) create mode 100644 profiles/templates/account/logout.html rename profiles/templates/{profiles/profile_form.html => account/password_change.html} (69%) rename {bornhack => profiles}/templates/account/password_reset.html (100%) rename {bornhack => profiles}/templates/account/password_reset_done.html (100%) rename {bornhack => profiles}/templates/account/password_reset_from_key.html (100%) rename {bornhack => profiles}/templates/account/password_reset_from_key_done.html (100%) rename {bornhack => profiles}/templates/account/signup.html (100%) rename {bornhack => profiles}/templates/account/verification_sent.html (100%) create mode 100644 profiles/templates/profiles/profile_base.html diff --git a/bornhack/settings/base.py b/bornhack/settings/base.py index 0190ed7b..f0d7a5b8 100644 --- a/bornhack/settings/base.py +++ b/bornhack/settings/base.py @@ -21,12 +21,12 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sites', + 'profiles', + 'camps', + 'allauth', 'allauth.account', 'bootstrap3', - - 'profiles', - 'camps', ] STATIC_URL = '/static/' diff --git a/bornhack/templates/account/email_confirm.html b/bornhack/templates/account/email_confirm.html deleted file mode 100644 index e9ef07fd..00000000 --- a/bornhack/templates/account/email_confirm.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% load account %} - -{% block content %} - -
-

{% trans "Confirm E-mail Address" %}

- - {% if confirmation %} - - {% user_display confirmation.email_address.user as user_display %} - -

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

- -
- {% csrf_token %} - -
- - {% else %} - - {% url 'account_email' as email_url %} - -

{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}

- - {% endif %} -
- -{% endblock %} diff --git a/bornhack/templates/account/logout.html b/bornhack/templates/account/logout.html deleted file mode 100644 index b391c8d8..00000000 --- a/bornhack/templates/account/logout.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
- -

- Sure you want to logout? -

- -
- {% csrf_token %} - -
-
-{% endblock %} diff --git a/bornhack/urls.py b/bornhack/urls.py index 77754947..39b270f8 100644 --- a/bornhack/urls.py +++ b/bornhack/urls.py @@ -16,36 +16,16 @@ urlpatterns = [ TemplateView.as_view(template_name='frontpage.html'), name='frontpage' ), - #url( - #r'^login/$', - #LoginView.as_view(), - #name='account_login', - #), + 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') diff --git a/profiles/templates/account/email.html b/profiles/templates/account/email.html new file mode 100644 index 00000000..fe7e92ba --- /dev/null +++ b/profiles/templates/account/email.html @@ -0,0 +1,85 @@ +{% extends 'profiles/profile_base.html' %} + +{% load i18n %} +{% load bootstrap3 %} + +{% block head_title %}{% trans "Account" %}{% endblock %} + +{% block profile_content %} + +
+
+ +

{% trans "E-mail Addresses" %}

+{% if user.emailaddress_set.all %} +

{% trans 'The following e-mail addresses are associated with your account:' %}

+ + + +{% else %} +

{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

+ +{% endif %} + + +

{% trans "Add E-mail Address" %}

+ +
+ {% csrf_token %} + {% bootstrap_form form %} + +
+
+
+ + + +{% endblock %} diff --git a/profiles/templates/account/email_confirm.html b/profiles/templates/account/email_confirm.html new file mode 100644 index 00000000..e7950cd3 --- /dev/null +++ b/profiles/templates/account/email_confirm.html @@ -0,0 +1,34 @@ +{% extends 'profile_base.html' %} +{% load i18n %} +{% load account %} + +{% block content %} + +
+
+

{% trans "Confirm E-mail Address" %}

+ + {% if confirmation %} + + {% user_display confirmation.email_address.user as user_display %} + +

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

+ +
+ {% csrf_token %} + +
+ + {% else %} + + {% url 'account_email' as email_url %} + +

{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}

+ + {% endif %} +
+
+ +{% endblock %} diff --git a/bornhack/templates/account/email_confirmed.html b/profiles/templates/account/email_confirmed.html similarity index 100% rename from bornhack/templates/account/email_confirmed.html rename to profiles/templates/account/email_confirmed.html diff --git a/bornhack/templates/account/login.html b/profiles/templates/account/login.html similarity index 100% rename from bornhack/templates/account/login.html rename to profiles/templates/account/login.html diff --git a/profiles/templates/account/logout.html b/profiles/templates/account/logout.html new file mode 100644 index 00000000..4318f042 --- /dev/null +++ b/profiles/templates/account/logout.html @@ -0,0 +1,19 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+

+ Sure you want to logout? +

+ +
+ {% csrf_token %} + +
+
+
+{% endblock %} diff --git a/profiles/templates/profiles/profile_form.html b/profiles/templates/account/password_change.html similarity index 69% rename from profiles/templates/profiles/profile_form.html rename to profiles/templates/account/password_change.html index cd2760d1..d2835066 100644 --- a/profiles/templates/profiles/profile_form.html +++ b/profiles/templates/account/password_change.html @@ -1,13 +1,13 @@ -{% extends "base.html" %} +{% extends 'profiles/profile_base.html' %} {% load account %} {% load bootstrap3 %} -{% block content %} +{% block profile_content %}
-
-

Edit profile

+
+

Change password