Merge ~roadmr/canonical-identity-provider:tweak-username-instructions-positioning into canonical-identity-provider:master

Proposed by Daniel Manrique
Status: Merged
Approved by: Daniel Manrique
Approved revision: edf2dcacb808130149aa8d4da951f355f5b3cdb5
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~roadmr/canonical-identity-provider:tweak-username-instructions-positioning
Merge into: canonical-identity-provider:master
Diff against target: 39 lines (+11/-11)
1 file modified
src/webui/templates/registration/_create_account_form.html (+11/-11)
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Review via email: mp+386908@code.launchpad.net

Commit message

Visual tweaks to username format instructions.

* move instructions below the field
* fix css, nesting and styling
* simplify length instructions

Description of the change

With help from web team (hatch / blr).

https://people.canonical.com/~roadmr/explanation-tweak-1.png

(screenshot doesn't show the new instructions which state "between 3 and 32 characters" instead of "more than 3 and fewer than 32" (it's more concise).

To post a comment you must log in.
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/webui/templates/registration/_create_account_form.html b/src/webui/templates/registration/_create_account_form.html
2index dd3eebb..8dc70de 100644
3--- a/src/webui/templates/registration/_create_account_form.html
4+++ b/src/webui/templates/registration/_create_account_form.html
5@@ -37,23 +37,23 @@
6
7 {% if create_form.username %}
8 <div class="p-form-validation{% if create_form.username.errors %} is-error{% endif %} username-input">
9- <label for="id_username">{% trans "Username" %}
10- {% ifswitch USERNAME_SHOW_REQUIREMENTS %}
11- {% if not create_form.username.errors %}
12- <ul><li class="p-form-validation__message">{% trans "More than 3 and less than 32 characters long." %}</li>
13- <li class="p-form-validation__message">{% trans "Allowed: lowercase letters, numbers and hyphens." %}</li>
14- <li class="p-form-validation__message">{% trans "<strong>NOT</strong> allowed: CAPITAL letters, special characters." %}</li>
15- <li class="p-form-validation__message">{% trans "<strong>NOT</strong> allowed: only numbers or consecutive hyphens." %}</li>
16- </ul>
17- {% endif %}
18- {% endifswitch %}
19- </label>
20+ <label for="id_username">{% trans "Username" %}</label>
21 {% if create_form.username.errors %}
22 <p class="p-form-validation__message" style="font-style: italic">
23 <strong>Error:</strong> {{ create_form.username.errors|first }}
24 </p>
25 {% endif %}
26 {{ create_form.username }}
27+ {% ifswitch USERNAME_SHOW_REQUIREMENTS %}
28+ {% if not create_form.username.errors %}
29+ <ul class="p-form-help-text">
30+ <li style="font-size: 0.75rem">{% trans "Between 3 and 32 characters long." %}</li>
31+ <li style="font-size: 0.75rem">{% trans "Allowed: lowercase letters, numbers and hyphens." %}</li>
32+ <li style="font-size: 0.75rem">{% trans "<strong>NOT</strong> allowed: CAPITAL letters, special characters." %}</li>
33+ <li style="font-size: 0.75rem">{% trans "<strong>NOT</strong> allowed: only numbers or consecutive hyphens." %}</li>
34+ </ul>
35+ {% endif %}
36+ {% endifswitch %}
37 </div>
38 {% endif %}
39 {% include "vanilla/widgets/passwords.html" with edit_account_labels=1 fields=create_form %}

Subscribers

People subscribed via source and target branches