Avatars: replace image with initials when printing
This commit is contained in:
parent
47120f0585
commit
a3e531af21
3 changed files with 31 additions and 1 deletions
|
@ -105,6 +105,7 @@ class App.User extends App.Model
|
|||
placement: placement
|
||||
vip: vip
|
||||
url: @imageUrl()
|
||||
initials: @initials()
|
||||
|
||||
isOutOfOffice: ->
|
||||
return false if @out_of_office isnt true
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<span class="avatar <%- @cssClass %>" style="background-image: url(<%- @url %>)"<%- @placement %><%- @data %>>
|
||||
<span class="avatar <%- @cssClass %>" style="background-image: url(<%- @url %>)"<%- @placement %><%- @data %> data-initials="<%- @initials %>">
|
||||
<%- @Icon('crown') if @vip %>
|
||||
</span>
|
|
@ -201,6 +201,35 @@ th.js-tableHead:not([data-column-key="icon"]) {
|
|||
|
||||
.avatar {
|
||||
border: 1px solid black;
|
||||
|
||||
&:not(.avatar--unique) {
|
||||
&:before {
|
||||
content: attr(data-initials);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
&.size-30:before {
|
||||
font-size: 10px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
&.size-50:before {
|
||||
font-size: 16px;
|
||||
line-height: 52px;
|
||||
}
|
||||
|
||||
&.size-80:before {
|
||||
font-size: 26px;
|
||||
line-height: 84px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue