From d2aa3f0c0ff016e199e052f2317846c3575e999d Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Wed, 31 Mar 2021 15:11:12 +0200 Subject: [PATCH] Fix QR code --- static/scripts.js | 9 ++++++++- static/styles.css | 5 +++++ views/util/qr.pug | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/static/scripts.js b/static/scripts.js index 7dbe2ce..ad99df0 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -262,6 +262,7 @@ async function displayProfile(opts) { // Generate output for each claim claims.forEach((claim, i) => { + console.log(claim); const claimData = claim.serviceproviderData; if (!claimData.serviceprovider.name) { return; @@ -278,6 +279,13 @@ async function displayProfile(opts) { ${capitalizeLetteredServices(claimData.serviceprovider.name)} View account View proof + `; + if (claimData.profile.qr) { + output += ` + View QR + `; + } + output += `

@@ -350,7 +358,6 @@ async function displayProfile(opts) { /// MAIN // Init variables let keyData, keyLink, sigVerification, sigKeyUri, fingerprint, feedback = "", verifications = []; - let icon_qr = ''; const doipOpts = { proxyPolicy: 'adaptive', diff --git a/static/styles.css b/static/styles.css index 0f8b6de..924dfc2 100644 --- a/static/styles.css +++ b/static/styles.css @@ -531,3 +531,8 @@ dialog p { dialog p:first-of-type { margin-top: 0; } + +#qrcode { + display: block; + margin: 0 auto 16px; +} diff --git a/views/util/qr.pug b/views/util/qr.pug index 2a813da..684ba03 100644 --- a/views/util/qr.pug +++ b/views/util/qr.pug @@ -8,6 +8,7 @@ block content section.narrow h1 QR Code form#form-util-qr(method='post') - code#input.full-width !{input} + pre + code#input.full-width !{input} canvas#qrcode a#qrcode--altLink(href='#') Press this link to directly open the URI