moviewyrm/bookwyrm/templates/settings/link_domains/link_domains.html

107 lines
4.2 KiB
HTML
Raw Normal View History

2022-01-10 18:11:00 +00:00
{% extends 'settings/layout.html' %}
{% load i18n %}
2022-01-10 18:38:05 +00:00
{% load utilities %}
2022-01-10 18:11:00 +00:00
{% block title %}{% trans "Link Domains" %}{% endblock %}
{% block header %}{% trans "Link Domains" %}{% endblock %}
{% block panel %}
<p class="notification block">
{% trans "Link domains must be approved before they are shown on book pages. Please make sure that the domains are not hosting spam, malicious code, or deceptive links before approving." %}
</p>
<div class="block">
<div class="tabs">
<ul>
{% url 'settings-link-domain' status='pending' as url %}
<li {% if request.path in url %}class="is-active" aria-current="page"{% endif %}>
2022-01-10 19:52:00 +00:00
<a href="{{ url }}">{% trans "Pending" %} ({{ counts.pending }})</a>
2022-01-10 18:11:00 +00:00
</li>
{% url 'settings-link-domain' status='approved' as url %}
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
2022-01-10 19:52:00 +00:00
<a href="{{ url }}">{% trans "Approved" %} ({{ counts.approved }})</a>
2022-01-10 18:11:00 +00:00
</li>
{% url 'settings-link-domain' status='blocked' as url %}
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
2022-01-10 19:52:00 +00:00
<a href="{{ url }}">{% trans "Blocked" %} ({{ counts.blocked }})</a>
2022-01-10 18:11:00 +00:00
</li>
</ul>
</div>
{% for domain in domains %}
2022-01-10 18:38:05 +00:00
{% join "domain" domain.id as domain_modal %}
2022-01-10 22:55:10 +00:00
<div class="box content" id="{{ domain.id }}">
2022-01-10 18:11:00 +00:00
<div class="columns is-mobile">
<header class="column">
2022-01-10 19:03:10 +00:00
<h2 class="title is-5">
2022-01-10 18:11:00 +00:00
{{ domain.name }}
2022-01-17 19:25:41 +00:00
(<a href="http://{{ domain.domain }}" target="_blank" rel="noopener noreferrer">{{ domain.domain }}</a>)
2022-01-10 19:03:10 +00:00
</h2>
2022-01-10 18:11:00 +00:00
</header>
<div class="column is-narrow">
2022-01-10 18:38:05 +00:00
<button type="button" class="button" data-modal-open="{{ domain_modal }}">
<span class="icon icon-pencil m-0-mobile" aria-hidden="treu"></span>
<span class="is-sr-only-mobile">{% trans "Set display name" %}</span>
2022-01-10 18:38:05 +00:00
</button>
2022-01-10 18:11:00 +00:00
</div>
</div>
<div class="block">
<details class="details-panel">
<summary>
2022-01-10 20:30:24 +00:00
<span role="heading" aria-level="3" class="title is-6 mb-0">
2022-01-10 18:11:00 +00:00
{% trans "View links" %}
({{ domain.links.count }})
2022-01-10 20:30:24 +00:00
</span>
2022-01-10 18:11:00 +00:00
<span class="details-close icon icon-x" aria-hidden></span>
</summary>
2022-01-10 19:03:10 +00:00
<div class="table-container mt-4">
2022-01-10 22:55:10 +00:00
{% include "settings/link_domains/link_table.html" with links=domain.links.all|slice:10 %}
2022-01-10 19:03:10 +00:00
</div>
2022-01-10 18:11:00 +00:00
</details>
</div>
2022-01-10 18:38:05 +00:00
{% include "settings/link_domains/edit_domain_modal.html" with domain=domain id=domain_modal %}
2022-01-10 19:19:20 +00:00
<div class="field has-addons">
{% if status != "approved" %}
<form
name="domain-{{ domains.id }}-approve"
class="control"
method="post"
action="{% url 'settings-link-domain-status' domain.id 'approved' %}"
>
{% csrf_token %}
<button type="submit" class="button is-success is-light">{% trans "Approve" %}</button>
</form>
{% endif %}
{% if status != "blocked" %}
<form
name="domain-{{ domains.id }}-block"
class="control"
method="post"
action="{% url 'settings-link-domain-status' domain.id 'blocked' %}"
>
{% csrf_token %}
<button type="submit" class="button is-danger is-light">{% trans "Block" %}</button>
</form>
{% endif %}
</div>
2022-01-10 18:11:00 +00:00
</div>
{% endfor %}
{% if not domains.exists %}
{% if status == "approved" %}
<em>{% trans "No domains currently approved" %}</em>
{% elif status == "pending" %}
<em>{% trans "No domains currently pending" %}</em>
{% else %}
<em>{% trans "No domains currently blocked" %}</em>
{% endif %}
{% endif %}
</div>
{% endblock %}