-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* IBX-3085: Add thumbnail twig component * remove attr * Remove cursor from CSS
- Loading branch information
Showing
6 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
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,7 @@ | ||
.ibexa-user-thumbnail { | ||
&--img { | ||
width: calculateRem(24px); | ||
height: calculateRem(24px); | ||
border-radius: 50%; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -114,3 +114,4 @@ | |
@import 'back-to-top'; | ||
@import 'date-time-picker'; | ||
@import 'middle-ellipsis'; | ||
@import 'user-thumbnail'; |
2 changes: 0 additions & 2 deletions
2
...dle/Resources/views/themes/admin/ui/component/adaptive_filters/adaptive_filters.html.twig
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
24 changes: 24 additions & 0 deletions
24
src/bundle/Resources/views/themes/admin/ui/component/user_thumbnail/user_thumbnail.html.twig
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,24 @@ | ||
{% import "@ibexadesign/ui/component/macros.html.twig" as html %} | ||
|
||
{% set user_image = user_content.thumbnail %} | ||
|
||
{% if user_image.mimeType == 'image/svg+xml' %} | ||
{% set attr_svg = attr_svg|default({})|merge({ | ||
class: ('ibexa-user-thumbnail--svg ' ~ attr_svg.class|default(''))|trim, | ||
width: attr_svg.width is defined ? attr_svg.width : '24', | ||
height: attr_svg.height is defined ? attr_svg.height : '24', | ||
xmlns: attr_svg.xmlns is defined ? attr_svg.xmlns : 'http://www.w3.org/2000/svg', | ||
}) %} | ||
|
||
<svg {{ html.attributes(attr_svg|default({})) }}> | ||
<use xlink:href="{{ user_image.resource }}"></use> | ||
</svg> | ||
{% else %} | ||
{% set attr_img = attr_img|default({})|merge({ | ||
class: ('ibexa-user-thumbnail--img ' ~ attr_img.class|default(''))|trim, | ||
src: attr_img.src is defined ? attr_img.src : user_image.resource, | ||
alt: attr_img.alt is defined ? attr_img.alt : user.name, | ||
}) %} | ||
|
||
<img {{ html.attributes(attr_img|default({})) }}/> | ||
{% endif %} |
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