From: Guillaume Pellerin Date: Thu, 24 Sep 2015 12:13:59 +0000 (+0200) Subject: retrieve and patch default mezz accounts templates, split user panel and cart X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=567ad0b72c2d2b6d953e2582882a928804aec81f;p=diggersdigest.git retrieve and patch default mezz accounts templates, split user panel and cart --- diff --git a/app/templates/accounts/account_form.html b/app/templates/accounts/account_form.html new file mode 100644 index 0000000..1f4d44f --- /dev/null +++ b/app/templates/accounts/account_form.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% load i18n mezzanine_tags %} + +{% block meta_title %}{{ title }}{% endblock %} +{% block title %}{{ title }}{% endblock %} +{% block body_id %}account{% endblock %} + +{% block breadcrumb_menu %} +{{ block.super }} +
  • {{ title }}
  • +{% endblock %} + +{% block main %} + +{% errors_for form %} + +
    +
    + {{ title }} + {% fields_for form %} +
    + {% block account_form_actions %} + + {% endblock %} +
    +
    +
    +{% endblock %} diff --git a/app/templates/accounts/account_login.html b/app/templates/accounts/account_login.html new file mode 100644 index 0000000..5b10cb7 --- /dev/null +++ b/app/templates/accounts/account_login.html @@ -0,0 +1,17 @@ +{% extends "accounts/account_form.html" %} +{% load i18n %} + +{% block main %} + +{% if request.user.is_authenticated %} +

    {% trans "You're already logged in. If you'd like to log in as a different user, you'll need to log out first." %}

    +{% else %} + {{ block.super }} + {% url "signup" as signup_url %} +

    {% blocktrans with request.GET.next as next %}If you don't have an account you can sign up for one now.{% endblocktrans %}

    + {% url "mezzanine_password_reset" as password_reset_url %} + {% url "profile_update" as profile_update_url %} + {% blocktrans %}

    You can also reset your password if you've forgotten it.

    {% endblocktrans %}

    +{% endif %} + +{% endblock %} diff --git a/app/templates/accounts/account_password_reset.html b/app/templates/accounts/account_password_reset.html new file mode 100644 index 0000000..2fe7631 --- /dev/null +++ b/app/templates/accounts/account_password_reset.html @@ -0,0 +1,7 @@ +{% extends "accounts/account_form.html" %} +{% load i18n %} + +{% block main %} +{{ block.super }} +

    {% trans "Enter your username or email address and you'll receive an email with a link you need to click, in order to log in and change your password." %}

    +{% endblock %} diff --git a/app/templates/accounts/account_profile.html b/app/templates/accounts/account_profile.html new file mode 100644 index 0000000..464a646 --- /dev/null +++ b/app/templates/accounts/account_profile.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{% load i18n mezzanine_tags accounts_tags %} + +{% block meta_title %}{{ profile_user|username_or:"get_full_name" }}{% endblock %} +{% block title %}{{ profile_user|username_or:"get_full_name" }}{% endblock %} +{% block body_id %}account{% endblock %} + +{% block breadcrumb_menu %} +{{ block.super }} +
  • {{ profile_user|username_or:"get_full_name" }}
  • +{% endblock %} + +{% block main %} +
    +
    + + {% if profile_user == request.user %} +
    {% trans "Update profile" %} + {% endif %} +
    +
    +

    {{ profile_user.get_full_name }}

    + {% for field, value in profile_user|profile_fields %} +

    {{ field }}

    +

    {{ value|linebreaksbr }}

    + {% endfor %} +
    +
    +{% endblock %} diff --git a/app/templates/accounts/account_profile_update.html b/app/templates/accounts/account_profile_update.html index 9ea1087..8a7dcbe 100644 --- a/app/templates/accounts/account_profile_update.html +++ b/app/templates/accounts/account_profile_update.html @@ -1,7 +1 @@ {% extends "accounts/account_form.html" %} -{% load i18n %} - -{% block account_form_actions %} -{{ block.super }} -{% trans "View past orders" %} -{% endblock %} diff --git a/app/templates/accounts/account_signup.html b/app/templates/accounts/account_signup.html new file mode 100644 index 0000000..d135deb --- /dev/null +++ b/app/templates/accounts/account_signup.html @@ -0,0 +1,17 @@ +{% extends "accounts/account_form.html" %} +{% load i18n %} + +{% block main %} + +{% if request.user.is_authenticated %} +

    {% trans "You're already logged in. If you'd like to create a new account, you'll need to log out first." %}

    +{% else %} + {{ block.super }} + {% if settings.ACCOUNTS_APPROVAL_REQUIRED %} +

    {% trans "After signing up, your account will be reviewed for approval. You'll receive an email when your account is activated." %}

    + {% elif settings.ACCOUNTS_VERIFICATION_REQUIRED %} +

    {% trans "After signing up, you'll receive an email with a link you need to click, in order to activate your account." %}

    + {% endif %} +{% endif %} + +{% endblock %} diff --git a/app/templates/accounts/includes/user_panel.html b/app/templates/accounts/includes/user_panel.html new file mode 100644 index 0000000..4ae1850 --- /dev/null +++ b/app/templates/accounts/includes/user_panel.html @@ -0,0 +1,24 @@ +{% load i18n mezzanine_tags accounts_tags %} + +{% if request.user.is_authenticated %} +

    + {% trans "Logged in as: " %} + {% url "profile" request.user.username as profile_url %} + {% if profile_url %} + {{ request.user|username_or:"email" }} +

    + + {% trans "Update profile" %} + {% else %} + {{ request.user|username_or:"email" }} +

    + {% endif %} + + {% trans "Log out" %} +{% else %} + + {% trans "Log in" %} +  {% trans "or" %}  + + {% trans "Sign up" %} +{% endif %} diff --git a/app/templates/accounts/includes/user_panel_nav.html b/app/templates/accounts/includes/user_panel_nav.html new file mode 100644 index 0000000..cd41199 --- /dev/null +++ b/app/templates/accounts/includes/user_panel_nav.html @@ -0,0 +1,19 @@ +{% load i18n mezzanine_tags accounts_tags %} + + + diff --git a/app/templates/base.html b/app/templates/base.html index 2e0ecc1..e076092 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -73,14 +73,21 @@
    {% search_form "all" %} + {% include "includes/language_selector.html" %} + {% ifinstalled mezzanine.accounts %} + {% ifinstalled cartridge.shop %}{% endifinstalled %} + {% include "accounts/includes/user_panel_nav.html" %} + {% endifinstalled %} +
    {% nevercache %} - {% include "includes/language_selector.html" %} - {% include "includes/user_panel_header.html" %} + {% ifinstalled cartridge.shop %} + {% include "shop/includes/user_panel_header.html" %} + {% endifinstalled %} {% endnevercache %}

    diff --git a/app/templates/includes/user_panel_header.html b/app/templates/includes/user_panel_header.html index 0150d9e..85e7e52 100644 --- a/app/templates/includes/user_panel_header.html +++ b/app/templates/includes/user_panel_header.html @@ -3,8 +3,4 @@ {% ifinstalled cartridge.shop %} {% include "shop/includes/user_panel_header.html" %} {% endifinstalled %} -{% ifinstalled mezzanine.accounts %} -{% ifinstalled cartridge.shop %}
    {% endifinstalled %} -{% include "accounts/includes/user_panel.html" %} -{% endifinstalled %}