keyoxide-web/views/profile.pug

138 lines
5.2 KiB
Text
Raw Permalink Normal View History

2021-03-01 07:01:34 -07:00
extends templates/base.pug
mixin generateUser(user, isPrimary)
h2
2022-04-08 10:22:54 -06:00
span.p-email #{user.userData.email}
if isPrimary
small.primary primary
each claim in user.claims
2021-06-03 07:23:08 -06:00
if claim.matches.length > 0
kx-claim.kx-item(data-claim=claim)
2021-06-09 05:58:36 -06:00
details(aria-label="Claim")
2021-06-03 07:23:08 -06:00
summary
.info
p.subtitle= claim.matches[0].serviceprovider.name
p.title= claim.matches[0].profile.display
.icons
.verificationStatus(data-value='running')
.inProgress
.content
.subsection
img(src='/static/img/link.png')
div
if (claim.matches[0].profile.uri)
p Profile link:
2021-06-09 05:58:36 -06:00
a(rel='me' href=claim.matches[0].profile.uri aria-label="Link to profile")= claim.matches[0].profile.uri
2021-06-03 07:23:08 -06:00
else
p Profile link: not accessible from browser
if (claim.matches[0].proof.uri)
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
2021-05-03 02:46:22 -06:00
script.
kx = {
key: {
2021-05-03 09:09:10 -06:00
url: "!{data && data.key && data.key.fetchURL ? data.key.fetchURL : null}",
2021-05-03 02:46:22 -06:00
object: null
}
}
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
section.profile.narrow.h-card
noscript
p Keyoxide requires JavaScript to function.
2021-03-01 07:01:34 -07:00
2022-10-11 07:19:14 -06:00
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")
2022-10-11 07:19:14 -06:00
dialog#dialog--verifySignature
div
form(method='post')
label(for="sigVerInput") Signature
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)
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)
2021-05-04 02:01:04 -06:00
#profileHeader.card.card--transparent.card--profileHeader
2022-04-08 10:22:54 -06:00
img#profileAvatar.u-logo(src=data.extra.avatarURL alt="avatar")
2022-04-08 10:22:54 -06:00
p#profileName.p-name= data.keyData.users[data.keyData.primaryUserIndex].userData.name
2021-05-04 02:01:04 -06:00
.button-wrapper
2021-05-03 09:09:10 -06:00
button(onClick="document.querySelector('#dialog--encryptMessage').showModal();") Encrypt message
button(onClick="document.querySelector('#dialog--verifySignature').showModal();") Verify signature
2021-05-04 02:01:04 -06:00
#profileProofs.card.card--transparent
2021-05-03 09:09:10 -06:00
h2 Key
2021-05-04 05:57:33 -06:00
kx-key.kx-item(data-keydata=data.keyData)
2021-06-09 05:58:36 -06:00
details(aria-label="Key")
2021-05-04 05:57:33 -06:00
summary
.info
p.subtitle= data.keyData.key.fetchMethod
p.title= data.keyData.fingerprint
.content
.subsection
img(src='/static/img/link.png')
div
p Key link:
2022-04-08 10:22:54 -06:00
a.u-key(href=data.keyData.key.uri rel="pgpkey" aria-label="Link to cryptographic key")= data.keyData.key.uri
2021-05-04 05:57:33 -06:00
hr
.subsection
img(src='/static/img/qrcode.png')
div
2021-06-09 05:58:36 -06:00
button(onClick=`showQR('${data.keyData.fingerprint}', 'fingerprint')` aria-label='Show QR code for cryptographic fingerprint') Show OpenPGP fingerprint QR
2021-05-03 09:09:10 -06:00
+generateUser(data.keyData.users[data.keyData.primaryUserIndex], true)
each user, index in data.keyData.users
unless index == data.keyData.primaryUserIndex
+generateUser(user, false)