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.
---
I am not a sourcehut developer, so this testing was done very brifely
in a container setup.
https://git.sr.ht/~emersion/sr.ht-container-compose
I've tested this as well as I could, but it is possible I missed
something.
The changes are copy pasted, so I don't think it will break anything,
it at least didn't where I did test it.
I am not aware of a todo.sr.ht item for this, it's just something that
has been discussed in #sr.ht on libera, so feel free to reject this if
it's not the appropriate solution or if this is intended behaviour.
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..5ea3b23 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="2">{{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..2c06290 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="2">{{client_id}}</textarea></dd>
<dt>Client Secret</dt>
- <dd>{{client_secret}}</dt>
+ <dd><textarea readonly class="width-full" rows="2">{{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..324b317 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="2">{{client_uuid}}</textarea></dd>
<dt>Client secret</dt>
- <dd><code>{{client_secret}}</code></dt>
+ <dd><textarea readonly class="width-full" rows="2">{{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..f64f6db 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="2">{{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="2">{{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..3ac540b 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="2">{{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