feat: update templates

This commit is contained in:
Yarmo Mackenbach 2023-07-13 11:11:33 +02:00
parent 9864a5fb66
commit 348df9f17f
No known key found for this signature in database
GPG key ID: 3C57D093219103A3
2 changed files with 32 additions and 34 deletions

View file

@ -1,20 +1,23 @@
extends templates/base.pug extends templates/base.pug
mixin generateUser(user, isPrimary) mixin generatePersona(persona, isPrimary)
h2 h2
span.p-email #{user.userData.email} if persona.email
span.p-email Identity claims (#{persona.email})
else
span.p-email Identity claims
if isPrimary if isPrimary
small.primary primary small.primary primary
if user.userData.comment if persona.description
span.p-comment ⓘ #{user.userData.comment} span.p-comment ⓘ #{persona.description}
each claim in user.claims each claim in persona.claims
if claim.matches.length > 0 if claim.matches.length > 0
kx-claim.kx-item(data-claim=claim) kx-claim.kx-item(data-claim=claim)
details(aria-label="Claim") details(aria-label="Claim")
summary summary
.info .info
p.subtitle= claim.matches[0].serviceprovider.name p.subtitle= claim.display.serviceproviderName
p.title= claim.matches[0].profile.display p.title= claim.display.name
.icons .icons
.verificationStatus(data-value='running') .verificationStatus(data-value='running')
.inProgress .inProgress
@ -22,12 +25,12 @@ mixin generateUser(user, isPrimary)
.subsection .subsection
img(src='/static/img/link.png') img(src='/static/img/link.png')
div div
if (claim.matches[0].profile.uri) if (claim.display.url)
p Profile link: p Profile link:
a(rel='me' href=claim.matches[0].profile.uri aria-label="Link to profile")= claim.matches[0].profile.uri a(rel='me' href=claim.display.url aria-label="Link to profile")= claim.display.url
else else
p Profile link: not accessible from browser p Profile link: not accessible from browser
if (claim.matches[0].proof.uri) if (claim.matches.length === 1 && claim.matches[0].proof.uri)
p Proof link: p Proof link:
a(href=claim.matches[0].proof.uri aria-label="Link to proof")= claim.matches[0].proof.uri a(href=claim.matches[0].proof.uri aria-label="Link to proof")= claim.matches[0].proof.uri
else else
@ -36,10 +39,7 @@ mixin generateUser(user, isPrimary)
block content block content
script. script.
kx = { kx = {
key: { publicKey: !{JSON.stringify(data.publicKey)}
url: "!{data && data.key && data.key.fetchURL ? data.key.fetchURL : null}",
object: null
}
} }
if (data && 'errors' in data && data.errors.length > 0) if (data && 'errors' in data && data.errors.length > 0)
@ -80,12 +80,7 @@ block content
dialog#dialog--verifySignature dialog#dialog--verifySignature
div div
form(method='post') form(method='post')
label(for="sigVerInput") Signature label(for="sigVerInput") Signature name
textarea#sigVerInput.input(name='signature')
input.no-margin(type='submit' name='submit' value='VERIFY SIGNATURE')
br
br
label(for="sigVerOutput") Verification result
textarea#sigVerOutput.output(name='message' placeholder='Waiting for input' readonly) textarea#sigVerOutput.output(name='message' placeholder='Waiting for input' readonly)
form(method="dialog") form(method="dialog")
input(type="submit" value="Close") input(type="submit" value="Close")
@ -108,9 +103,9 @@ block content
unless (isSignature && !signature) unless (isSignature && !signature)
#profileHeader.card.card--transparent.card--profileHeader #profileHeader.card.card--transparent.card--profileHeader
img#profileAvatar.u-logo(src=data.extra.avatarURL alt="avatar") img#profileAvatar.u-logo(src=data.personas[data.primaryPersonaIndex].avatarUrl alt="avatar")
p#profileName.p-name= data.keyData.users[data.keyData.primaryUserIndex].userData.name p#profileName.p-name= data.personas[data.primaryPersonaIndex].name
if (enable_message_encryption || enable_signature_verification) if (enable_message_encryption || enable_signature_verification)
.button-wrapper .button-wrapper
@ -119,27 +114,28 @@ block content
if (enable_signature_verification) if (enable_signature_verification)
button(onClick="document.querySelector('#dialog--verifySignature').showModal();") Verify signature button(onClick="document.querySelector('#dialog--verifySignature').showModal();") Verify signature
+generateUser(data.keyData.users[data.keyData.primaryUserIndex], true) +generatePersona(data.personas[data.primaryPersonaIndex], true && data.personas.length > 1)
each user, index in data.keyData.users each persona, index in data.personas
unless index == data.keyData.primaryUserIndex unless index == data.primaryPersonaIndex
+generateUser(user, false) +generatePersona(persona, false)
#profileProofs.card.card--transparent #profileProofs.card.card--transparent
h2 Key h2 Key
kx-key.kx-item(data-keydata=data.keyData) kx-key.kx-item(data-keydata=data.publicKey)
details(aria-label="Key") details(aria-label="Key")
summary summary
.info .info
p.subtitle= data.keyData.key.fetchMethod p.subtitle= data.publicKey.fetch.method
p.title= data.keyData.fingerprint p.title= data.identifier
.content .content
.subsection .subsection
img(src='/static/img/link.png') img(src='/static/img/link.png')
div div
p Key link: p Key link:
a.u-key(href=data.keyData.key.uri rel="pgpkey" aria-label="Link to cryptographic key")= data.keyData.key.uri a.u-key(href=data.publicKey.fetch.resolvedUrl rel="pgpkey" aria-label="Link to cryptographic key")= data.publicKey.fetch.resolvedUrl
hr hr
if (data.profileType === 'openpgp')
.subsection .subsection
img(src='/static/img/qrcode.png') img(src='/static/img/qrcode.png')
div div
button(onClick=`showQR('${data.keyData.fingerprint}', 'fingerprint')` aria-label='Show QR code for cryptographic fingerprint') Show OpenPGP fingerprint QR button(onClick=`showQR('${data.publicKey.fingerprint}', 'fingerprint')` aria-label='Show QR code for cryptographic fingerprint') Show OpenPGP fingerprint QR

View file

@ -18,4 +18,6 @@ html(lang='en')
link(rel='stylesheet' href='/static/main.css') link(rel='stylesheet' href='/static/main.css')
script(type='application/javascript' defer src='/static/openpgp.js' charset='utf-8') script(type='application/javascript' defer src='/static/openpgp.js' charset='utf-8')
script(type='application/javascript' defer src='/static/doipFetchers.js' charset='utf-8')
script(type='application/javascript' defer src='/static/doip.js' charset='utf-8')
script(type='application/javascript' defer src='/static/main.js' charset='utf-8') script(type='application/javascript' defer src='/static/main.js' charset='utf-8')