mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
243 lines
12 KiB
HTML
243 lines
12 KiB
HTML
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
|
|
{% extends 'themes/' + theme() + '/base.html' %}
|
|
{% else %}
|
|
{% extends "base.html" %}
|
|
{% endif %} %}
|
|
{% from 'bootstrap/form.html' import render_form %}
|
|
|
|
{% if current_user.is_authenticated and user.id == current_user.id %}
|
|
{% set active_child = 'view_profile' %}
|
|
{% endif %}
|
|
{% block app_content %}
|
|
<div class="row">
|
|
<div class="col-12 col-md-8 position-relative main_pane">
|
|
{% if user.cover_image() != '' %}
|
|
<div class="community_header" style="height: 240px; background-image: url({{ user.cover_image() }});">
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
|
<li class="breadcrumb-item active">{{ user.display_name()|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<img class="community_icon_big bump_up rounded-circle" src="{{ user.avatar_image() }}" alt="{{ _('Profile pic') }}" />
|
|
<h1 class="mt-2">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}
|
|
{% if current_user.is_authenticated %}
|
|
{% include 'user/_notification_toggle.html' %}
|
|
{% endif %}
|
|
</h1>
|
|
{% elif user.avatar_image() != '' %}
|
|
<div class="row">
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
|
<li class="breadcrumb-item active">{{ user.display_name()|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
<div class="col-2">
|
|
{% if low_bandwidth %}
|
|
<img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" alt="{{ _('Profile pic') }}" />
|
|
{% else %}
|
|
{% if user.avatar.source_url and user.avatar.source_url.endswith('.mp4') %}
|
|
<video autoplay disablepictureinpicture loop muted class="community_icon_big rounded-circle">
|
|
<source src="{{ user.avatar.source_url }}" type="video/mp4">
|
|
</video>
|
|
{% else %}
|
|
<img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" alt="{{ _('Profile pic') }}" />
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-10">
|
|
<h1 class="mt-3">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}
|
|
{% if current_user.is_authenticated %}
|
|
{% include 'user/_notification_toggle.html' %}
|
|
{% endif %}
|
|
</h1>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
|
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
|
<li class="breadcrumb-item active">{{ user.link()|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
<h1 class="mt-2">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}
|
|
{% if current_user.is_authenticated %}
|
|
{% include 'user/_notification_toggle.html' %}
|
|
{% endif %}
|
|
</h1>
|
|
{% endif %}
|
|
<div class="profile_action_buttons">
|
|
{% if current_user.is_authenticated and current_user != user %}
|
|
<a class="btn btn-primary" href="{{ url_for('chat.new_message', to=user.id) }}" rel="nofollow" aria-label="{{ _('Send message') }}">{{ _('Send message') }}</a>
|
|
{% if user.matrix_user_id %}
|
|
<a class="btn btn-primary" href="https://matrix.to/#/{{ user.matrix_user_id }}" rel="nofollow" aria-label="{{ _('Send message with matrix chat') }}">{{ _('Send message using Matrix') }}</a>
|
|
{% endif %}
|
|
{% if current_user.has_blocked_user(user.id) %}
|
|
<a class="btn btn-primary" href="{{ url_for('user.unblock_profile', actor=user.link()) }}" rel="nofollow">{{ _('Unblock') }}</a>
|
|
{% else %}
|
|
<a class="btn btn-primary confirm_first" href="{{ url_for('user.block_profile', actor=user.link()) }}" rel="nofollow">{{ _('Block') }}</a>
|
|
{% endif %}
|
|
<a class="btn btn-primary" href="{{ url_for('user.report_profile', actor=user.link()) }}" rel="nofollow">{{ _('Report') }}</a>
|
|
{% endif %}
|
|
{% if user.is_local() %}
|
|
<a class="btn btn-primary" href="{{ url_for('user.fediverse_redirect', actor=user.link()) }}" rel="nofollow"><img src="/static/images/fediverse_logo.svg" width="25" height="25"> {{ _('Follow') }}</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
<p class="small">{{ _('Joined') }}: {{ moment(user.created).fromNow(refresh=True) }}<br />
|
|
{% if user.bot %}
|
|
{{ _('Bot Account') }}<br />
|
|
{% endif %}
|
|
{{ _('Attitude') }}: <span title="{{ _('Ratio of upvotes cast to downvotes cast. Higher is more positive.') }}">{{ (user.attitude * 100) | round | int }}%</span></p>
|
|
{{ user.about_html|safe }}
|
|
{% if posts %}
|
|
<h2 class="mt-4">Posts</h2>
|
|
<div class="post_list">
|
|
{% for post in posts.items %}
|
|
{% include 'post/_post_teaser.html' %}
|
|
{% endfor %}
|
|
</div>
|
|
<nav aria-label="{{ _('Post pagination') }}" class="mt-4" role="navigation">
|
|
{% if post_prev_url %}
|
|
<a href="{{ post_prev_url }}" class="btn btn-primary">
|
|
<span aria-hidden="true">←</span> {{ _('Previous page') }}
|
|
</a>
|
|
{% endif %}
|
|
{% if post_next_url %}
|
|
<a href="{{ post_next_url }}" class="btn btn-primary">
|
|
{{ _('Next page') }} <span aria-hidden="true">→</span>
|
|
</a>
|
|
{% endif %}
|
|
</nav>
|
|
{% else %}
|
|
<p>{{ _('No posts yet.') }}</p>
|
|
{% endif %}
|
|
|
|
{% if post_replies %}
|
|
<h2 class="mt-4" id="comments">Comments</h2>
|
|
<div class="post_list">
|
|
{% for post_reply in post_replies.items %}
|
|
{% with teaser=True, disable_voting=not current_user.is_authenticated or (current_user.id != post_reply.author.id) %}
|
|
{% include 'post/_post_reply_teaser.html' %}
|
|
{% endwith %}
|
|
<hr />
|
|
{% endfor %}
|
|
</div>
|
|
<nav aria-label="{{ _('Comment pagination') }}" class="mt-4" role="navigation">
|
|
{% if replies_prev_url %}
|
|
<a href="{{ replies_prev_url }}#comments" class="btn btn-primary">
|
|
<span aria-hidden="true">←</span> {{ _('Previous page') }}
|
|
</a>
|
|
{% endif %}
|
|
{% if replies_next_url %}
|
|
<a href="{{ replies_next_url }}#comments" class="btn btn-primary">
|
|
{{ _('Next page') }} <span aria-hidden="true">→</span>
|
|
</a>
|
|
{% endif %}
|
|
</nav>
|
|
{% else %}
|
|
<p>{{ _('No comments yet.') }}</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<aside id="side_pane" class="col-12 col-md-4 side_pane" role="complementary">
|
|
{% if current_user.is_authenticated and current_user.id == user.id %}
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h2>{{ _('Manage') }}</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<a class="w-100 btn btn-primary" href="/u/{{ user.user_name.lower() }}/profile">{{ _('Profile') }}</a>
|
|
</div>
|
|
<div class="col-6">
|
|
<a class="w-100 btn btn-primary" href="/user/settings">{{ _('Settings') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if len(subscribed) > 0 or len(moderates) > 0 %}
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h2>{{ _('Communities') }}</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if len(subscribed) > 0 %}
|
|
<h4>{{ _('Member of') }}</h4>
|
|
<ul class="list-group list-group-flush">
|
|
{% for community in subscribed %}
|
|
<li class="list-group-item">
|
|
{{ render_communityname(community) }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
{% if len(moderates) > 0 %}
|
|
<h4>Moderates</h4>
|
|
<ul class="list-group list-group-flush">
|
|
{% for community in moderates %}
|
|
<li class="list-group-item">
|
|
{{ render_communityname(community) }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if current_user.is_authenticated and (user_access('ban users', current_user.id) or user_access('manage users', current_user.id)) and user.id != current_user.id %}
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h2>{{ _('Moderate user') }}</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
{% if user_access('ban users', current_user.id) %}
|
|
{% if user.banned %}
|
|
<div class="col-4">
|
|
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.link() }}/unban">{{ _('Unban') }}</a>
|
|
</div>
|
|
{% else %}
|
|
<div class="col-4">
|
|
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.link() }}/ban">{{ _('Ban') }}</a>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if user_access('manage users', current_user.id) %}
|
|
<div class="col-4">
|
|
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.link() }}/delete">{{ _('Delete') }}</a>
|
|
</div>
|
|
<div class="col-4">
|
|
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.link() }}/ban_purge">{{ _('Ban + Purge') }}</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if upvoted %}
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h2>{{ _('Upvoted') }}</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
<ul>
|
|
{% for post in upvoted %}
|
|
<li><a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}">{{ post.title }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</aside>
|
|
</div>
|
|
{% endblock %}
|