Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add contextual markers to account templates
Marco Badanc60762670250
diff --git a/templates/account/email/email_confirmation_message.txt b/templates/account/email/email_confirmation_message.txtindex 28fe36b250..2ab63fa5f8 100644--- a/templates/account/email/email_confirmation_message.txt+++ b/templates/account/email/email_confirmation_message.txt@@ -1,6 +1,6 @@{% load i18n %}-{% block content %}{% blocktrans %}Hi!+{% block content %}{% blocktrans context "Email confirmation message" %}Hi!You have requested login access to saleor project. To continue visit the link below.diff --git a/templates/account/email/email_confirmation_subject.txt b/templates/account/email/email_confirmation_subject.txtindex 3155262047..b5951d18d1 100644--- a/templates/account/email/email_confirmation_subject.txt+++ b/templates/account/email/email_confirmation_subject.txt@@ -1,2 +1,2 @@{% load i18n %}-{% trans "Confirm your email address" %}\ No newline at end of file+{% trans "Confirm your email address" context "Email confirmation subject" %}diff --git a/templates/account/login.html b/templates/account/login.htmlindex 5ff41aa7fa..815e3b5079 100644--- a/templates/account/login.html+++ b/templates/account/login.html@@ -2,7 +2,7 @@{% load staticfiles %}{% load i18n %}-{% block title %}{% trans "Log in" %} — {{ block.super }}{% endblock %}+{% block title %}{% trans "Log in" context "Login page title" %} — {{ block.super }}{% endblock %}{% block content %}@@ -10,16 +10,19 @@<div class="row login"><div class="col-md-6 login__register"><div class="login__register-link">- <h3>{% trans "Don't have an account yet?" %}</h3>- <img src="{% static 'images/pirate_login.png' %}" srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">- <a href="{{ signup_url }}" class="btn secondary">{% trans "Register" %}</a>+ <h3>{% trans "Don't have an account yet?" context "Login form secondary title" %}</h3>+ <img src="{% static 'images/pirate_login.png' %}"+ srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">+ <a href="{{ signup_url }}" class="btn secondary">+ {% trans "Register" context "Login form secondary action" %}+ </a></div></div><div class="col-md-6 login__form">- <h3>{% trans 'Log in' %}</h3>- {% include "account/partials/login_form.html" %}+ <h3>{% trans "Log in" context "Login form title" %}</h3>+ {% include "account/partials/login_form.html" %}</div></div></div>-+{% endblock %}diff --git a/templates/account/partials/already_logged_in.html b/templates/account/partials/already_logged_in.htmlnew file mode 100644index 0000000000..7e54336ed0--- /dev/null+++ b/templates/account/partials/already_logged_in.html@@ -0,0 +1,11 @@+{% load i18n %}+{% load account %}++{% user_display user as user_display %}+<div class="alert alert-warning" role="alert">+ <p>+ {% blocktrans trimmed context "Already logged in warning message" %}+ You are already logged in as {{ user_display }}.+ {% endblocktrans %}+ </p>+</div>diff --git a/templates/account/partials/login_form.html b/templates/account/partials/login_form.htmlindex 4f11eadca9..1b2f271f8e 100644--- a/templates/account/partials/login_form.html+++ b/templates/account/partials/login_form.html@@ -13,9 +13,11 @@<div class="row login__btn-group"><div class="col-sm-12"><button class="btn primary">- {% trans "Log in" %}+ {% trans "Log in" context "Login form primary action" %}</button>- <a href="{% url 'account_reset_password' %}">{% trans "Forgot password?" %}</a>+ <a href="{% url 'account_reset_password' %}">+ {% trans "Forgot password?" context "Login form secondary link" %}+ </a></div></div></form>diff --git a/templates/account/password_change.html b/templates/account/password_change.htmlindex de2196cd6b..786e7eae22 100644--- a/templates/account/password_change.html+++ b/templates/account/password_change.html@@ -4,30 +4,32 @@{% block breadcrumb %}<ul class="breadcrumbs list-unstyled">- <li><a href="/">{% trans "Home" %}</a></li>- <li><a href="{% url 'profile:details' %}">{% trans "Your account" %}</a></li>- <li><a href="/">{% trans "Edit" %}</a></li>+ <li><a href="/">{% trans "Home" context "Password change breadcrumb" %}</a></li>+ <li><a href="{% url 'profile:details' %}">{% trans "Your account" context "Password change breadcrumb" %}</a></li>+ <li><a href="/">{% trans "Edit" context "Password change breadcrumb" %}</a></li></ul>{% endblock breadcrumb %}{% block content %}<div class="row account-edit">- <div class="col-sm-4 offset-sm-4">- <div class="panel panel-default">- <div class="panel-body">- <form method="post" novalidate>- {% csrf_token %}- <fieldset>- <legend class="text-xs-center account-edit__tittle">{% trans 'Change Password' %}</legend>- {% bootstrap_form form %}- <input type="hidden" name="next" value="{{ next }}" />- </fieldset>- <button class="btn primary">- {% trans "Save new password" %}- </button>- </form>- </div>- </div>+ <div class="col-sm-4 offset-sm-4">+ <div class="panel panel-default">+ <div class="panel-body">+ <form method="post" novalidate>+ {% csrf_token %}+ <fieldset>+ <legend class="text-xs-center account-edit__tittle">+ {% trans "Change Password" context "Password change form legend" %}+ </legend>+ {% bootstrap_form form %}+ <input type="hidden" name="next" value="{{ next }}" />+ </fieldset>+ <button class="btn primary">+ {% trans "Save new password" context "Password change form primary action" %}+ </button>+ </form>+ </div></div>+ </div></div>{% endblock %}diff --git a/templates/account/password_reset.html b/templates/account/password_reset.htmlindex 85ec89f082..d98d4c7830 100644--- a/templates/account/password_reset.html+++ b/templates/account/password_reset.html@@ -3,28 +3,33 @@{% load staticfiles %}{% load bootstrap_form from bootstrap3 %}+{% block title %}{% trans "Password reset" context "Password reset page title" %} — {{ block.super }}{% endblock %}+{% block content %}<div class="row forgott-password"><div class="col-md-8 push-md-2">- <div class="text-center">- </div>- <form method="post" novalidate>- {% csrf_token %}- <h2>{% trans 'Forgott password?' %}</h2>- <p>{% trans "Please let us know the email you have used to register or purchase at our store."%}</p>- <fieldset>- {% bootstrap_form form %}- <input type="hidden" name="next" value="{{ next }}"/>- </fieldset>- <div class="row login__btn-group">- <div class="col-sm-12">- <button class="btn primary">- {% trans "Continue" %}- </button>- <img src="{% static "images/pirate-reset.png" %}" />- </div>+ <div class="text-center">+ </div>+ <form method="post" novalidate>+ {% csrf_token %}+ <h2>{% trans "Forgot your password?" context "Password reset form title" %}</h2>+ <p>{% blocktrans trimmed context "Password reset form help text" %}+ Please let us know the email you have used to register or purchase at our store.+ {% endblocktrans %}+ </p>+ <fieldset>+ {% bootstrap_form form %}+ <input type="hidden" name="next" value="{{ next }}"/>+ </fieldset>+ <div class="row login__btn-group">+ <div class="col-sm-12">+ <button class="btn primary">+ {% trans "Continue" context "Password reset primary action" %}+ </button>+ <img src="{% static "images/pirate-reset.png" %}" /></div>- </form>+ </div>+ </form></div></div>diff --git a/templates/account/password_reset_base.html b/templates/account/password_reset_base.htmlindex 12f5be8086..a9a934bcb8 100644--- a/templates/account/password_reset_base.html+++ b/templates/account/password_reset_base.html@@ -5,7 +5,7 @@{% block content %}<div class="row forgott-password"><div class="col-md-8 push-md-2">- {% block form %}{% endblock form %}+ {% block form %}{% endblock form %}</div></div>diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.htmlindex f06fe649fb..4b6a417480 100644--- a/templates/account/password_reset_done.html+++ b/templates/account/password_reset_done.html@@ -4,17 +4,20 @@{% load account %}{% load staticfiles %}-{% block title %}{% trans "Password Reset" %}{% endblock %}+{% block title %}{% trans "Password Reset" context "Password reset done page title" %}{% endblock %}{% block form %}<div class="forgott-password">- <h2>{% trans "Password Reset" %}</h2>+ <h2>{% trans "Password Reset" context "Password reset done title" %}</h2>{% if user.is_authenticated %}- {% include "account/snippets/already_logged_in.html" %}+ {% include "account/partials/already_logged_in.html" %}{% endif %}- <p>{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>+ <p>{% blocktrans trimmed context "Password reset done text" %}+ We have sent you an e-mail.+ Please contact us if you do not receive it within a few minutes.+ {% endblocktrans %}</p><div class="row login__btn-group">- <img src="{% static "images/pirate-reset.png" %}" />+ <img src="{% static "images/pirate-reset.png" %}" /></div></div>{% endblock %}diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.htmlindex 289413d7a4..07a4d79392 100644--- a/templates/account/password_reset_from_key.html+++ b/templates/account/password_reset_from_key.html@@ -3,30 +3,32 @@{% load i18n %}{% load bootstrap_form from bootstrap3 %}{% load staticfiles %}-{% block head_title %}{% trans "Change Password" %}{% endblock %}+{% block head_title %}{% trans "Change Password" context "Password reset from key page title" %}{% endblock %}{% block form %}{% if token_fail %}<div class="col-sm-12"><h2>{% trans "Bad Token" %}</h2>{% url 'account_reset_password' as passwd_reset_url %}- <p>{% blocktrans %}The password reset link was invalid, possibly- because it has already been used.<br> Please request a- <a href="{{ passwd_reset_url }}">new password reset</a>- .{% endblocktrans %}</p>+ <p>{% blocktrans trimmed context "Password reset text if key is invalid" %}+ The password reset link was invalid, possibly+ because it has already been used.<br>+ Please request a+ <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}+ </p></div>{% else %}<form method="post" novalidate>{% csrf_token %}- <h2>{% trans "Password Reset" %}</h2>- <p>{% trans "Now you can set new password for you account."%}</p>+ <h2>{% trans "Password Reset" context "Password reset from key form title" %}</h2>+ <p>{% trans "Now you can set new password for you account." context "Password reset from key form title" %}</p><fieldset>{% bootstrap_form form %}</fieldset><div class="row login__btn-group"><div class="col-sm-12"><button class="btn primary">- {% trans "Continue" %}+ {% trans "Continue" context "Password reset from key form primary action" %}</button><img src="{% static "images/pirate-reset.png" %}" /></div>diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.htmlindex 5988c83d46..7ef4ebe766 100644--- a/templates/account/password_reset_from_key_done.html+++ b/templates/account/password_reset_from_key_done.html@@ -1,11 +1,12 @@{% extends "account/password_reset_base.html" %}{% load i18n %}-{% block title %}{% trans "Change Password" %}{% endblock %}+{% block title %}{% trans "Password Changed" context "Password reset from key done page title" %}{% endblock %}{% block form %}- <h2 class="text-center">{% trans "Change Password" %}</h2>+ <h2 class="text-center">{% trans "Password Changed" context "Password reset from key done title" %}</h2>{% url "account_login" as login_url %}<p>{% trans 'Your password is now changed.' %}- {% blocktrans with login_url=login_url %}You can now <a href="{{ login_url }}">sign in</a> using your new password {% endblocktrans %}</p>+ {% blocktrans trimmed with login_url=login_url context "Password reset from key done text" %}+ You can now <a href="{{ login_url }}">sign in</a> using your new password{% endblocktrans %}</p>{% endblock %}diff --git a/templates/account/password_set.html b/templates/account/password_set.htmlindex cd805d6603..5268229e9c 100644--- a/templates/account/password_set.html+++ b/templates/account/password_set.html@@ -3,25 +3,27 @@{% load bootstrap_form from bootstrap3 %}{% block content %}-<div class="row">+ <div class="row"><div class="col-sm-6"><div class="panel panel-default"><div class="panel-body">- <form method="post" novalidate action="{% url 'account_set_password' %}">+ <form method="post" novalidate action="{% url "account_set_password" %}">{% csrf_token %}<fieldset>- <legend class="text-center">{% trans 'Password Reset' %}</legend>+ <legend class="text-center">+ {% trans "Password Reset" context "Password set form legend" %}+ </legend>{% bootstrap_form form %}<input type="hidden" name="next" value="{{ next }}" /></fieldset><div class="form-group text-right"><button class="btn btn-primary">- {% trans "Continue" %}+ {% trans "Continue" context "Password set form primary action" %}</button></div></form></div></div></div>-</div>+ </div>{% endblock %}diff --git a/templates/account/signup.html b/templates/account/signup.htmlindex 309f49212c..762022ada0 100644--- a/templates/account/signup.html+++ b/templates/account/signup.html@@ -3,30 +3,35 @@{% load staticfiles %}{% load i18n %}-{% block title %}{% trans "Sign Up" %} — {{ block.super }}{% endblock %}+{% block title %}{% trans "Sign Up" context "Signup page title" %} — {{ block.super }}{% endblock %}{% block content %}<div class="col-lg-10 offset-lg-1 col-sm-12"><div class="row login"><div class="col-md-6 login__register"><div class="login__register-link">- <h3>{% trans "Already have an account?" %}</h3>- <img class="singup-img" src="{% static 'images/pirate_login.png' %}" srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">- <p><a href="{% url 'account_login' %}" class="btn secondary">{% trans "Log in" %}</a></p>+ <h3>{% trans "Already have an account?" context "Signup form secondary title" %}</h3>+ <img class="signup-img" src="{% static 'images/pirate_login.png' %}"+ srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">+ <p><a href="{% url 'account_login' %}" class="btn secondary">+ {% trans "Log in" context "Signup form secondary action" %}+ </a></p></div></div><div class="col-md-6 login__form"><form method="post" action="{% url 'account_signup' %}"><fieldset>- <h3>{% trans 'Create an account' %}</h3>+ <h3>{% trans "Create an account" context "Signup form title" %}</h3>{% csrf_token %}{% bootstrap_form form %}{% if redirect_field_value %}- <input type="hidden" name="next" name="{{ redirect_field_name }}"+ <input type="hidden" name="{{ redirect_field_name }}"value="{{ redirect_field_value }}"/>{% endif %}</fieldset>- <button type="submit" class="btn btn primary">{% trans "Create an account" %}</button>+ <button type="submit" class="btn btn primary">+ {% trans "Create an account" context "Signup form primary action" %}+ </button></form></div></div>