misuzu/templates/profile/master.twig

55 lines
2.2 KiB
Twig
Raw Permalink Normal View History

{% extends 'master.twig' %}
2019-12-03 02:06:36 +01:00
{% if profile_user is defined %}
2020-05-18 21:27:34 +00:00
{% set image = url('user-avatar', {'user': profile_user.id, 'res': 200}) %}
{% set manage_link = url('manage-user', {'user': profile_user.id}) %}
{% if (not profile_is_banned or profile_can_edit) and profile_background_info is not null %}
{% set main_body_classes = main_body_classes|default([])|merge({
'main--bg-cover': profile_background_info.cover,
'main--bg-stretch': profile_background_info.stretch,
'main--bg-tile': profile_background_info.tile,
'main--bg-contain': profile_background_info.contain,
'main--bg-blend': profile_background_info.blend,
'main--bg-slide': profile_background_info.slide,
}) %}
{% set main_css_vars = main_css_vars|default([])|merge({
'--background-width': '%dpx'|format(profile_background_asset.width),
'--background-height': '%dpx'|format(profile_background_asset.height),
'--background-image': "url('%s')"|format(url('user-background', {'user': profile_user.id})),
}) %}
2020-06-07 20:37:03 +00:00
{% endif %}
2019-06-06 22:18:31 +02:00
{% set stats = [
{
'title': 'Joined',
'is_date': true,
2020-06-07 20:37:03 +00:00
'value': profile_user.createdTime,
2019-06-06 22:18:31 +02:00
},
{
'title': 'Last seen',
'is_date': true,
'value': profile_user.lastActiveTime|default(0),
2019-06-06 22:18:31 +02:00
},
{
'title': 'Topics',
2019-12-03 02:06:36 +01:00
'value': profile_stats.forum_topic_count,
2020-05-18 21:27:34 +00:00
'url': url('user-profile-forum-topics', {'user': profile_user.id}),
2019-06-06 22:18:31 +02:00
'active': profile_mode == 'forum-topics',
},
{
'title': 'Posts',
2019-12-03 02:06:36 +01:00
'value': profile_stats.forum_post_count,
2020-05-18 21:27:34 +00:00
'url': url('user-profile-forum-posts', {'user': profile_user.id}),
2019-06-06 22:18:31 +02:00
'active': profile_mode == 'forum-posts',
},
{
'title': 'Comments',
2019-12-03 02:06:36 +01:00
'value': profile_stats.comments_count,
2019-06-06 22:18:31 +02:00
},
] %}
{% else %}
{% set image = url('user-avatar', {'user': 0, 'res': 240}) %}
2019-06-10 00:10:59 +02:00
{% set manage_link = url('manage-users') %}
2019-06-06 22:18:31 +02:00
{% set profile_is_editing = false %}
{% set profile_notices = [] %}
{% endif %}