2021-03-21 23:37:52 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load bookwyrm_tags %}
|
|
|
|
{% load humanize %}
|
|
|
|
|
|
|
|
{% block title %}{% trans "Directory" %}{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<header class="block">
|
|
|
|
<h1 class="title">
|
|
|
|
{% trans "Directory" %}
|
|
|
|
</h1>
|
|
|
|
</header>
|
2021-03-25 15:39:45 +00:00
|
|
|
|
|
|
|
{% if not request.user.discoverable %}
|
2021-03-25 23:32:15 +00:00
|
|
|
<div class="box has-text-centered content" data-hide="hide-join-directory"><div class="columns">
|
|
|
|
<div class="column">
|
2021-03-25 15:39:45 +00:00
|
|
|
<p>
|
2021-03-25 17:24:22 +00:00
|
|
|
{% trans "Make your profile discoverable to other BookWyrm users." %}
|
2021-03-25 15:39:45 +00:00
|
|
|
</p>
|
|
|
|
<form name="directory" method="POST" action="{% url 'directory' %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<button class="button is-primary" type="submit">Join Directory</button>
|
|
|
|
<p class="help">
|
2021-03-25 23:32:15 +00:00
|
|
|
{% url 'settings-profile' as path %}
|
|
|
|
{% blocktrans %}You can opt-out at any time in your <a href="{{ path }}">profile settings.</a>{% endblocktrans %}
|
2021-03-25 15:39:45 +00:00
|
|
|
</p>
|
|
|
|
</form>
|
2021-03-25 23:32:15 +00:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
{% trans "Dismiss message" as button_text %}
|
|
|
|
<button type="button" class="delete set-display" data-id="hide-join-directory" data-value="true">
|
|
|
|
<span>Dismiss message</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div></div>
|
2021-03-25 15:39:45 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-03-29 17:39:13 +00:00
|
|
|
{% include 'directory/filters.html' %}
|
2021-03-25 17:58:00 +00:00
|
|
|
|
2021-03-21 23:37:52 +00:00
|
|
|
<div class="columns is-multiline">
|
|
|
|
{% for user in users %}
|
|
|
|
<div class="column is-one-third">
|
2021-04-25 18:05:31 +00:00
|
|
|
<div class="card is-stretchable">
|
2021-03-21 23:37:52 +00:00
|
|
|
<div class="card-content">
|
|
|
|
<div class="media">
|
2021-03-30 01:47:21 +00:00
|
|
|
<a href="{{ user.local_path }}" class="media-left">
|
2021-03-21 23:37:52 +00:00
|
|
|
{% include 'snippets/avatar.html' with user=user large=True %}
|
2021-03-30 01:47:21 +00:00
|
|
|
</a>
|
2021-03-21 23:37:52 +00:00
|
|
|
<div class="media-content">
|
|
|
|
<a href="{{ user.local_path }}" class="is-block mb-2">
|
|
|
|
<span class="title is-4 is-block">{{ user.display_name }}</span>
|
2021-03-25 15:43:53 +00:00
|
|
|
<span class="subtitle is-7 is-block">@{{ user|username }}</span>
|
2021-03-21 23:37:52 +00:00
|
|
|
</a>
|
|
|
|
{% include 'snippets/follow_button.html' with user=user %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-04-25 18:05:31 +00:00
|
|
|
<div>
|
2021-03-25 15:43:53 +00:00
|
|
|
{% if user.summary %}
|
2021-03-21 23:37:52 +00:00
|
|
|
{{ user.summary | to_markdown | safe | truncatechars_html:40 }}
|
2021-03-25 15:43:53 +00:00
|
|
|
{% else %} {% endif %}
|
2021-03-21 23:37:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-25 18:05:31 +00:00
|
|
|
<footer class="card-footer">
|
2021-03-25 20:36:35 +00:00
|
|
|
{% if user != request.user %}
|
2021-03-27 14:36:14 +00:00
|
|
|
{% if user.mutuals %}
|
2021-03-21 23:37:52 +00:00
|
|
|
<div class="card-footer-item">
|
|
|
|
<div class="has-text-centered">
|
2021-03-25 20:36:35 +00:00
|
|
|
<p class="title is-6 mb-0">{{ user.mutuals }}</p>
|
2021-03-27 14:36:14 +00:00
|
|
|
<p class="help">{% blocktrans count counter=user.mutuals %}follower you follow{% plural %}followers you follow{% endblocktrans %}</p>
|
2021-03-21 23:37:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-03-27 14:36:14 +00:00
|
|
|
{% elif user.shared_books %}
|
|
|
|
<div class="card-footer-item">
|
|
|
|
<div class="has-text-centered">
|
|
|
|
<p class="title is-6 mb-0">{{ user.shared_books }}</p>
|
|
|
|
<p class="help">{% blocktrans count counter=user.shared_books %}book on your shelves{% plural %}books on your shelves{% endblocktrans %}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-03-25 20:36:35 +00:00
|
|
|
{% endif %}
|
2021-03-21 23:37:52 +00:00
|
|
|
<div class="card-footer-item">
|
|
|
|
<div class="has-text-centered">
|
|
|
|
<p class="title is-6 mb-0">{{ user.status_set.count|intword }}</p>
|
|
|
|
<p class="help">{% trans "posts" %}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card-footer-item">
|
|
|
|
<div class="has-text-centered">
|
|
|
|
<p class="title is-6 mb-0">{{ user.last_active_date|naturalday }}</p>
|
|
|
|
<p class="help">{% trans "last active" %}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{% include 'snippets/pagination.html' with page=users path="/directory" %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
2021-03-25 23:32:15 +00:00
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script src="/static/js/localstorage.js"></script>
|
|
|
|
{% endblock %}
|