moviewyrm/bookwyrm/templates/user/layout.html

99 lines
3 KiB
HTML
Raw Normal View History

2021-01-29 17:05:53 +00:00
{% extends 'layout.html' %}
2021-05-26 13:18:35 +00:00
{% load i18n %}
{% load humanize %}
{% load utilities %}
{% load markdown %}
{% load layout %}
{% load bookwyrm_group_tags %}
2021-01-29 17:29:59 +00:00
{% block title %}{{ user.display_name }}{% endblock %}
{% block opengraph_images %}
{% include 'snippets/opengraph_images.html' with image=user.preview_image %}
{% endblock %}
2021-01-29 17:29:59 +00:00
{% block content %}
2021-01-29 17:05:53 +00:00
<header class="block">
{% block header %}
<h1 class="title">
{% trans "User Profile" %}
</h1>
{% endblock %}
2021-01-29 17:05:53 +00:00
</header>
{# user bio #}
2020-09-29 20:39:44 +00:00
<div class="block">
<div class="columns">
2021-02-27 19:53:36 +00:00
<div class="column is-two-fifths">
{% include 'user/user_preview.html' with user=user %}
2020-03-17 00:09:45 +00:00
</div>
{% if user.summary %}
2021-08-01 00:30:21 +00:00
{% spaceless %}
<div class="column box has-background-white-bis content preserve-whitespace">
2021-05-11 22:14:42 +00:00
{{ user.summary|to_markdown|safe }}
2020-03-17 00:09:45 +00:00
</div>
{% endspaceless %}
{% endif %}
2020-03-17 00:09:45 +00:00
</div>
2021-01-29 19:44:04 +00:00
{% if not is_self and request.user.is_authenticated %}
{% include 'snippets/follow_button.html' with user=user %}
2020-03-17 00:09:45 +00:00
{% endif %}
{% if is_self and user.follower_requests.all %}
<div class="follow-requests">
<h2>{% trans "Follow Requests" %}</h2>
2020-03-17 00:09:45 +00:00
{% for requester in user.follower_requests.all %}
<div class="row shrink">
<p>
2021-03-07 18:24:46 +00:00
<a href="{{ requester.local_path }}">{{ requester.display_name }}</a> ({{ requester.username }})
2020-03-17 00:09:45 +00:00
</p>
{% include 'snippets/follow_request_buttons.html' with user=requester %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
2021-04-30 16:23:59 +00:00
{% block tabs %}
2021-02-01 19:34:08 +00:00
{% with user|username as username %}
<nav class="tabs">
<ul>
{% url 'user-feed' user|username as url %}
2021-02-01 19:34:08 +00:00
<li{% if url == request.path or url == request.path|add:'/' %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Activity" %}</a>
2021-02-01 19:34:08 +00:00
</li>
{% if is_self or user.goal.exists %}
2021-02-01 19:34:08 +00:00
{% now 'Y' as year %}
{% url 'user-goal' user|username year as url %}
2021-02-01 19:34:08 +00:00
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Reading Goal" %}</a>
2021-02-01 19:34:08 +00:00
</li>
{% endif %}
2021-03-07 16:42:30 +00:00
{% if is_self or user.list_set.exists %}
{% url 'user-lists' user|username as url %}
2021-02-01 19:34:08 +00:00
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Lists" %}</a>
2021-02-01 19:34:08 +00:00
</li>
{% endif %}
{% if is_self or user|has_groups %}
2021-09-23 21:50:57 +00:00
{% url 'user-groups' user|username as url %}
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Groups" %}</a>
</li>
{% endif %}
{% if user.shelf_set.exists %}
{% url 'user-shelves' user|username as url %}
2021-02-01 19:34:08 +00:00
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Books" %}</a>
2021-02-01 19:34:08 +00:00
</li>
{% endif %}
2021-02-01 19:34:08 +00:00
</ul>
</nav>
{% endwith %}
{% endblock %}
2020-03-17 00:09:45 +00:00
2021-01-29 17:05:53 +00:00
{% block panel %}{% endblock %}
{% endblock %}