From 84a56c74404f6fe3472e35e728994d5d882ccdcd Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 3 Jun 2021 15:23:08 +0200 Subject: [PATCH] Hide claims without matches --- views/profile.pug | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/views/profile.pug b/views/profile.pug index 1dcedae..103a549 100644 --- a/views/profile.pug +++ b/views/profile.pug @@ -6,29 +6,30 @@ mixin generateUser(user, isPrimary) if isPrimary small.primary primary each claim in user.claims - kx-claim.kx-item(data-claim=claim) - details - 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: - a(rel='me' href=claim.matches[0].profile.uri)= claim.matches[0].profile.uri - else - p Profile link: not accessible from browser - if (claim.matches[0].proof.uri) - p Proof link: - a(rel='me' href=claim.matches[0].proof.uri)= claim.matches[0].proof.uri - else - p Proof link: not accessible from browser + if claim.matches.length > 0 + kx-claim.kx-item(data-claim=claim) + details + 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: + a(rel='me' href=claim.matches[0].profile.uri)= claim.matches[0].profile.uri + else + p Profile link: not accessible from browser + if (claim.matches[0].proof.uri) + p Proof link: + a(rel='me' href=claim.matches[0].proof.uri)= claim.matches[0].proof.uri + else + p Proof link: not accessible from browser block js script(type='application/javascript' src='/static/qrcode.min.js' charset='utf-8')