pyfedi/app/templates/user/show_profile.html

195 lines
9.6 KiB
HTML
Raw Normal View History

2023-10-07 21:32:19 +13:00
{% extends "base.html" %}
{% from 'bootstrap/form.html' import render_form %}
{% block app_content %}
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
2023-10-07 21:32:19 +13:00
{% 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="/users">{{ _('People') }}</a></li>
2024-01-01 14:49:15 +13:00
<li class="breadcrumb-item active">{{ user.display_name()|shorten }}</li>
2023-10-07 21:32:19 +13:00
</ol>
</nav>
</div>
<img class="community_icon_big bump_up rounded-circle" src="{{ user.avatar_image() }}" />
2024-01-01 14:49:15 +13:00
<h1 class="mt-2">{{ user.display_name() if user.is_local() else user.ap_id }}</h1>
2023-10-07 21:32:19 +13:00
{% elif user.avatar_image() != '' %}
<div class="row">
<div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" />
</div>
<div class="col-10">
2024-01-01 14:49:15 +13:00
<h1 class="mt-3">{{ user.display_name() if user.is_local() else user.ap_id }}</h1>
2023-10-07 21:32:19 +13:00
</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="/users">{{ _('People') }}</a></li>
<li class="breadcrumb-item active">{{ user.user_name|shorten }}</li>
</ol>
</nav>
2024-01-01 14:49:15 +13:00
<h1 class="mt-2">{{ user.display_name() if user.is_local() else user.ap_id }}</h1>
2023-10-07 21:32:19 +13:00
{% endif %}
2024-01-01 16:26:57 +13:00
{% if current_user.is_authenticated %}
<div class="profile_action_buttons">
{% if user.matrix_user_id %}
<a class="btn btn-primary" href="https://matrix.to/#/{{ user.matrix_user_id }}" rel="nofollow">{{ _('Send message') }}</a>
{% endif %}
{% if current_user.id != user.id %}
{% 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 user') }}</a>
{% else %}
<a class="btn btn-primary confirm_first" href="{{ url_for('user.block_profile', actor=user.link()) }}" rel="nofollow">{{ _('Block user') }}</a>
{% endif %}
<a class="btn btn-primary" href="{{ url_for('user.report_profile', actor=user.link()) }}" rel="nofollow">{{ _('Report user') }}</a>
{% endif %}
</div>
{% endif %}
2023-12-27 19:51:07 +13:00
<p class="small">{{ _('Joined') }}: {{ moment(user.created).fromNow(refresh=True) }}<br />
{{ _('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 }}
2023-12-15 17:35:11 +13:00
{% if posts %}
2023-10-07 21:32:19 +13:00
<h2 class="mt-4">Posts</h2>
<div class="post_list">
{% for post in posts %}
{% include 'post/_post_teaser.html' %}
2023-10-07 21:32:19 +13:00
{% endfor %}
</div>
2023-12-15 17:35:11 +13:00
<nav aria-label="Pagination" class="mt-4">
{% if post_prev_url %}
<a href="{{ post_prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
</a>
{% endif %}
{% if post_next_url %}
<a href="{{ post_next_url }}" class="btn btn-primary">
{{ _('Next page') }} <span aria-hidden="true">&rarr;</span>
</a>
{% endif %}
</nav>
2023-10-07 21:32:19 +13:00
{% endif %}
2023-12-15 17:35:11 +13:00
{% if post_replies %}
<h2 class="mt-4" id="comments">Comments</h2>
2023-10-07 21:32:19 +13:00
<div class="post_list">
{% for post_reply in post_replies %}
{% include 'post/_post_reply_teaser.html' %}
2023-10-07 21:32:19 +13:00
{% endfor %}
</div>
2023-12-15 17:35:11 +13:00
<nav aria-label="Pagination" class="mt-4">
{% if replies_prev_url %}
<a href="{{ replies_prev_url }}#comments" class="btn btn-primary">
<span aria-hidden="true">&larr;</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">&rarr;</span>
</a>
{% endif %}
</nav>
2023-10-07 21:32:19 +13:00
{% endif %}
</div>
<div class="col-12 col-md-4">
2023-10-21 15:49:01 +13:00
{% if current_user.is_authenticated and current_user.id == user.id %}
2023-10-07 21:32:19 +13:00
<div class="card mt-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 }}/profile">{{ _('Profile') }}</a>
</div>
<div class="col-6">
<a class="w-100 btn btn-primary" href="/u/{{ user.user_name }}/settings">{{ _('Settings') }}</a>
</div>
</div>
</div>
</div>
{% endif %}
2023-11-12 20:54:22 +13:00
{% if len(subscribed) > 0 or len(moderates) > 0 %}
2023-10-07 21:32:19 +13:00
<div class="card mt-3">
<div class="card-header">
2023-11-12 20:54:22 +13:00
<h2>{{ _('Communities') }}</h2>
2023-10-07 21:32:19 +13:00
</div>
<div class="card-body">
2023-11-12 20:54:22 +13:00
{% if len(subscribed) > 0 %}
<h4>Subscribed to</h4>
<ul>
{% for community in subscribed %}
<li>
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if len(moderates) > 0 %}
<h4>Moderates</h4>
<ul>
{% for community in moderates %}
<li>
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
2023-10-07 21:32:19 +13:00
</div>
</div>
{% endif %}
2023-10-21 15:49:01 +13:00
{% 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 mt-3">
<div class="card-header">
<h2>{{ _('Crush') }}</h2>
</div>
<div class="card-body">
<div class="row">
{% if user_access('ban users', current_user.id) %}
2023-10-22 18:26:57 +13:00
{% if user.banned %}
<div class="col-4">
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.user_name }}/unban">{{ _('Unban') }}</a>
</div>
{% else %}
<div class="col-4">
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.user_name }}/ban">{{ _('Ban') }}</a>
</div>
{% endif %}
2023-10-21 15:49:01 +13:00
{% endif %}
{% if user_access('manage users', current_user.id) %}
2023-10-22 18:26:57 +13:00
<div class="col-4">
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.user_name }}/delete">{{ _('Delete') }}</a>
</div>
<div class="col-4">
<a class="w-100 btn btn-primary confirm_first" href="/u/{{ user.user_name }}/ban_purge">{{ _('Ban + Purge') }}</a>
</div>
2023-10-21 15:49:01 +13:00
{% endif %}
</div>
</div>
</div>
{% endif %}
2023-11-12 20:54:22 +13:00
{% if upvoted %}
<div class="card mt-3">
<div class="card-header">
<h2>{{ _('Upvoted') }}</h2>
</div>
<div class="card-body">
<ul>
{% for post in upvoted %}
2023-12-10 15:10:09 +13:00
<li><a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}">{{ post.title }}</a></li>
2023-11-12 20:54:22 +13:00
{% endfor %}
</ul>
</div>
</div>
{% endif %}
2023-10-07 21:32:19 +13:00
</div>
</div>
{% endblock %}