2020-01-26 20:14:27 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
2020-01-29 01:23:38 +00:00
|
|
|
<div id="content">
|
2020-01-26 20:14:27 +00:00
|
|
|
<div class="user-profile">
|
2020-01-29 07:23:05 +00:00
|
|
|
<img class="user-pic" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}">
|
|
|
|
<h1>{% if user.name %}{{ user.name }}<br>{% endif %}{% if user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}</h1>
|
|
|
|
{% if user.summary %}
|
|
|
|
<blockquote>{{ user.summary }}</blockquote>
|
|
|
|
{% endif %}
|
2020-01-28 06:49:56 +00:00
|
|
|
{% if is_self %}<a href="/user/{{ user.localname }}/edit">Edit profile</a>
|
2020-01-26 20:14:27 +00:00
|
|
|
<p>Since {{ user.created_date }}</p>
|
2020-01-28 06:49:56 +00:00
|
|
|
{% endif %}
|
2020-01-26 20:14:27 +00:00
|
|
|
{% if not is_self %}
|
|
|
|
{% if not following %}
|
|
|
|
<form action="/follow/" method="post">
|
|
|
|
<input type="hidden" name="user" value="{{ user.id }}"></input>
|
|
|
|
<input type="submit" value="Follow"></input>
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<form action="/unfollow/" method="post">
|
|
|
|
<input type="hidden" name="user" value="{{ user.id }}"></input>
|
|
|
|
<input type="submit" value="Unfollow"></input>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-01-27 02:49:57 +00:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<h2>Books</h2>
|
|
|
|
{% for book in books.all %}
|
|
|
|
<div class="book">
|
|
|
|
{{ book.data.title }} by {{ book.authors.first.data.name }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<h2>Followers</h2>
|
|
|
|
{% for follower in user.followers.all %}
|
2020-01-27 06:47:32 +00:00
|
|
|
<div>
|
|
|
|
<a href="{{ follower.actor }}">{{ follower.username }}</a>
|
|
|
|
<form action="/follow/" method="post">
|
|
|
|
<input type="hidden" name="user" value="{{ follower.id }}"></input>
|
|
|
|
<input type="submit" value="Follow"></input>
|
|
|
|
</form>
|
|
|
|
</div>
|
2020-01-27 02:49:57 +00:00
|
|
|
{% endfor %}
|
2020-01-26 20:14:27 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|