moviewyrm/bookwyrm/templates/user/user_layout.html

78 lines
2.5 KiB
HTML

{% extends 'layout.html' %}
{% load i18n %}
{% load humanize %}
{% load bookwyrm_tags %}
{% block title %}{{ user.display_name }}{% endblock %}
{% block content %}
<header class="block">
{% block header %}{% endblock %}
</header>
{# user bio #}
<div class="block">
<div class="columns">
<div class="column is-two-fifths">
{% include 'user/user_preview.html' with user=user %}
</div>
<div class="column box has-background-white-bis content">
{% if user.summary %}
{{ user.summary | to_markdown | safe }}
{% endif %}
</div>
</div>
{% if not is_self and request.user.is_authenticated %}
{% include 'snippets/follow_button.html' with user=user %}
{% endif %}
{% if is_self and user.follower_requests.all %}
<div class="follow-requests">
<h2>{% trans "Follow Requests" %}</h2>
{% for requester in user.follower_requests.all %}
<div class="row shrink">
<p>
{% include 'snippets/username.html' with user=requester show_full=True %}
</p>
{% include 'snippets/follow_request_buttons.html' with user=requester %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% with user|username as username %}
{% if 'user/'|add:username|add:'/shelf' not in request.path and 'user/'|add:username|add:'/shelves' not in request.path %}
<nav class="tabs">
<ul>
{% url 'user-feed' user|username as url %}
<li{% if url == request.path or url == request.path|add:'/' %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Activity" %}</a>
</li>
{% if is_self or user.goal.exists %}
{% now 'Y' as year %}
{% url 'user-goal' user|username year as url %}
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Reading Goal" %}</a>
</li>
{% endif %}
{% if is_self or user.lists.exists %}
{% url 'user-lists' user|username as url %}
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Lists" %}</a>
</li>
{% endif %}
{% if user.shelf_set.exists %}
{% url 'user-shelves' user|username as url %}
<li{% if url in request.path %} class="is-active"{% endif %}>
<a href="{{ url }}">{% trans "Shelves" %}</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endwith %}
{% block panel %}{% endblock %}
{% endblock %}