Merge lp:~deadlight/canonical-identity-provider/emails into lp:~deadlight/canonical-identity-provider/vanilla

Proposed by Karl Williams
Status: Merged
Approved by: Karl Williams
Approved revision: 1704
Merged at revision: 1704
Proposed branch: lp:~deadlight/canonical-identity-provider/emails
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Prerequisite: lp:~deadlight/canonical-identity-provider/account-activity
Diff against target: 217 lines (+89/-97)
2 files modified
package.json (+1/-1)
src/webui/templates/account/emails.html (+88/-96)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/emails
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Anthony Dillon Pending
Review via email: mp+371446@code.launchpad.net

This proposal supersedes a proposal from 2019-08-13.

Description of the change

Updated the vanilla version and styled the email settings page

QA:
- npm i
- ./node_modules/gulp/bin/gulp.js sass
- source env/bin/activate
- make start-db
- make run
- Visit http://[CONTAINER IP]:8000/ in your browser
- Create an account using the form
- Go to http://[CONTAINER IP]:8000/+emails and try adding new addresses, etc.

To post a comment you must log in.
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote : Posted in a previous version of this proposal

LGTM, few comments inline.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'package.json'
--- package.json 2019-07-15 13:38:59 +0000
+++ package.json 2019-08-19 08:30:11 +0000
@@ -8,6 +8,6 @@
8 "gulp-csslint": "~0.1.5",8 "gulp-csslint": "~0.1.5",
9 "gulp-csso": "~0.2.9",9 "gulp-csso": "~0.2.9",
10 "gulp-sass": "4.0.2",10 "gulp-sass": "4.0.2",
11 "vanilla-framework": "2.0.1"11 "vanilla-framework": "2.2.0"
12 }12 }
13}13}
1414
=== modified file 'src/webui/templates/account/emails.html'
--- src/webui/templates/account/emails.html 2017-02-26 01:28:59 +0000
+++ src/webui/templates/account/emails.html 2019-08-19 08:30:11 +0000
@@ -1,113 +1,105 @@
1{% extends "base.html" %}1{% extends "vanilla/base.html" %}
2{% load i18n url_with_token %}2{% load i18n url_with_token %}
33
4{% comment %}4{% comment %}
5Copyright 2010 Canonical Ltd. This software is licensed under the5Copyright 2010-2019 Canonical Ltd. This software is licensed under the
6GNU Affero General Public License version 3 (see the file LICENSE).6GNU Affero General Public License version 3 (see the file LICENSE).
7{% endcomment %}7{% endcomment %}
88
9{% block html_extra %}data-qa-id="account_emails"{% endblock %}9{% block html_extra %}data-qa-id="account_emails"{% endblock %}
1010
11{% block title %}11{% block title %}
12 {% blocktrans %}{{ account_displayname }}'s email addresses{% endblocktrans %}12 {% blocktrans %}Your email addresses{% endblocktrans %}
13{% endblock %}13{% endblock %}
1414
15{% block text_title %}<h1 class="u1-h-main">{% trans "Your email addresses" %}</h1>{% endblock %}15{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
1616
17{% block content %}17{% block content %}
1818 <section class="p-strip">
19<p>19 <h2>{% trans "Your email addresses" %}</h2>
2020 {% if not verified_emails and not unverified_emails %}
21{% if not verified_emails and not unverified_emails %}21 <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p>
22 <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p>22 {% endif %}
23{% endif %}23 {% if verified_emails %}
2424 <section class="p-strip is-shallow u-no-padding--bottom">
25{% if verified_emails %}25 <table class="p-table">
2626 <thead>
27 <section class="verified-emails">27 <tr>
2828 <th>{% trans "Verified" %}</th>
29 <h3>{% trans "Verified" %}</h3>29 </tr>
3030 </thead>
31 <table class="listing hover">31 <tbody>
32 {% for email in verified_emails %}32 {% for email in verified_emails %}
33 <tr>33 <tr>
34 <td class="email{% if email.is_preferred %} preferred-email{% endif %}">34 <td class="email{% if email.is_preferred %} preferred-email{% endif %}">
35 <span class="email">{{ email }}</span>35 <span class="email">{{ email }}</span>
36 {% if email.is_preferred %}36 {% if email.is_preferred %}
37 <span class="preferred-label">{% trans "(preferred)" %}</span>37 <span class="preferred-label">{% trans "(preferred)" %}</span>
38 {% endif %}38 {% endif %}
39 </td>39 </td>
40 {% if not readonly %}40 {% if not readonly %}
41 <td class="actions">41 <td class="u-align-text--right">
42 {% if not email.is_preferred and num_emails > 1 %}42 {% if not email.is_preferred and num_emails > 1 %}
43 <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">43 <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">{% trans "Delete" %}</a>
44 <span>{% trans "Delete" %}</span>44 {% endif %}
45 </a>45 </td>
46 {% endif %}46 {% endif %}
47 </td>47 </tr>
48 {% endif %}48 {% endfor %}
49 </tr>49 </tbody>
50 {% endfor %}50 </table>
51 </table>51 </section>
5252 {% endif %}
53 </section>53
5454 {% if unverified_emails %}
55{% endif %}55 <section class="p-strip is-shallow">
5656 <table class="listing hover">
57{% if unverified_emails %}57 <thead>
5858 <tr>
59 <section class="unverified-emails">59 <th>{% trans "unverified" %}</th>
6060 </tr>
61 <h3>{% trans "Unverified" %}</h3>61 </thead>
6262 <tbody>
63 <table class="listing hover">63 {% for email in unverified_emails %}
64 {% for email in unverified_emails %}64 <tr class="unverified-emails">
65 <tr class="unverified-emails">65 <td class="email">{{ email }}</td>
66 <td class="email">{{ email }}</td>66 {% if not readonly %}
67 {% if not readonly %}67 <td class="u-align-text--right">
68 <td class="actions">68 <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}"{% trans "Verify" %}</a>
69 <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}" class="verify-email btn-sm"><span>{% trans "Verify" %}</span></a>69 {% if num_emails > 1 %}
70 {% if num_emails > 1 %}70 <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}">{% trans "Delete" %}</a>
71 <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}" class="btn-sm">71 {% endif %}
72 <span>{% trans "Delete" %}</span>72 </td>
73 </a>73 {% endif %}
74 {% endif %}74 </tr>
75 </td>75 {% endfor %}
76 {% endif %}76 </table>
77 </tr>77 </section>
78 {% endfor %}78 {% endif %}
79 </table>79
8080 {% if not readonly %}
81 </section>81 <h3>{% trans "Add email address" %}</h3>
8282 <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to verify it.{% endblocktrans %}</p>
83{% endif %}83 <div class="row">
8484 <div class="col-6">
85{% if not readonly %}85 <form action="{% url_with_token 'new_email' %}" method="post">
8686 {% csrf_token %}
87 <section class="add-emails">87 <div class="p-form-validation{% if form.newemail.errors %} is-error{% endif %}">
8888 <label for="id_newemail">Email address</label>
89 <h3>{% trans "Add email address" %}</h3>89 {{ form.newemail }}
9090 {% if form.newemail.errors %}
91 <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to verify it.{% endblocktrans %}</p>91 <p class="p-form-validation__message">
9292 <strong>Error:</strong> {{ form.newemail.errors|first }}
93 <form action="{% url_with_token 'new_email' %}" method="post">93 </p>
94 {% csrf_token %}94 {% endif %}
95 <div class="input-row">95 </div>
96 {{ form.newemail }}96 <p class="actions">
97 {% if form.newemail.errors %}97 <button type="submit" class="p-button--positive" name="continue" data-qa-id="add_new_email">{% trans "Add address" %}</button>
98 <span class="error">{{ form.newemail.errors|first }}</span>98 <a class="p-button--neutral" href="/">{% trans "Cancel" %}</a>
99 {% endif %}99 </p>
100 </form>
101 </div>
100 </div>102 </div>
101 <p class="actions">103 {% endif %}
102 <button type="submit" class="btn cta" name="continue" data-qa-id="add_new_email">
103 <span>{% trans "Add address" %}</span>
104 </button>
105 <a class="cta secondary" href="/">{% trans "Cancel" %}</a>
106 </p>
107 </form>
108
109 </section>104 </section>
110
111{% endif %}
112
113{% endblock %}105{% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: