90 lines
3.5 KiB
Plaintext
90 lines
3.5 KiB
Plaintext
<% function avatar() {
|
|
const avatar = get_config_from_obj(widget, 'avatar');
|
|
const gravatar = get_config_from_obj(widget, 'gravatar');
|
|
if (gravatar !== null) {
|
|
return gravatar(gravatar, 128);
|
|
}
|
|
if (avatar !== null) {
|
|
return url_for(avatar)
|
|
}
|
|
return url_for('images/avatar.png');
|
|
} %>
|
|
<div class="card widget">
|
|
<div class="card-content">
|
|
<nav class="level">
|
|
<div class="level-item has-text-centered">
|
|
<div>
|
|
<img class="image is-128x128 has-mb-6" src="<%= avatar() %>">
|
|
<% if (get_config_from_obj(widget, 'author')) { %>
|
|
<p class="is-size-4 is-block">
|
|
<%= get_config_from_obj(widget, 'author') %>
|
|
</p>
|
|
<% } %>
|
|
<% if (get_config_from_obj(widget, 'author_title')) { %>
|
|
<p class="is-size-6 is-block">
|
|
<%= get_config_from_obj(widget, 'author_title') %>
|
|
</p>
|
|
<% } %>
|
|
<% if (get_config_from_obj(widget, 'location')) { %>
|
|
<p class="is-size-6 is-flex is-flex-center has-text-grey">
|
|
<i class="material-icons is-size-5 has-mr-7">location_on</i>
|
|
<span><%= get_config_from_obj(widget, 'location') %></span>
|
|
</p>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<nav class="level is-mobile">
|
|
<div class="level-item has-text-centered">
|
|
<div>
|
|
<p class="heading">
|
|
<%= _p('common.post', post_count()) %>
|
|
</p>
|
|
<p class="title has-text-weight-normal">
|
|
<%= post_count() %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="level-item has-text-centered">
|
|
<div>
|
|
<p class="heading">
|
|
<%= _p('common.category', category_count()) %>
|
|
</p>
|
|
<p class="title has-text-weight-normal">
|
|
<%= category_count() %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="level-item has-text-centered">
|
|
<div>
|
|
<p class="heading">
|
|
<%= _p('common.tag', tag_count()) %>
|
|
</p>
|
|
<p class="title has-text-weight-normal">
|
|
<%= tag_count() %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<div class="level">
|
|
<a class="level-item button is-link is-rounded" href="<%= url_for(widget.follow_link) %>">
|
|
<%= __('widget.follow') %></a>
|
|
</div>
|
|
<% const socialLinks = get_config_from_obj(widget, 'social_links'); %>
|
|
<% if (socialLinks !== null) { %>
|
|
<div class="level is-mobile">
|
|
<% for (let name in socialLinks) {
|
|
let link = socialLinks[name]; %>
|
|
<a class="level-item button is-white" target="_blank"
|
|
title="<%= name %>" href="<%= url_for(typeof(link) === 'string' ? link : link.url) %>">
|
|
<% if (typeof(link) === 'string') { %>
|
|
<%= name %>
|
|
<% } else { %>
|
|
<i class="<%= link.icon %>"></i>
|
|
<% } %>
|
|
</a>
|
|
<% } %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</div> |