Skip to content

Commit

Permalink
Added copy password button to secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Apr 18, 2024
1 parent e1c41fe commit b49393d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fredagscafeen/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"BEVCO_PASSWORD",
"Bevco password",
"[email protected]",
"https://www.bevco.dk/account/login",
"https://www.bevco.dk/login",
),
(
"DRINX_PASSWORD",
Expand All @@ -102,13 +102,13 @@
"KARET_PASSWORD",
"Hængelås-kodeord til karet",
None,
"https://fredagscafeen.dk",
None,
),
(
"KOELESKABE_PASSWORD",
"Hængelås-kodeord til køleskabene i Nygaardkælderen",
None,
"https://fredagscafeen.dk",
None,
),
]

Expand Down
12 changes: 11 additions & 1 deletion web/templates/secrets_admin.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{% extends "admin/base_site.html" %}
{% block scripts %}
<script>
function CopyText() {
var text = document.getElementById('value')
text.select();
document.execCommand('copy')
}
</script>
{% endblock scripts %}
{% block content %}
<table>
<tr>
Expand All @@ -21,7 +30,8 @@
</td>
<td>
{% if value != None %}
<code>{{ value }}</code>
<code id="value">{{ value }}</code>
<button onclick="CopyText()">Copy</button>
{% else %}
<b>Missing from environment</b>
{% endif %}
Expand Down

0 comments on commit b49393d

Please sign in to comment.