moviewyrm/bookwyrm/templates/snippets/follow_button.html
Fabien Basmaison f77088b964 [assets] Remove redundant class already provided by bulma:
Replace all classes `hidden` with `is-hidden` in templates, CSS and JS.
2021-04-07 17:31:00 +02:00

31 lines
1.7 KiB
HTML

{% load i18n %}
{% if request.user == user or not request.user.is_authenticated %}
{% elif user in request.user.blocks.all %}
{% include 'snippets/block_button.html' %}
{% else %}
<div class="field{% if not minimal %} has-addons{% else %} mb-0{% endif %}">
<div class="control">
<form action="{% url 'follow' %}" method="POST" class="interaction follow-{{ user.id }} {% if request.user in user.followers.all or request.user in user.follower_requests.all %}is-hidden{%endif %}" data-id="follow-{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-small{% if not minimal %} is-link{% endif %}" type="submit">{% trans "Follow" %}</button>
</form>
<form action="{% url 'unfollow' %}" method="POST" class="interaction follow-{{ user.id }} {% if not request.user in user.followers.all and not request.user in user.follower_requests.all %}is-hidden{%endif %}" data-id="follow-{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
{% if user.manually_approves_followers and request.user not in user.followers.all %}
<button class="button is-small is-danger is-light" type="submit">{% trans "Undo follow request" %}</button>
{% else %}
<button class="button is-small is-danger is-light" type="submit">{% trans "Unfollow" %}</button>
{% endif %}
</form>
</div>
{% if not minimal %}
<div class="control">
{% include 'snippets/user_options.html' with user=user class="is-small" %}
</div>
{% endif %}
</div>
{% endif %}