moviewyrm/fedireads/templates/user.html
Adam Kelly c038888f63 Change url for edit_profile_page.
Fixes inaccessible edit form. /user/edit/ resolved to a user called edit
first. Also prevents a user accessing another user's edit form.
2020-03-08 16:42:06 +00:00

58 lines
1.7 KiB
HTML

{% extends 'layout.html' %}
{% block content %}
<div id="sidebar">
<div class="user-profile">
<h2>
{% include 'snippets/avatar.html' with user=user %}
{% if user.name %}{{ user.name }}{% endif %}
<small>{{ user.username }}</small>
</h2>
{% if user.summary %}
<blockquote>{{ user.summary | safe }}</blockquote>
{% endif %}
{% if not is_self %}
{% include 'snippets/follow_button.html' with user=user %}
{% endif %}
{% if is_self %}
<div class="interaction">
<a href="/edit_profile_page/">Edit profile</a>
</div>
{% endif %}
</div>
<div>
<h2>Followers</h2>
{% for follower in user.followers.all %}
<div>
<a href="{{ follower.actor }}">{{ follower.username }}</a>
{% if not request.user in follower.followers.all and request.user != follower %}
{% include 'snippets/follow_button.html' with user=follower %}
{% endif %}
</div>
{% endfor %}
</div>
<div>
<h2>Following</h2>
{% for following in user.following.all %}
<div>
<a href="{{ following.actor }}">{{ following.username }}</a>
{% if not request.user in following.followers.all and request.user != following %}
{% include 'snippets/follow_button.html' with user=following %}
{% endif %}
</div>
{% endfor %}
</div>
</div>
<div id="content">
{% for shelf in shelves %}
<div>
<h2>{{ shelf.name }}</h2>
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
</div>
{% endfor %}
</div>
{% endblock %}