Some users experience copying whitespace with their text contents when
copying from a <dd></dd> tag. As such we replace those instances with a
readonly textarea.
Additionally fix mismatching <dd></dt> tags where they show up.
Signed-off-by: Luca Matei Pintilie <luca@lucamatei.com>
---
Followup from
https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3Cukvgro6xwwoc6z4w6zl6tfwqdqabn3cmseoq7ecixvovcqdq3u@4ewyjll4wkpa%3E
metasrht/templates/oauth-personal-token.html | 2 +-
metasrht/templates/oauth-registered.html | 4 ++--
metasrht/templates/oauth2-client-registered.html | 4 ++--
metasrht/templates/oauth2-manage-client.html | 10 +++++-----
metasrht/templates/oauth2-personal-token-issued.html | 2 +-
scss/main.scss | 4 ++++
6 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/metasrht/templates/oauth-personal-token.html b/metasrht/templates/oauth-personal-token.html
index a2e9f6a..820bb14 100644
--- a/metasrht/templates/oauth-personal-token.html
+++ b/metasrht/templates/oauth-personal-token.html
@@ -10,7 +10,7 @@
{% if token %}
<dl>
<dt>Personal Access Token</dt>
- <dd>{{token}}</dt>
+ <dd><textarea readonly class="width-full" rows="1">{{token}}</textarea></dd>
</dl>
<p>
Your access token <strong>will never be shown to you again</strong>. Keep
diff --git a/metasrht/templates/oauth-registered.html b/metasrht/templates/oauth-registered.html
index f484ab4..5509628 100644
--- a/metasrht/templates/oauth-registered.html
+++ b/metasrht/templates/oauth-registered.html
@@ -14,9 +14,9 @@
{% endif %}
<dl>
<dt>Client ID</dt>
- <dd>{{client_id}}</dd>
+ <dd><textarea readonly class="width-full" rows="1">{{client_id}}</textarea></dd>
<dt>Client Secret</dt>
- <dd>{{client_secret}}</dt>
+ <dd><textarea readonly class="width-full" rows="1">{{client_secret}}</textarea></dd>
</dl>
<p>
Your client secret <strong>will never be shown to you again</strong>, though you can
diff --git a/metasrht/templates/oauth2-client-registered.html b/metasrht/templates/oauth2-client-registered.html
index bb18a0a..7d19454 100644
--- a/metasrht/templates/oauth2-client-registered.html
+++ b/metasrht/templates/oauth2-client-registered.html
@@ -17,9 +17,9 @@
{% endif %}
<dl>
<dt>Client ID</dt>
- <dd><code>{{client_uuid}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="1">{{client_uuid}}</textarea></dd>
<dt>Client secret</dt>
- <dd><code>{{client_secret}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="1">{{client_secret}}</textarea></dd>
</dl>
<div class="alert alert-danger">
Your client secret <strong>will never be shown to you again</strong>.
diff --git a/metasrht/templates/oauth2-manage-client.html b/metasrht/templates/oauth2-manage-client.html
index bf6b37a..da70b34 100644
--- a/metasrht/templates/oauth2-manage-client.html
+++ b/metasrht/templates/oauth2-manage-client.html
@@ -53,17 +53,17 @@
<div class="col-md-4">
<dl>
<dt>Client ID</dt>
- <dd><code>{{client.uuid}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="1">{{client.uuid}}</textarea></dd>
<dt>Name</dt>
- <dd>{{client.name}}</dt>
+ <dd>{{client.name}}</dd>
<dt>Description</dt>
- <dd>{{client.description}}</dt>
+ <dd>{{client.description}}</dd>
<dt>Informative URL</dt>
<dd>
<a href="{{client.url}}" rel="nofollow noopener">{{client.url}}</a>
- </dt>
+ </dd>
<dt>Redirect URL</dt>
- <dd><code>{{client.redirectUrl}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="1">{{client.redirectUrl}}</textarea></dd>
</dl>
</div>
</div>
diff --git a/metasrht/templates/oauth2-personal-token-issued.html b/metasrht/templates/oauth2-personal-token-issued.html
index 74fc991..77f883c 100644
--- a/metasrht/templates/oauth2-personal-token-issued.html
+++ b/metasrht/templates/oauth2-personal-token-issued.html
@@ -7,7 +7,7 @@
<div class="col-md-12">
<dl>
<dt>Personal Access Token</dt>
- <dd><code>{{secret}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="1">{{secret}}</textarea></dd>
</dl>
<p>
Your access token <strong>will never be shown to you again</strong>. Keep
diff --git a/scss/main.scss b/scss/main.scss
index 6744d31..f796b50 100644
--- a/scss/main.scss
+++ b/scss/main.scss
@@ -9,6 +9,10 @@ input[type="checkbox"] {
top: inherit;
}
+.width-full {
+ width: 100%;
+}
+
.progress {
position: relative;
overflow: visible;
--
2.45.2