From e2ed828f9df270cdf967b73ab42140ff00ac6835 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sun, 17 Sep 2023 14:21:21 +0200 Subject: [PATCH] fix: make public key section optional --- views/profile.pug | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/views/profile.pug b/views/profile.pug index 23e654d..1c141c3 100644 --- a/views/profile.pug +++ b/views/profile.pug @@ -139,26 +139,27 @@ block content section h2 Profile information - h3 Public key - kx-key.kx-item(data-keydata=data.publicKey) - details(aria-label="Key") - summary - .info - p - span.title= data.identifier - span.subtitle-wrapper - | [ - span.subtitle= data.publicKey.fetch.method - | ] - .content - .subsection - img(src='/static/img/link.png') - div - p Key link: - a.u-key(href=data.publicKey.fetch.resolvedUrl rel="pgpkey" aria-label="Link to cryptographic key")= data.publicKey.fetch.resolvedUrl - hr - if (data.profileType === 'openpgp') + if (data && data.publicKey) + h3 Public key + kx-key.kx-item(data-keydata=data.publicKey) + details(aria-label="Key") + summary + .info + p + span.title= data.identifier + span.subtitle-wrapper + | [ + span.subtitle= data.publicKey.fetch.method + | ] + .content .subsection - img(src='/static/img/qrcode.png') + img(src='/static/img/link.png') div - button(onClick=`showQR('${data.publicKey.fingerprint}', 'fingerprint')` aria-label='Show QR code for cryptographic fingerprint') Show OpenPGP fingerprint QR \ No newline at end of file + p Key link: + a.u-key(href=data.publicKey.fetch.resolvedUrl rel="pgpkey" aria-label="Link to cryptographic key")= data.publicKey.fetch.resolvedUrl + hr + if (data.profileType === 'openpgp') + .subsection + img(src='/static/img/qrcode.png') + div + button(onClick=`showQR('${data.publicKey.fingerprint}', 'fingerprint')` aria-label='Show QR code for cryptographic fingerprint') Show OpenPGP fingerprint QR \ No newline at end of file