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

Proposed by Karl Williams on 2019-08-19
Status: Merged
Approved by: Karl Williams on 2019-08-20
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) 2019-08-19 Approve on 2019-08-20
Barry McGee 2019-08-19 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.
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.

Anthony Dillon (ya-bo-ng) :
review: Approve
1709. By Karl Williams on 2019-08-20

Layout tweaks for the applications table

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/webui/templates/account/applications.html'
--- src/webui/templates/account/applications.html 2014-12-09 21:41:56 +0000
+++ src/webui/templates/account/applications.html 2019-08-20 09:40:30 +0000
@@ -1,4 +1,4 @@
1{% extends "base.html" %}1{% extends "vanilla/base.html" %}
2{% load i18n %}2{% load i18n %}
33
4{% comment %}4{% comment %}
@@ -9,42 +9,49 @@
9{% block title %}{% trans "Applications you use" %}{% endblock %}9{% block title %}{% trans "Applications you use" %}{% endblock %}
1010
11{% block text_title %}11{% block text_title %}
12 <h1 class="u1-h-main">{% trans "Applications you use" %}</h1>12 <h1>{% trans "My account" %}</h1>
13{% endblock %}13{% endblock %}
1414
15{% block content %}15{% block content %}
16{% if tokens %}16<section class="p-strip">
17<p>17
18 {% 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 %}18<h2>{% trans "Applications you use" %}</h2>
19</p>19 {% if tokens %}
2020 <p>
21<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 {% 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 %}22 </p>
23</p>23 <p>
2424 {% 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 %}
25<section class="used-applications">25 </p>
26 <h3>{% trans "Applications you last used" %}</h3>26 <h3>{% trans "Applications you last used" %}</h3>
27 <table class="listing">27 <div style="overflow: scroll">
28 <tbody>28 <table class="p-table" style="min-width: 28em">
29 {% for token in tokens %}29 <thead>
30 <tr>30 <tr>
31 <td data-qa-id="application_token">{{ token.name }}</td>31 <th style="width: 50%;">Application name</th>
32 <td class="application-date">{{ token.date_created|date:"Y/m/d" }}</td>32 <th style="width: 30%;">Date created</th>
33 <td class="actions">33 <th style="width: 20%;"></th>
34 <form action="{% url 'applications' %}" method="post">34 </tr>
35 {% csrf_token %}35 </thead>
36 <input type="hidden" name="token_id" value="{{ token.pk }}" />36 <tbody>
37 <button type="submit" class="cta btn-sm secondary" name="Delete" data-qa-id="delete_application">37 {% for token in tokens %}
38 <span>{% trans "Delete" %}</span>38 <tr>
39 </button>39 <td data-qa-id="application_token">{{ token.name }}</td>
40 </form>40 <td>{{ token.date_created|date:"Y/m/d" }}</td>
41 </td>41 <td class="u-align--right">
42 </tr>42 <form action="{% url 'applications' %}" method="post">
43 {% csrf_token %}
44 <input type="hidden" name="token_id" value="{{ token.pk }}" />
45 <button type="submit" class="p-button--negative" name="Delete" data-qa-id="delete_application">{% trans "Delete" %}</button>
46 </form>
47 </td>
48 </tr>
43 {% endfor %}49 {% endfor %}
44 </tbody>50 </tbody>
45 </table>51 </table>
52 </div>
53 {% else %}
54 <p>{% trans "You don't have any applications associated with this account." %}</p>
55 {% endif %}
46</section>56</section>
47{% else %}
48<p>{% trans "You don't have any applications associated with this account." %}</p>
49{% endif %}
50{% endblock %}57{% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: