keyoxide-web/views/profile.pug

165 lines
7 KiB
Text
Raw Normal View History

2021-03-01 07:01:34 -07:00
extends templates/base.pug
2023-07-13 03:11:33 -06:00
mixin generatePersona(persona, isPrimary)
h2
2023-07-13 03:11:33 -06:00
if persona.email
2023-09-15 06:25:15 -06:00
| Identity claims (
span.p-email #{persona.email}
| )
2023-07-13 03:11:33 -06:00
else
2023-09-15 06:25:15 -06:00
| Identity claims
if isPrimary
small.primary primary
2023-07-13 03:11:33 -06:00
if persona.description
2023-09-15 06:25:15 -06:00
span.persona__description.p-comment
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
| #{persona.description}
2023-07-13 03:11:33 -06:00
each claim in persona.claims
2021-06-03 07:23:08 -06:00
if claim.matches.length > 0
2023-09-15 06:25:15 -06:00
kx-claim.kx-item(data-claim=claim,data-status='running')
2021-06-09 05:58:36 -06:00
details(aria-label="Claim")
2021-06-03 07:23:08 -06:00
summary
.info
2023-09-15 06:25:15 -06:00
p
span.title= claim.display.name
span.subtitle-wrapper
| [
span.subtitle= claim.display.serviceproviderName
| ]
2021-06-03 07:23:08 -06:00
.icons
2023-09-15 06:25:15 -06:00
.verificationStatus
2021-06-03 07:23:08 -06:00
.inProgress
2023-09-15 06:25:15 -06:00
<svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"></path></svg>
.success
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>
.failure
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
2021-06-03 07:23:08 -06:00
.content
.subsection
img(src='/static/img/link.png')
div
2023-07-13 03:11:33 -06:00
if (claim.display.url)
2021-06-03 07:23:08 -06:00
p Profile link:
2023-07-13 03:11:33 -06:00
a(rel='me' href=claim.display.url aria-label="Link to profile")= claim.display.url
2021-06-03 07:23:08 -06:00
else
p Profile link: not accessible from browser
2023-07-13 03:11:33 -06:00
if (claim.matches.length === 1 && claim.matches[0].proof.uri)
2021-06-03 07:23:08 -06:00
p Proof link:
2022-04-08 10:22:54 -06:00
a(href=claim.matches[0].proof.uri aria-label="Link to proof")= claim.matches[0].proof.uri
2021-06-03 07:23:08 -06:00
else
p Proof link: not accessible from browser
2021-03-30 08:22:03 -06:00
2021-03-01 07:01:34 -07:00
block content
if (data && 'publicKey' in data)
script.
kx = {
publicKey: !{JSON.stringify(data.publicKey)}
}
2021-05-03 02:46:22 -06:00
2022-10-11 07:19:14 -06:00
if (data && 'errors' in data && data.errors.length > 0)
section
h2 Something went wrong while viewing the profile
.card
if data.errors.length === 1
p The following error was reported:
else
p The following errors were reported:
ul
each error in data.errors
li
p= error
p Please see the
a(href="https://docs.keyoxide.org/getting-started/something-went-wrong/") documentation
| for help.
else
2023-09-15 06:25:15 -06:00
section.profile
2022-10-11 07:19:14 -06:00
noscript
p Keyoxide requires JavaScript to function.
2021-03-01 07:01:34 -07:00
if (enable_message_encryption)
dialog#dialog--encryptMessage
div
form(method='post')
label(for="encryptionInput") Message to encrypt
textarea#encryptionInput.input(name='message')
input.no-margin(type='submit' name='submit' value='ENCRYPT MESSAGE')
br
br
label(for="encryptionOutput") Encryption result
textarea#encryptionOutput.output(name='message' placeholder='Waiting for input' readonly)
form(method="dialog")
input(type="submit" value="Close")
if (enable_signature_verification)
dialog#dialog--verifySignature
div
form(method='post')
2023-07-13 03:11:33 -06:00
label(for="sigVerInput") Signature name
textarea#sigVerOutput.output(name='message' placeholder='Waiting for input' readonly)
form(method="dialog")
input(type="submit" value="Close")
2022-10-11 07:19:14 -06:00
dialog#dialog--qr
div
canvas#qr
p
a(href="" tabindex="0")#qr--altLink
form(method="dialog")
input(type="submit" value="Close")
2021-05-03 03:48:48 -06:00
2022-10-11 07:19:14 -06:00
if (isSignature)
#profileSigInput.form-wrapper.card
h2 Signature profile
form#formGenerateSignatureProfile(method='post')
label(for="signature") Please enter the raw profile signature below and press "Generate profile".
textarea#signature(name='signature')= signature
input(type='submit', name='submit', value='Generate profile')
2021-05-03 09:09:10 -06:00
unless (isSignature && !signature)
2023-09-15 06:25:15 -06:00
.profile__header
img.profile__avatar.u-logo(src=data.personas[data.primaryPersonaIndex].avatarUrl alt="avatar")
2023-09-15 06:25:15 -06:00
p.profile__name.p-name= data.personas[data.primaryPersonaIndex].name
if (data.personas[data.primaryPersonaIndex].description)
p= data.personas[data.primaryPersonaIndex].description
if (enable_message_encryption || enable_signature_verification)
.button-wrapper
if (enable_message_encryption)
button(onClick="document.querySelector('#dialog--encryptMessage').showModal();") Encrypt message
if (enable_signature_verification)
button(onClick="document.querySelector('#dialog--verifySignature').showModal();") Verify signature
2021-05-03 09:09:10 -06:00
2023-09-15 06:25:15 -06:00
.profile__claims
+generatePersona(data.personas[data.primaryPersonaIndex], true && data.personas.length > 1)
each persona, index in data.personas
unless index == data.primaryPersonaIndex
+generatePersona(persona, false)
2023-03-01 10:22:37 -07:00
2023-09-15 06:25:15 -06:00
section
h2 Profile information
2023-09-17 06:21:21 -06:00
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
2023-09-15 06:25:15 -06:00
.subsection
2023-09-17 06:21:21 -06:00
img(src='/static/img/link.png')
2023-09-15 06:25:15 -06:00
div
2023-09-17 06:21:21 -06:00
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