-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into observation/FOUR-13914-b
- Loading branch information
Showing
6 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<span> | ||
<b-button | ||
:variant="variant()" | ||
class="avatar-button rounded-circle overflow-hidden p-0 m-0 d-inline-flex border-0" | ||
:style="styleAvatar()" | ||
disabled | ||
> | ||
<img | ||
v-if="user.avatar" | ||
:src="user.avatar" | ||
:width="width" | ||
:height="height" | ||
:class="image" | ||
:alt="user.fullname" | ||
/> | ||
<span | ||
v-else | ||
class="border-0 d-inline-flex align-items-center justify-content-center text-white text-uppercase text-nowrap font-weight-normal" | ||
:style="styleAvatar()" | ||
> | ||
<span v-if="getInitials()">{{ getInitials() }}</span> | ||
<span v-else>PM</span> | ||
</span> | ||
</b-button> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
width: { | ||
default: 64, | ||
}, | ||
height: { | ||
default: 64, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
user: window.Processmaker.user, | ||
}; | ||
}, | ||
mounted() { | ||
this.getInitials(); | ||
}, | ||
methods: { | ||
getInitials() { | ||
return this.user.firstname && this.user.lastname | ||
? this.user.firstname.match(/./u)[0] + this.user.lastname.match(/./u)[0] | ||
: ""; | ||
}, | ||
variant() { | ||
return this.user.avatar ? 'secondary' : 'info'; | ||
}, | ||
styleAvatar() { | ||
return "width: " + | ||
this.width + | ||
"px; height: " + | ||
this.height + | ||
"px; font-size:" + | ||
this.height / 2.5 + | ||
"px; padding:0;"; | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.avatar-button:disabled { | ||
opacity: 1; | ||
pointer-events: none; | ||
} | ||
.empty-image { | ||
font-size: 2em; | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters