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

Proposed by Karl Williams
Status: Merged
Approved by: Karl Williams
Approved revision: 1709
Merged at revision: 1709
Proposed branch: lp:~deadlight/canonical-identity-provider/applications
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Prerequisite: lp:~deadlight/canonical-identity-provider/devices-list
Diff against target: 91 lines (+40/-33)
1 file modified
src/webui/templates/account/applications.html (+40/-33)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/applications
Reviewer Review Type Date Requested Status
Anthony Dillon (community) Approve
Barry McGee Pending
Review via email: mp+371462@code.launchpad.net

Description of the change

Converted the /+applications page to Vanilla Framework

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/+applications and see the version for no applications

Note: I'm not sure how to test adding applications in development but you can hack the template file (applications.html) to display a dummy table by stripping out the tests and missing variables.

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

QA looks good but would be nice to overflow the tables. I believe they will require a wrapping div with some styles.

Revision history for this message
Anthony Dillon (ya-bo-ng) :
review: Approve
1709. By Karl Williams

Layout tweaks for the applications table

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webui/templates/account/applications.html'
2--- src/webui/templates/account/applications.html 2014-12-09 21:41:56 +0000
3+++ src/webui/templates/account/applications.html 2019-08-20 09:40:30 +0000
4@@ -1,4 +1,4 @@
5-{% extends "base.html" %}
6+{% extends "vanilla/base.html" %}
7 {% load i18n %}
8
9 {% comment %}
10@@ -9,42 +9,49 @@
11 {% block title %}{% trans "Applications you use" %}{% endblock %}
12
13 {% block text_title %}
14- <h1 class="u1-h-main">{% trans "Applications you use" %}</h1>
15+ <h1>{% trans "My account" %}</h1>
16 {% endblock %}
17
18 {% block content %}
19-{% if tokens %}
20-<p>
21- {% blocktrans %}You have used the applications shown here to access your account. If you have stopped using one of these and would like to prevent it from being used to access your account, click its "Delete" button below.{% endblocktrans %}
22-</p>
23-
24-<p>
25- {% blocktrans %}You can choose to allow an application to have access again if you like by opening that application and instructing it to access your account. You'll have to provide your username and password before it will be granted access.{% endblocktrans %}
26-</p>
27-
28-<section class="used-applications">
29- <h3>{% trans "Applications you last used" %}</h3>
30- <table class="listing">
31- <tbody>
32- {% for token in tokens %}
33- <tr>
34- <td data-qa-id="application_token">{{ token.name }}</td>
35- <td class="application-date">{{ token.date_created|date:"Y/m/d" }}</td>
36- <td class="actions">
37- <form action="{% url 'applications' %}" method="post">
38- {% csrf_token %}
39- <input type="hidden" name="token_id" value="{{ token.pk }}" />
40- <button type="submit" class="cta btn-sm secondary" name="Delete" data-qa-id="delete_application">
41- <span>{% trans "Delete" %}</span>
42- </button>
43- </form>
44- </td>
45- </tr>
46+<section class="p-strip">
47+
48+<h2>{% trans "Applications you use" %}</h2>
49+ {% if tokens %}
50+ <p>
51+ {% blocktrans %}You have used the applications shown here to access your account. If you have stopped using one of these and would like to prevent it from being used to access your account, click its "Delete" button below.{% endblocktrans %}
52+ </p>
53+ <p>
54+ {% blocktrans %}You can choose to allow an application to have access again if you like by opening that application and instructing it to access your account. You'll have to provide your username and password before it will be granted access.{% endblocktrans %}
55+ </p>
56+ <h3>{% trans "Applications you last used" %}</h3>
57+ <div style="overflow: scroll">
58+ <table class="p-table" style="min-width: 28em">
59+ <thead>
60+ <tr>
61+ <th style="width: 50%;">Application name</th>
62+ <th style="width: 30%;">Date created</th>
63+ <th style="width: 20%;"></th>
64+ </tr>
65+ </thead>
66+ <tbody>
67+ {% for token in tokens %}
68+ <tr>
69+ <td data-qa-id="application_token">{{ token.name }}</td>
70+ <td>{{ token.date_created|date:"Y/m/d" }}</td>
71+ <td class="u-align--right">
72+ <form action="{% url 'applications' %}" method="post">
73+ {% csrf_token %}
74+ <input type="hidden" name="token_id" value="{{ token.pk }}" />
75+ <button type="submit" class="p-button--negative" name="Delete" data-qa-id="delete_application">{% trans "Delete" %}</button>
76+ </form>
77+ </td>
78+ </tr>
79 {% endfor %}
80- </tbody>
81+ </tbody>
82 </table>
83+ </div>
84+ {% else %}
85+ <p>{% trans "You don't have any applications associated with this account." %}</p>
86+ {% endif %}
87 </section>
88-{% else %}
89-<p>{% trans "You don't have any applications associated with this account." %}</p>
90-{% endif %}
91 {% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: