[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 413/459: show profile picture in edit
From: |
gnunet |
Subject: |
[reclaim-ui] 413/459: show profile picture in edit |
Date: |
Fri, 11 Jun 2021 23:28:25 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.
commit a9fd491b79db0061af26dc776455f46f2fd410d0
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Jan 5 23:13:11 2021 +0900
show profile picture in edit
---
src/app/edit-identity/edit-identity.component.html | 10 ++++++-
src/app/edit-identity/edit-identity.component.ts | 32 ++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/src/app/edit-identity/edit-identity.component.html
b/src/app/edit-identity/edit-identity.component.html
index 6a767d8..a001e3c 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -2,7 +2,15 @@
<div class="m-2 card">
<div class="card-avatar card-img-top">
<div class="card-avatar-character text-dark">
- <h2 class="fa-2x"><i class="fa fa-user-circle pr-2"></i> {{
identity.name }}</h2>
+ <h2 class="fa-2x">
+ <img style="border-radius: 50%; width: 1em"
+ [src]="getIdentityProfilePicture(identity)"
+ *ngIf="identityHasProfilePicture()"
+ class="pr-2">
+ <i class="fa fa-user-circle"
+ *ngIf="!identityHasProfilePicture(identity)"></i>
+ {{ identity.name }}
+ </h2>
</div>
</div>
diff --git a/src/app/edit-identity/edit-identity.component.ts
b/src/app/edit-identity/edit-identity.component.ts
index 1869503..9bd44e4 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -910,4 +910,36 @@ export class EditIdentityComponent implements OnInit {
}
isClientVerified() { return this.oidcService.isClientVerified(); }
+
+ identityHasProfilePicture(): boolean {
+ if (undefined === this.attributes) { return false };
+ for (let attr of this.attributes) {
+ if (attr.name === 'picture') {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ getIdentityProfilePicture() {
+ if (undefined === this.attributes) { return '' };
+ for (let attr of this.attributes) {
+ if (attr.name === 'picture') {
+ for (let cred of this.credentials) {
+ if (cred.id == attr.credential) {
+ for (let cattr of cred.attributes) {
+ if (cattr.name != attr.value) {
+ continue;
+ }
+ return cattr.value.replace(/"/g, '');
+ }
+ }
+ }
+ return attr.value;
+ }
+ }
+ return '';
+ }
+
+
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 426/459: bump dependencies to address security issues, (continued)
- [reclaim-ui] 426/459: bump dependencies to address security issues, gnunet, 2021/06/11
- [reclaim-ui] 455/459: fix module include, gnunet, 2021/06/11
- [reclaim-ui] 457/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 440/459: Added translation using Weblate (French), gnunet, 2021/06/11
- [reclaim-ui] 456/459: pabc fixes, gnunet, 2021/06/11
- [reclaim-ui] 419/459: remove tables, remove spinner, fix authorizations page, gnunet, 2021/06/11
- [reclaim-ui] 450/459: Translated using Weblate (French), gnunet, 2021/06/11
- [reclaim-ui] 444/459: Translated using Weblate (Spanish), gnunet, 2021/06/11
- [reclaim-ui] 436/459: Translated using Weblate (Portuguese (Brazil)), gnunet, 2021/06/11
- [reclaim-ui] 409/459: fix scope name, gnunet, 2021/06/11
- [reclaim-ui] 413/459: show profile picture in edit,
gnunet <=
- [reclaim-ui] 412/459: quality of life improvements, gnunet, 2021/06/11
- [reclaim-ui] 399/459: update, gnunet, 2021/06/11
- [reclaim-ui] 424/459: support student bfh addresses, gnunet, 2021/06/11
- [reclaim-ui] 428/459: Merge branch '21-confidential-issue' into 'master', gnunet, 2021/06/11
- [reclaim-ui] 423/459: add spinner, gnunet, 2021/06/11
- [reclaim-ui] 432/459: Translated using Weblate (German), gnunet, 2021/06/11
- [reclaim-ui] 437/459: Added translation using Weblate (Italian), gnunet, 2021/06/11
- [reclaim-ui] 433/459: Translated using Weblate (Portuguese), gnunet, 2021/06/11
- [reclaim-ui] 445/459: Translated using Weblate (Italian), gnunet, 2021/06/11
- [reclaim-ui] 452/459: Translated using Weblate (French), gnunet, 2021/06/11