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

Proposed by Karl Williams
Status: Merged
Approved by: Karl Williams
Approved revision: 1703
Merged at revision: 1703
Proposed branch: lp:~deadlight/canonical-identity-provider/account-activity
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Prerequisite: lp:~deadlight/canonical-identity-provider/delete-account
Diff against target: 119 lines (+44/-36)
3 files modified
src/identityprovider/static_src/scss/styles.scss (+7/-0)
src/webui/templates/account/auth_log.html (+37/-35)
src/webui/templates/vanilla/widgets/personal-menu.html (+0/-1)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/account-activity
Reviewer Review Type Date Requested Status
Anthony Dillon (community) Approve
Review via email: mp+371207@code.launchpad.net

Description of the change

Updated the account activity page to Vanilla Framework

QA:

- source env/bin/activate
- make start-db
- make run
- Visit http://[CONTAINER IP]:8000/ in your browser
- Create an account using the form
- Log out
- Log back in
- Go to http://[CONTAINER IP]:8000/activity and see that login in the table

To post a comment you must log in.
Revision history for this message
Barry McGee (barry-mcgee) wrote :

lgtm

Revision history for this message
Barry McGee (barry-mcgee) wrote :

No QA.

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

QA +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/identityprovider/static_src/scss/styles.scss'
2--- src/identityprovider/static_src/scss/styles.scss 2019-08-12 15:22:05 +0000
3+++ src/identityprovider/static_src/scss/styles.scss 2019-08-12 15:22:05 +0000
4@@ -57,3 +57,10 @@
5 margin-left: $sph-inner;
6 }
7 }
8+
9+// Custom truncated table cells
10+.p-table__item--truncate {
11+ text-overflow: ellipsis;
12+ overflow: hidden;
13+ white-space: nowrap;
14+}
15
16=== modified file 'src/webui/templates/account/auth_log.html'
17--- src/webui/templates/account/auth_log.html 2016-07-06 02:49:14 +0000
18+++ src/webui/templates/account/auth_log.html 2019-08-12 15:22:05 +0000
19@@ -1,4 +1,4 @@
20-{% extends "base.html" %}
21+{% extends "vanilla/base.html" %}
22 {% load i18n %}
23 {% comment %}
24 Copyright 2015 Canonical Ltd. This software is licensed under the
25@@ -8,46 +8,48 @@
26 {% block title %}{% trans "Account activity" %}{% endblock %}
27
28 {% block text_title %}
29- <h1 class="u1-h-main">{% trans "Account activity" %}</h1>
30+ <h1>{% trans "My account" %}</h1>
31 {% endblock %}
32
33 {% block content %}
34+<section class="p-strip">
35+ <h2>Account activity</h2>
36 {% if auth_log %}
37 {% if full_auth_log_length > auth_log|length %}
38-<p>
39- {% blocktrans with accesses=auth_log|length%}The {{ accesses }} most recent accesses made with your account are shown here.{% endblocktrans %}
40-</p>
41+
42+ <p>
43+ {% blocktrans with accesses=auth_log|length%}The {{ accesses }} most recent accesses made with your account are shown here.{% endblocktrans %}
44+ </p>
45+ {% else %}
46+ <p>
47+ {% blocktrans %}Recent accesses made with your account are shown here.{% endblocktrans %}
48+ </p>
49+ {% endif %}
50+ <p>
51+ {% blocktrans %}This includes authentication requests made by other sites and devices.{% endblocktrans %}
52+ </p>
53+ <table class="p-table">
54+ <thead>
55+ <tr>
56+ <th>{% trans "Time/date" %}</th>
57+ <th>{% trans "Type" %}</th>
58+ <th>{% trans "IP address" %}</th>
59+ <th>{% trans "User Agent/Browser" %}</th>
60+ </tr>
61+ </thead>
62+ <tbody>
63+ {% for attempt in auth_log %}
64+ <tr>
65+ <td class="p-table__item--truncate" title="{{ attempt.when_created }}">{{ attempt.when_created }}</td>
66+ <td>{{ attempt.log_type_label }}</td>
67+ <td>{{ attempt.remote_ip }}</td>
68+ <td class="p-table__item--truncate" title="{{ attempt.user_agent }}">{{ attempt.user_agent }}</td>
69+ </tr>
70+ {% endfor %}
71+ </tbody>
72+ </table>
73 {% else %}
74-<p>
75- {% blocktrans %}Recent accesses made with your account are shown here.{% endblocktrans %}
76-</p>
77+<p>{% trans "Your account has no activity yet." %}</p>
78 {% endif %}
79-<p>
80- {% blocktrans %}This includes authentication requests made by other sites and devices.{% endblocktrans %}
81-</p>
82-<section class="account-activity">
83- <table class="listing">
84- <thead>
85- <tr>
86- <td class='time-date'>{% trans "Time/date" %}</td>
87- <td class='log-type'>{% trans "Type" %}</td>
88- <td class='ip-address'>{% trans "IP address" %}</td>
89- <td class='user-agent'>{% trans "User Agent/Browser" %}</td>
90- </tr>
91- </thead>
92- <tbody>
93- {% for attempt in auth_log %}
94- <tr>
95- <td class="time-date">{{ attempt.when_created }}</td>
96- <td class="log-type">{{ attempt.log_type_label }}</td>
97- <td class="ip-address">{{ attempt.remote_ip }}</td>
98- <td class="user-agent">{{ attempt.user_agent }}</td>
99- </tr>
100- {% endfor %}
101- </tbody>
102- </table>
103 </section>
104-{% else %}
105-<p>{% trans "Your account has no activity yet." %}</p>
106-{% endif %}
107 {% endblock %}
108
109=== modified file 'src/webui/templates/vanilla/widgets/personal-menu.html'
110--- src/webui/templates/vanilla/widgets/personal-menu.html 2019-08-12 15:22:05 +0000
111+++ src/webui/templates/vanilla/widgets/personal-menu.html 2019-08-12 15:22:05 +0000
112@@ -40,7 +40,6 @@
113 {% url 'auth_log' as auth_log_url %}
114 {% if current_section == 'auth_log' %}
115 {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item is-active" %}
116- {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item is-active" %}
117 {% else %}
118 {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item" %}
119 {% endif %}

Subscribers

People subscribed via source and target branches

to all changes: