2022-05-04 23:09:46 +00:00
{% extends "settings.html" %}
{% block pagetitle %}Block Settings - {{SITE_NAME}}{% endblock %}
{% block content %}
< div class = "row" >
< div class = "col" >
{% if error %}
< div class = "alert alert-danger alert-dismissible fade show my-3" role = "alert" >
< i class = "fas fa-exclamation-circle my-auto" > < / i >
< span >
{{error}}
< / span >
< button class = "close" data-bs-dismiss = "alert" aria-label = "Close" >
2022-09-08 17:24:00 +00:00
< span aria-hidden = "true" > < i class = "far fa-times" > < / i > < / span >
2022-05-04 23:09:46 +00:00
< / button >
< / div >
{% endif %}
< / div >
< / div >
< div class = "row" >
< div class = "col" >
< div class = "d-md-flex justify-content-between mb-3" >
< div >
< h2 class = "h5" > Users you block< / h2 >
< p class = "text-small text-muted mb-md-0" > You have blocked the following users. They cannot reply to your content or notify you with a username mention.< / p >
< / div >
< div class = "mt-auto" >
< button class = "btn btn-primary" data-bs-toggle = "modal" data-bs-target = "#blockmodal" > Block user< / button >
< / div >
< / div >
{% if v.blocking.first() %}
< div class = "card mb-5" >
< div class = "overflow-x-auto" > < table class = "table table-hover rounded mb-0" >
< thead class = "thead-dark" >
< tr >
< th scope = "col" > User< / th >
2022-07-03 07:41:25 +00:00
< th scope = "col" > Unblock< / th >
2022-05-04 23:09:46 +00:00
< / tr >
< / thead >
< tbody class = "text-muted" >
{% for block in v.blocking %}
2022-09-05 04:00:19 +00:00
{% set user=block.target %}
2022-07-03 07:41:25 +00:00
< tr >
< td >
2022-09-05 04:00:19 +00:00
{% include "user_in_table.html" %}
2022-07-03 07:41:25 +00:00
< / td >
2022-05-04 23:09:46 +00:00
< td >
2022-09-05 04:00:19 +00:00
< button class = "btn btn-primary" onclick = "post_toast(this,'/settings/unblock?username={{user.username}}&formkey={{v.formkey}}')" >
Unblock
< / button >
2022-05-04 23:09:46 +00:00
< / td >
< / tr >
2022-07-03 07:41:25 +00:00
{% else %}
2022-05-04 23:09:46 +00:00
< td > There are no blocked users< / td >
2022-07-03 07:41:25 +00:00
{% endfor %}
2022-05-04 23:09:46 +00:00
< / tbody >
< / table >
< / div >
{% else %}
< div class = "text-center border-md rounded py-7" >
< i class = "fas fa-ghost text-gray-500 mb-3" style = "font-size: 3.5rem;" > < / i >
< p class = "font-weight-bold text-gray-500 mb-0" > No blocked users< / p >
< / div >
{% endif %}
< / div >
< / div >
< div class = "modal fade" id = "blockmodal" tabindex = "-1" role = "dialog" aria-labelledby = "blockmodal" aria-hidden = "true" >
< div class = "modal-dialog modal-dialog-centered" role = "document" >
< form class = "m-auto" action = "/settings/block" id = "exile-form" method = "post" onsubmit = "return false;" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" > Block users< / h5 >
< button class = "close" data-bs-dismiss = "modal" aria-label = "Close" >
2022-09-08 17:24:00 +00:00
< span aria-hidden = "true" > < i class = "far fa-times" > < / i > < / span >
2022-05-04 23:09:46 +00:00
< / button >
< / div >
< div class = "modal-body" >
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< input autocomplete = "off" type = "text" name = "username" placeholder = "Enter username..." id = "exile-username" class = "form-control" maxlength = 25 required >
< / div >
< div class = "modal-footer" >
< button class = "btn btn-link text-muted" data-bs-dismiss = "modal" > Cancel< / button >
< button class = "btn btn-primary" id = "exileUserButton" onclick = "block_user()" > Block user< / button >
< / div >
< / div >
< / form >
< / div >
< / div >
< div class = "toast error" id = "toast-exile-error" role = "alert" aria-live = "assertive" aria-atomic = "true" data-bs-animation = "true" data-bs-autohide = "true" data-bs-delay = "5000" >
< div class = "toast-body text-center" >
< i class = "fas fa-exclamation-circle text-danger mr-2" > < / i > < span id = "toast-error-message" > Error. Please try again.< / span >
< / div >
< / div >
2022-09-24 07:04:06 +00:00
< script defer src = "{{'js/settings_blocks.js' | asset}}" > < / script >
2022-07-09 08:35:47 +00:00
2022-09-24 07:04:06 +00:00
{% endblock %}