2021-09-08 21:05:08 +00:00
{% extends 'settings/layout.html' %}
2021-04-12 21:23:51 +00:00
{% load i18n %}
2021-06-01 21:28:53 +00:00
{% block title %}{% trans "Add instance" %}{% endblock %}
2021-04-12 21:23:51 +00:00
{% block header %}
{% trans "Import Blocklist" %}
2022-02-28 20:31:28 +00:00
{% endblock %}
{% block breadcrumbs %}
< nav class = "breadcrumb subtitle" aria-label = "breadcrumbs" >
< ul >
< li > < a href = "{% url 'settings-federation' %}" > {% trans "Federated Instances" %}< / a > < / li >
< li class = "is-active" >
< a href = "#" aria-current = "page" >
{% trans "Import Blocklist" %}
< / a >
< / li >
< / ul >
< / nav >
2021-04-12 21:23:51 +00:00
{% endblock %}
{% block panel %}
< div class = "tabs" >
< ul >
{% url 'settings-import-blocklist' as url %}
< li { % if url in request . path % } class = "is-active" aria-current = "page" { % endif % } >
< a href = "{{ url }}" > {% trans "Import block list" %}< / a >
< / li >
{% url 'settings-add-federated-server' as url %}
< li { % if url in request . path % } class = "is-active" aria-current = "page" { % endif % } >
2021-06-01 21:28:53 +00:00
< a href = "{{ url }}" > {% trans "Add instance" %}< / a >
2021-04-12 21:23:51 +00:00
< / li >
< / ul >
< / div >
{% if succeeded and not failed %}
< p class = "notification is-primary" > {% trans "Success!" %}< / p >
{% elif succeeded or failed %}
< div class = "block content" >
{% if succeeded %}
< p > {% trans "Successfully blocked:" %} {{ succeeded }}< / p >
{% endif %}
< p > {% trans "Failed:" %}< / p >
< ul >
{% for item in failed %}
< li >
< pre >
{{ item }}
< / pre >
< / li >
{% endfor %}
< / ul >
< / div >
{% endif %}
< form method = "POST" action = "{% url 'settings-import-blocklist' %}" enctype = "multipart/form-data" >
{% csrf_token %}
< div class = "field" >
< label class = "label" for = "id_file" > JSON data:< / label >
< aside class = "help" >
2022-01-17 19:25:41 +00:00
Expects a json file in the format provided by < a href = "https://fediblock.org/" target = "_blank" rel = "noopener noreferrer" > FediBlock< / a > , with a list of entries that have < code > instance< / code > and < code > url< / code > fields. For example:
2021-04-12 21:23:51 +00:00
< pre >
[
{
2021-06-01 21:28:53 +00:00
"instance": "example.instance.com",
2021-04-12 21:23:51 +00:00
"url": "https://link.to.more/info"
},
...
]
< / pre >
< / aside >
< input type = "file" name = "json_file" required = "" id = "id_file" >
< / div >
< button type = "submit" class = "button is-primary" > {% trans "Import" %}< / button >
< / form >
{% endblock %}