moviewyrm/bookwyrm/templates/feed/feed.html

87 lines
3.5 KiB
HTML
Raw Normal View History

2021-01-29 18:25:31 +00:00
{% extends 'feed/feed_layout.html' %}
2021-02-28 02:48:10 +00:00
{% load i18n %}
2021-01-29 18:25:31 +00:00
{% load bookwyrm_tags %}
2021-03-26 17:32:42 +00:00
{% load humanize %}
2021-01-29 18:25:31 +00:00
{% block panel %}
<h1 class="title">
{% if tab == 'home' %}
{% trans "Home Timeline" %}
{% elif tab == 'local' %}
{% trans "Local Timeline" %}
{% else %}
{% trans "Federated Timeline" %}
{% endif %}
</h1>
2021-01-29 18:25:31 +00:00
<div class="tabs">
<ul>
2021-03-07 12:55:50 +00:00
<li class="{% if tab == 'home' %}is-active{% endif %}"{% if tab == 'home' %} aria-current="page"{% endif %}>
2021-02-28 02:48:10 +00:00
<a href="/#feed">{% trans "Home" %}</a>
2021-01-29 18:25:31 +00:00
</li>
2021-03-07 12:55:50 +00:00
<li class="{% if tab == 'local' %}is-active{% endif %}"{% if tab == 'local' %} aria-current="page"{% endif %}>
2021-02-28 02:48:10 +00:00
<a href="/local#feed">{% trans "Local" %}</a>
2021-01-29 18:25:31 +00:00
</li>
2021-03-07 12:55:50 +00:00
<li class="{% if tab == 'federated' %}is-active{% endif %}"{% if tab == 'federated' %} aria-current="page"{% endif %}>
2021-02-28 02:48:10 +00:00
<a href="/federated#feed">{% trans "Federated" %}</a>
2021-01-29 18:25:31 +00:00
</li>
</ul>
</div>
{# announcements and system messages #}
{% if not activities.number > 1 %}
<a href="{{ request.path }}" class="transition-y hidden notification is-primary is-block" data-poll-wrapper>
2021-03-23 19:52:38 +00:00
{% blocktrans %}load <span data-poll="stream/{{ tab }}">0</span> unread status(es){% endblocktrans %}
</a>
{% if request.user.show_goal and not goal and tab == 'home' %}
2021-01-29 18:25:31 +00:00
{% now 'Y' as year %}
2021-03-18 16:08:19 +00:00
<section class="block">
2021-01-29 18:25:31 +00:00
{% include 'snippets/goal_card.html' with year=year %}
<hr>
</section>
{% endif %}
{% endif %}
2021-01-29 18:25:31 +00:00
{# activity feed #}
{% if not activities %}
2021-02-28 02:48:10 +00:00
<p>{% trans "There aren't any activities right now! Try following a user to get started" %}</p>
2021-01-29 18:25:31 +00:00
{% endif %}
2021-01-29 18:25:31 +00:00
{% for activity in activities %}
2021-03-26 17:32:42 +00:00
{% if not activities.number > 1 and forloop.counter0 == 2 and suggested_users %}
{# suggested users on the first page, two statuses down #}
<section class="block">
<h2 class="title is-5">{% trans "Who to follow" %}</h2>
<div class="columns is-mobile scroll-x mb-0">
{% for user in suggested_users %}
<div class="column is-flex">
<div class="box has-text-centered is-shadowless has-background-white-bis m-0">
<a href="{{ user.local_path }}" class="has-text-black">
{% include 'snippets/avatar.html' with user=user large=True %}
<span title="{{ user.display_name }}" class="is-block is-6 has-text-weight-bold">{{ user.display_name|truncatechars:10 }}</span>
<span title="@{{ user|username }}" class="is-block pb-3">@{{ user|username|truncatechars:8 }}</span>
</a>
{% include 'snippets/follow_button.html' with user=user minimal=True %}
{% if user.mutuals %}
<p class="help">
{% blocktrans with mutuals=user.mutuals|intcomma count counter=user.mutuals %}{{ mutuals }} follower you follow{% plural %}{{ mutuals }} followers you follow{% endblocktrans %}
</p>
{% elif user.shared_books %}
<p class="help">{% blocktrans with shared_books=user.shared_books|intcomma count counter=user.shared_books %}{{ shared_books }} book on your shelves{% plural %}{{ shared_books }} books on your shelves{% endblocktrans %}</p>
{% endif %}
</div>
2021-03-26 17:32:42 +00:00
</div>
{% endfor %}
2021-03-26 17:32:42 +00:00
</div>
<a class="help" href="{% url 'directory' %}">View directory <span class="icon icon-arrow-right"></a>
2021-03-26 17:32:42 +00:00
</section>
{% endif %}
2021-01-29 18:25:31 +00:00
<div class="block">
{% include 'snippets/status/status.html' with status=activity %}
2021-01-29 18:25:31 +00:00
</div>
{% endfor %}
{% endblock %}