Rounded avatar in profile widget (#401)

* Rounded avatar in profile widget

* Make rounded avatar configurable
This commit is contained in:
Leonid Zolotarev 2019-01-29 11:46:15 -05:00 committed by Ruipeng Zhang
parent c2a542c8bb
commit 5ca3c9ce52
2 changed files with 12 additions and 1 deletions

View File

@ -88,6 +88,11 @@ const ProfileSpec = {
[doc]: 'Path or URL to the avatar to be shown in the profile widget',
[defaultValue]: '/images/avatar.png'
},
avatar_rounded: {
[type]: 'boolean',
[doc]: 'Whether to show avatar image rounded or square',
[defaultValue]: true
},
gravatar: {
[type]: 'string',
[doc]: 'Email address for the Gravatar to be shown in the profile widget',

View File

@ -14,7 +14,13 @@
<nav class="level">
<div class="level-item has-text-centered">
<div>
<img class="image is-128x128 has-mb-6" src="<%= avatar() %>" alt="<%= get_config_from_obj(widget, 'author') %>">
<% if (get_config_from_obj(widget, 'avatar_rounded')) { %>
<figure class="image container is-128x128 has-mb-6">
<img class="is-rounded" src="<%= avatar() %>" alt="<%= get_config_from_obj(widget, 'author') %>">
</figure>
<% } else { %>
<img class="image is-128x128 has-mb-6" src="<%= avatar() %>" alt="<%= get_config_from_obj(widget, 'author') %>">
<% } %>
<% if (get_config_from_obj(widget, 'author')) { %>
<p class="is-size-4 is-block">
<%= get_config_from_obj(widget, 'author') %>