]> git.parisson.com Git - diggersdigest.git/commitdiff
retrieve and patch default mezz accounts templates, split user panel and cart
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 12:13:59 +0000 (14:13 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 12:13:59 +0000 (14:13 +0200)
app/templates/accounts/account_form.html [new file with mode: 0644]
app/templates/accounts/account_login.html [new file with mode: 0644]
app/templates/accounts/account_password_reset.html [new file with mode: 0644]
app/templates/accounts/account_profile.html [new file with mode: 0644]
app/templates/accounts/account_profile_update.html
app/templates/accounts/account_signup.html [new file with mode: 0644]
app/templates/accounts/includes/user_panel.html [new file with mode: 0644]
app/templates/accounts/includes/user_panel_nav.html [new file with mode: 0644]
app/templates/base.html
app/templates/includes/user_panel_header.html

diff --git a/app/templates/accounts/account_form.html b/app/templates/accounts/account_form.html
new file mode 100644 (file)
index 0000000..1f4d44f
--- /dev/null
@@ -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 }}
+<li>{{ title }}</li>
+{% endblock %}
+
+{% block main %}
+
+{% errors_for form %}
+
+<form method="post"{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
+    <fieldset>
+    <legend>{{ title }}</legend>
+    {% fields_for form %}
+    <div class="form-actions">
+        {% block account_form_actions %}
+        <input class="btn btn-primary btn-lg pull-right" type="submit" value="{{ title }}">
+        {% endblock %}
+    </div>
+    </fieldset>
+</form>
+{% endblock %}
diff --git a/app/templates/accounts/account_login.html b/app/templates/accounts/account_login.html
new file mode 100644 (file)
index 0000000..5b10cb7
--- /dev/null
@@ -0,0 +1,17 @@
+{% extends "accounts/account_form.html" %}
+{% load i18n %}
+
+{% block main %}
+
+{% if request.user.is_authenticated %}
+    <p>{% trans "You're already logged in. If you'd like to log in as a different user, you'll need to log out first." %}</p>
+{% else %}
+    {{ block.super }}
+    {% url "signup" as signup_url %}
+    <p>{% blocktrans with request.GET.next as next %}If you don't have an account you can <a href="{{ signup_url }}?next={{ next }}">sign up</a> for one now.{% endblocktrans %}</p>
+    {% url "mezzanine_password_reset" as password_reset_url %}
+    {% url "profile_update" as profile_update_url %}
+    {% blocktrans %}<p>You can also <a href="{{ password_reset_url }}?next={{ profile_update_url }}">reset your password</a> if you've forgotten it.</p>{% endblocktrans %}</p>
+{% endif %}
+
+{% endblock %}
diff --git a/app/templates/accounts/account_password_reset.html b/app/templates/accounts/account_password_reset.html
new file mode 100644 (file)
index 0000000..2fe7631
--- /dev/null
@@ -0,0 +1,7 @@
+{% extends "accounts/account_form.html" %}
+{% load i18n %}
+
+{% block main %}
+{{ block.super }}
+<p>{% 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." %}</p>
+{% endblock %}
diff --git a/app/templates/accounts/account_profile.html b/app/templates/accounts/account_profile.html
new file mode 100644 (file)
index 0000000..464a646
--- /dev/null
@@ -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 }}
+<li>{{ profile_user|username_or:"get_full_name" }}</li>
+{% endblock %}
+
+{% block main %}
+<div class="row">
+<div class="profile-image col-md-3">
+    <img class="img-thumbnail" src="{% gravatar_url profile_user.email 128 %}">
+    {% if profile_user == request.user %}
+    <br><a class="btn btn-primary" href="{% url "profile_update" %}">{% trans "Update profile" %}</a>
+    {% endif %}
+</div>
+<div class="profile-content col-md-9">
+    <h2>{{ profile_user.get_full_name }}</h2>
+    {% for field, value in profile_user|profile_fields %}
+    <h3>{{ field }}</h3>
+    <p>{{ value|linebreaksbr }}</p>
+    {% endfor %}
+</div>
+</div>
+{% endblock %}
index 9ea1087bb466f2b951f49136c04d79e2be14356f..8a7dcbe48a848326a97e6ca20e625e51d8ff99b5 100644 (file)
@@ -1,7 +1 @@
 {% extends "accounts/account_form.html" %}
-{% load i18n %}
-
-{% block account_form_actions %}
-{{ block.super }}
-<a class="btn btn-default btn-lg pull-left" href="{% url "shop_order_history" %}">{% trans "View past orders" %}</a>
-{% endblock %}
diff --git a/app/templates/accounts/account_signup.html b/app/templates/accounts/account_signup.html
new file mode 100644 (file)
index 0000000..d135deb
--- /dev/null
@@ -0,0 +1,17 @@
+{% extends "accounts/account_form.html" %}
+{% load i18n %}
+
+{% block main %}
+
+{% if request.user.is_authenticated %}
+    <p>{% trans "You're already logged in. If you'd like to create a new account, you'll need to log out first." %}</p>
+{% else %}
+    {{ block.super }}
+    {% if settings.ACCOUNTS_APPROVAL_REQUIRED %}
+    <p>{% trans "After signing up, your account will be reviewed for approval. You'll receive an email when your account is activated." %}</p>
+    {% elif settings.ACCOUNTS_VERIFICATION_REQUIRED %}
+    <p>{% trans "After signing up, you'll receive an email with a link you need to click, in order to activate your account." %}</p>
+    {% 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 (file)
index 0000000..4ae1850
--- /dev/null
@@ -0,0 +1,24 @@
+{% load i18n mezzanine_tags accounts_tags %}
+
+{% if request.user.is_authenticated %}
+    <p>
+    {% trans "Logged in as: " %}
+    {% url "profile" request.user.username as profile_url %}
+    {% if profile_url %}
+        <a href="{{ profile_url }}">{{ request.user|username_or:"email" }}</a>
+    </p>
+        <a href="{% url "profile_update" %}" class="btn btn-default btn-sm btn-account">
+            <span class="glyphicon glyphicon-edit"></span> {% trans "Update profile" %}</a>
+    {% else %}
+        <a href="{% url "profile_update" %}">{{ request.user|username_or:"email" }}</a>
+    </p>
+    {% endif %}
+    <a href="{% url "logout" %}?next={{ request.path }}" class="btn btn-sm btn-danger btn-account">
+        <span class="glyphicon glyphicon-log-out"></span> {% trans "Log out" %}</a>
+{% else %}
+    <a href="{% url "login" %}?next={{ request.path }}" class="btn btn-default btn-sm btn-account">
+        <span class="glyphicon glyphicon-log-in"></span> {% trans "Log in" %}</a>
+    &nbsp;{% trans "or" %}&nbsp;
+    <a href="{% url "signup" %}?next={{ request.path }}" class="btn btn-default btn-sm btn-account">
+        <span class="glyphicon glyphicon-edit"></span> {% trans "Sign up" %}</a>
+{% 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 (file)
index 0000000..cd41199
--- /dev/null
@@ -0,0 +1,19 @@
+{% load i18n mezzanine_tags accounts_tags %}
+
+<div class="navbar-right navbar-account-controls">
+    {% if request.user.is_authenticated %}
+    {% url "profile" request.user.username as profile_url %}
+    {% if not profile_url %}{% url "profile_update" as profile_url %}{% endif %}
+    <p class="navbar-text">
+        <a class="navbar-link" href="{{ profile_url }}">
+            <span class="glyphicon glyphicon-user"></span> {{ request.user|username_or:"email" }}</a></p>
+    <a href="{% url "logout" %}?next={{ request.path }}" class="btn btn-default navbar-btn">
+        <span class="glyphicon glyphicon-log-out"></span> {% trans "Log out" %}</a>
+    {% else %}
+    <a href="{% url "login" %}?next={{ request.path }}" class="btn btn-default navbar-btn">
+        <span class="glyphicon glyphicon-log-in"></span> {% trans "Log in" %}</a>
+    <a href="{% url "signup" %}?next={{ request.path }}" class="btn btn-default navbar-btn">
+        <span class="glyphicon glyphicon-edit"></span> {% trans "Sign up" %}</a>
+    {% endif %}
+</div>
+
index 2e0ecc1c4a14c890e5239fc0198959df6d2fee65..e076092d36918ca4757974d7ea4a00d0f626ce27 100644 (file)
     </div>
     <div>
       {% search_form "all" %}
+      {% include "includes/language_selector.html" %}
+      {% ifinstalled mezzanine.accounts %}
+      {% ifinstalled cartridge.shop %}{% endifinstalled %}
+      {% include "accounts/includes/user_panel_nav.html" %}
+      {% endifinstalled %}
+
     </div>
     <div class="navbar-collapse collapse">
       {% page_menu "pages/menus/dropdown.html" %}
     </div>
     <div id="user_panel_header">
     {% nevercache %}
-    {% include "includes/language_selector.html" %}
-    {% include "includes/user_panel_header.html" %}
+    {% ifinstalled cartridge.shop %}
+    {% include "shop/includes/user_panel_header.html" %}
+    {% endifinstalled %}
     {% endnevercache %}
     </div>
     <hr>
index 0150d9ef55035ed75880cd892abc6f6794483fd1..85e7e523eb080df9959f2f693a3cee5490cf286c 100644 (file)
@@ -3,8 +3,4 @@
 {% ifinstalled cartridge.shop %}
 {% include "shop/includes/user_panel_header.html" %}
 {% endifinstalled %}
-{% ifinstalled mezzanine.accounts %}
-{% ifinstalled cartridge.shop %}<br>{% endifinstalled %}
-{% include "accounts/includes/user_panel.html" %}
-{% endifinstalled %}
 </div>