This commit is contained in:
saint 2024-03-11 08:49:43 +01:00
commit 762163e18a
15 changed files with 342 additions and 183 deletions

View file

@ -62,10 +62,38 @@ def domains():
domains = domains.order_by(Domain.name)
domains = domains.paginate(page=page, per_page=100, error_out=False)
ban_visibility_permission = False
if not current_user.is_anonymous:
if not current_user.created_recently() and current_user.reputation > 100 or current_user.is_admin():
ban_visibility_permission = True
next_url = url_for('domain.domains', page=domains.next_num) if domains.has_next else None
prev_url = url_for('domain.domains', page=domains.prev_num) if domains.has_prev and page != 1 else None
return render_template('domain/domains.html', title='All known domains', domains=domains,
next_url=next_url, prev_url=prev_url, search=search, ban_visibility_permission=ban_visibility_permission)
@bp.route('/domains/banned', methods=['GET'])
@login_required
def blocked_domains():
if not current_user.trustworthy():
abort(404)
page = request.args.get('page', 1, type=int)
search = request.args.get('search', '')
domains = Domain.query.filter_by(banned=True)
if search != '':
domains = domains.filter(Domain.name.ilike(f'%{search}%'))
domains = domains.order_by(Domain.name)
domains = domains.paginate(page=page, per_page=100, error_out=False)
next_url = url_for('domain.domains', page=domains.next_num) if domains.has_next else None
prev_url = url_for('domain.domains', page=domains.prev_num) if domains.has_prev and page != 1 else None
return render_template('domain/domains_blocked.html', title='Domains blocked on this instance', domains=domains,
next_url=next_url, prev_url=prev_url, search=search)

View file

@ -591,6 +591,13 @@ class User(UserMixin, db.Model):
return True
return False
def trustworthy(self):
if self.is_admin():
return True
if self.created_recently() or self.reputation < 100:
return False
return True
def link(self) -> str:
if self.is_local():
return self.user_name
@ -1075,7 +1082,8 @@ class Filter(db.Model):
def keywords_string(self):
if self.keywords is None or self.keywords == '':
return ''
return ', '.join(self.keywords.split('\n'))
split_keywords = [kw.strip() for kw in self.keywords.split('\n')]
return ', '.join(split_keywords)
class Role(db.Model):

View file

@ -1288,4 +1288,15 @@ fieldset legend {
max-width: 100%;
}
@media (orientation: portrait) {
.flex-sm-fill.text-sm-center.nav-link.active{
border-bottom: var(--bs-nav-tabs-border-width) solid var(--bs-border-color);
border-bottom-right-radius: var(--bs-nav-tabs-border-radius);
border-bottom-left-radius: var(--bs-nav-tabs-border-radius);
}
.card-header-tabs {
margin-bottom:8px;
}
}
/*# sourceMappingURL=structure.css.map */

View file

@ -167,10 +167,8 @@
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/u/{{ current_user.user_name }}" aria-haspopup="true" aria-expanded="false">{{ _('Account') }}</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'view_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}">{{ _('View profile') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'edit_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}/profile">{{ _('Edit profile') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'edit_profile' %} active{% endif %}" href="/user/settings">{{ _('Edit profile & settings') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'chats' %} active{% endif %}" href="/chat">{{ _('Chats') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'settings' %} active{% endif %}" href="/user/settings">{{ _('Settings') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'filters' %} active{% endif %}" href="/user/settings/filters">{{ _('Filters') }}</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="/donate">{{ _('Donate') }}</a></li>

View file

@ -114,7 +114,7 @@
</div>
<aside id="side_pane" class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3">
<div class="card mb-3">
<div class="card-header">
<h2>{{ community.title }}</h2>
</div>

View file

@ -8,32 +8,51 @@
{% block app_content %}
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item active">Domains</li>
</ol>
</nav>
{% if search == '' %}
<h1 class="mt-2">{{ _('All known domains') }}</h1>
<h1>{{ _('Domains') }}</h1>
{% else %}
<h1 class="mt-2">{{ _('Domains containing %(search)s', search=search) }}</h1>
<h1>{{ _('Domains containing "%(search)s"', search=search) }}</h1>
{% endif %}
<form method="get"><input type="search" name="search" value="{{ search }}" placeholder="{{ _('Search') }}" autofocus></form>
{% if not current_user.is_anonymous and current_user.trustworthy() %}
<div class="row">
<div class="col-auto">
<div class="btn-group">
<a href="/domains" class="btn {{ 'btn-primary' if request.path == '/domains' else 'btn-outline-secondary' }}">
{{ _('Domains') }}
</a>
<a href="/domains/banned" class="btn {{ 'btn-primary' if request.path == '/domains/banned' else 'btn-outline-secondary' }}">
{{ _('Banned domains') }}
</a>
</div>
</div>
<div class="col-auto">
<form method="get"><input type="search" name="search" value="{{ search }}" placeholder="{{ _('Search') }}" autofocus></form>
</div>
</div>
{% endif %}
<div class="table-responsive-sm pt-4">
<table class="table table-striped">
<thead>
<tr>
<th>Domain</th>
<th><span title="{{ _('How many times has something on this domain been posted?') }}"># Posts</span></th>
{% if not current_user.is_anonymous %}{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}<th>Actions</th>{%endif%}{%endif%}
</tr>
{% for domain in domains %}
<tr>
<th>{{ _('Domain') }}</th>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>{{ domain.post_count }}</td>
{% if not current_user.is_anonymous %}
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
<td>
<a class="confirm_first btn btn-primary" title="{{ _('Banning this domain will delete all posts linking to this domain and prevent future posts linking to that domain.') }}" href="/d/{{ domain.id }}/ban">{{ _('Ban') }}</a>
</td>
{% endif %}
{% endif %}
</tr>
</thead>
<tbody>
{% for domain in domains %}
<tr>
<th><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></th>
</tr>
{% endfor %}
</tbody>
{% endfor %}
</table>
</div>
<nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow">
@ -47,13 +66,9 @@
{% endif %}
</nav>
</div>
<aside id="side_pane" class="col-12 col-md-4 side_pane" role="complementary">
</aside>
</div>
<div class="row">
</div>
{% endblock %}

View file

@ -0,0 +1,71 @@
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
{% endif %} %}
{% from 'bootstrap/form.html' import render_form %}
{% block app_content %}
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
{% if search == '' %}
<h1>{{ _('Blocked domains') }}</h1>
{% else %}
<h1>{{ _('Blocked domains containing "%(search)s"', search=search) }}</h1>
{% endif %}
{% if not current_user.is_anonymous and current_user.trustworthy() %}
<div class="row">
<div class="col-auto">
<div class="btn-group">
<a href="/domains" class="btn {{ 'btn-primary' if request.path == '/domains' else 'btn-outline-secondary' }}">
{{ _('Domains') }}
</a>
<a href="/domains/banned" class="btn {{ 'btn-primary' if request.path == '/domains/banned' else 'btn-outline-secondary' }}">
{{ _('Banned domains') }}
</a>
</div>
</div>
<div class="col-auto">
<form method="get"><input type="search" name="search" value="{{ search }}" placeholder="{{ _('Search') }}" autofocus></form>
</div>
</div>
{% endif %}
<div class="table-responsive-sm pt-4">
<table class="table table-striped">
<tr>
<th>Domain</th>
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}<th>Actions</th>{%endif%}
</tr>
{% for domain in domains %}
<tr>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
{% if domain.banned %}
<a class="btn btn-primary confirm_first" title="{{ _('Unbanning this domain allows future posts linking to that domain.') }}" href="/d/{{ domain.id }}/unban">{{ _('Unban') }}</a>
{% else %}
<a class="btn btn-primary confirm_first" title="{{ _('Banning this domain will delete all posts linking to this domain and prevent future posts linking to that domain.') }}" href="/d/{{ domain.id }}/ban">{{ _('Ban') }}</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
<nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
</a>
{% endif %}
{% if next_url %}
<a href="{{ next_url }}" class="btn btn-primary" rel="nofollow">
{{ _('Next page') }} <span aria-hidden="true">&rarr;</span>
</a>
{% endif %}
</nav>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,15 @@
<div class="row mb-4">
<div class="col-auto">
<div class="btn-group">
<a href="/user/settings" class="btn {{ 'btn-primary' if request.path == '/user/settings' else 'btn-outline-secondary' }}">
{{ _('Settings') }}
</a>
<a href="/u/{{ current_user.user_name }}/profile" class="btn {{ 'btn-primary' if request.path.endswith('/profile') else 'btn-outline-secondary' }}">
{{ _('Profile') }}
</a>
<a href="/user/settings/filters" class="btn {{ 'btn-primary' if request.path == '/user/settings/filters' else 'btn-outline-secondary' }}">
{{ _('Blocks & Filters') }}
</a>
</div>
</div>
</div>

View file

@ -7,41 +7,40 @@
{% set active_child = 'filters' %}
{% block app_content %}
<div class="row">
<div class="col main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item"><a href="/user/settings">{{ _('Settings') }}</a></li>
<li class="breadcrumb-item"><a href="/user/settings/filters">{{ _('Filters') }}</a></li>
{% if content_filter %}
<li class="breadcrumb-item active">{{ _('Edit filter') }}</li>
{% else %}
<li class="breadcrumb-item active">{{ _('Add filter') }}</li>
{% endif %}
</ol>
</nav>
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item"><a href="/user/settings/filters">{{ _('Filters') }}</a></li>
{% if content_filter %}
<h1 class="mt-2">{{ _('Filter %(name)s', name=content_filter.title) }}</h1>
<li class="breadcrumb-item active">{{ _('Edit filter') }}</li>
{% else %}
<h1 class="mt-2">{{ _('Add filter') }}</h1>
<li class="breadcrumb-item active">{{ _('Add filter') }}</li>
{% endif %}
<form method='post' role="form">
{{ form.csrf_token() }}
{{ render_field(form.title) }}
<h4>{{ _('Filter in these places') }}</h4>
{{ render_field(form.filter_home) }}
{{ render_field(form.filter_posts) }}
{{ render_field(form.filter_replies) }}
{{ render_field(form.hide_type) }}
{{ render_field(form.keywords) }}
<small class="field_hint">{{ _('One per line. Case does not matter.') }}</small>
{{ render_field(form.expire_after) }}
<small class="field_hint">{{ _('Stop applying this filter after this date. Optional.') }}</small>
{{ render_field(form.submit) }}
</form>
</div>
</ol>
</nav>
{% if content_filter %}
<h1 class="mt-2">{{ _('Filter %(name)s', name=content_filter.title) }}</h1>
{% else %}
<h1 class="mt-2">{{ _('Add filter') }}</h1>
{% endif %}
{% include "user/_user_nav.html" %}
<form method='post' role="form">
{{ form.csrf_token() }}
{{ render_field(form.title) }}
<h4>{{ _('Filter in these places') }}</h4>
{{ render_field(form.filter_home) }}
{{ render_field(form.filter_posts) }}
{{ render_field(form.filter_replies) }}
{{ render_field(form.hide_type) }}
{{ render_field(form.keywords) }}
<small class="field_hint">{{ _('One per line. Case does not matter.') }}</small>
{{ render_field(form.expire_after) }}
<small class="field_hint">{{ _('Stop applying this filter after this date. Optional.') }}</small>
{{ render_field(form.submit) }}
</form>
</div>
</div>
{% endblock %}

View file

@ -7,53 +7,56 @@
{% from 'bootstrap/form.html' import render_field %}
{% block app_content %}
<div class="row">
<div class="col main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Edit profile') }}</li>
</ol>
</nav>
<h1 class="mt-2">{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1>
<form method='post' enctype="multipart/form-data" role="form" autocomplete="off">
{{ form.csrf_token() }}
{{ render_field(form.title) }}
{{ render_field(form.email) }}
{{ render_field(form.password_field) }}
<hr />
{{ render_field(form.about) }}
{% if not low_bandwidth %}
{% if markdown_editor %}
<script nonce="{{ session['nonce'] }}">
window.addEventListener("load", function () {
var downarea = new DownArea({
elem: document.querySelector('#about'),
resize: DownArea.RESIZE_VERTICAL,
hide: ['heading', 'bold-italic'],
value: {{ form.about.data | tojson | safe }}
});
setupAutoResize('about');
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Edit profile') }}</li>
</ol>
</nav>
<h1>{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1>
{% include "user/_user_nav.html" %}
<form method='post' enctype="multipart/form-data" role="form" autocomplete="off">
{{ form.csrf_token() }}
{{ render_field(form.email) }}
{{ render_field(form.password_field) }}
<h5> Profile Data </h5>
{{ render_field(form.title) }}
{{ render_field(form.about) }}
{% if not low_bandwidth %}
{% if markdown_editor %}
<script nonce="{{ session['nonce'] }}">
window.addEventListener("load", function () {
var downarea = new DownArea({
elem: document.querySelector('#about'),
resize: DownArea.RESIZE_VERTICAL,
hide: ['heading', 'bold-italic'],
value: {{ form.about.data | tojson | safe }}
});
</script>
{% else %}
<a href="#" aria-hidden="true" class="markdown_editor_enabler create_post_markdown_editor_enabler" data-id="about">{{ _('Enable markdown editor') }}</a>
{% endif %}
setupAutoResize('about');
});
</script>
{% else %}
<a href="#" aria-hidden="true" class="markdown_editor_enabler create_post_markdown_editor_enabler" data-id="about">{{ _('Enable markdown editor') }}</a>
{% endif %}
{{ render_field(form.matrixuserid) }}
<small class="field_hint">e.g. @something:matrix.org. Include leading @ and use : before server</small>
{{ render_field(form.profile_file) }}
<small class="field_hint">Provide a square image that looks good when small.</small>
{{ render_field(form.banner_file) }}
<small class="field_hint">Provide a wide image - letterbox orientation.</small>
<hr />
{{ render_field(form.bot) }}
{{ render_field(form.submit) }}
</form>
<p class="mt-4 pt-4">
<a class="btn btn-warning" href="{{ url_for('user.delete_account') }}">{{ _('Delete account') }}</a>
</p>
</div>
{% endif %}
{{ render_field(form.bot) }}
{{ render_field(form.matrixuserid) }}
<small class="field_hint">e.g. @something:matrix.org. Include leading @ and use : before server</small>
<h5> Profile Images </h5>
{{ render_field(form.profile_file) }}
<small class="field_hint">Provide a square image that looks good when small.</small>
{{ render_field(form.banner_file) }}
<small class="field_hint">Provide a wide image - letterbox orientation.</small>
{{ render_field(form.submit) }}
</form>
<p class="mt-4 pt-4">
<a class="btn btn-warning" href="{{ url_for('user.delete_account') }}">{{ _('Delete account') }}</a>
</p>
</div>
</div>
{% endblock %}

View file

@ -7,32 +7,37 @@
{% set active_child = 'settings' %}
{% block app_content %}
<div class="row">
<div class="col main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Change settings') }}</li>
</ol>
</nav>
<h1 class="mt-2">{{ _('Change settings') }}</h1>
<form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }}
{{ render_field(form.newsletter) }}
{{ render_field(form.email_unread) }}
{{ render_field(form.ignore_bots) }}
{{ render_field(form.nsfw) }}
{{ render_field(form.nsfl) }}
{{ render_field(form.markdown_editor) }}
{{ render_field(form.searchable) }}
{{ render_field(form.indexable) }}
{{ render_field(form.default_sort) }}
{{ render_field(form.import_file) }}
{{ render_field(form.theme) }}
{{ render_field(form.submit) }}
&nbsp;&nbsp;<a href="{{ url_for('user.user_settings_filters') }}">{{ _('Manage content filters') }}</a>
</form>
</div>
</div>
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Change settings') }}</li>
</ol>
</nav>
<h1>{{ _('Change settings') }}</h1>
{% include "user/_user_nav.html" %}
<form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }}
<h5> Mail Settings </h5>
{{ render_field(form.newsletter) }}
{{ render_field(form.email_unread) }}
<h5> Visibility </h5>
{{ render_field(form.ignore_bots) }}
{{ render_field(form.nsfw) }}
{{ render_field(form.nsfl) }}
{{ render_field(form.searchable) }}
{{ render_field(form.indexable) }}
<h5> Preferences </h5>
{{ render_field(form.markdown_editor) }}
{{ render_field(form.default_sort) }}
{{ render_field(form.theme) }}
<h5>Import</h5>
{{ render_field(form.import_file) }}
{{ render_field(form.submit) }}
</form>
</div>
</div>
{% endblock %}

View file

@ -7,46 +7,53 @@
{% set active_child = 'filters' %}
{% block app_content %}
<div class="row">
<div class="col main_pane">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active"><a href="/user/settings">{{ _('Settings') }}</a></li>
<li class="breadcrumb-item active">{{ _('Filters') }}</li>
</ol>
</nav>
<div class="rh_action_buttons">
<a class="btn btn-primary" href="{{ url_for('user.user_settings_filters_add') }}">{{ _('Add filter') }}</a>
</div>
<h1 class="mt-2">{{ _('Filters') }}</h1>
<p>{{ _('Filters can hide posts that contain keywords you specify, either by making them less noticeable or invisible.') }}</p>
{% if filters %}
<table class="table table-striped" role="table">
<tr>
<th>{{ _('Name') }}</th>
<th>{{ _('Keywords') }}</th>
<th>{{ _('Action') }}</th>
<th>{{ _('Expires') }}</th>
<th> </th>
</tr>
{% for filter in filters %}
<tr>
<td>{{ filter.title }}</td>
<td>{{ filter.keywords_string()|shorten(30) }}</td>
<td>{{ _('Invisible') if filter.hide_type == 1 else _('Semi-transparent') }}</td>
<td>{{ filter.expire_after if filter.expire_after }}</td>
<td>
<a href="{{ url_for('user.user_settings_filters_edit', filter_id=filter.id) }}">Edit</a> |
<a href="{{ url_for('user.user_settings_filters_delete', filter_id=filter.id) }}" class="confirm_first">Delete</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>{{ _('No filters defined yet.') }}</p>
{% endif %}
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Filters') }}</li>
</ol>
</nav>
<h1>{{ _('Filters') }}</h1>
{% include "user/_user_nav.html" %}
<div class="rh_action_buttons">
<a class="btn btn-primary" href="{{ url_for('user.user_settings_filters_add') }}">{{ _('Add filter') }}</a>
</div>
<p class="card-text">{{ _('Filters can hide posts that contain keywords you specify, either by making them less noticeable or invisible.') }}</p>
{% if filters %}
<table class="table table-striped" role="table">
<tr>
<th>{{ _('Name') }}</th>
<th>{{ _('Keywords') }}</th>
<th>{{ _('Action') }}</th>
<th>{{ _('Expires') }}</th>
<th> </th>
</tr>
{% for filter in filters %}
<tr>
<td>{{ filter.title }}</td>
<td>{{ filter.keywords_string()|shorten(30) }}</td>
<td>{{ _('Invisible') if filter.hide_type == 1 else _('Semi-transparent') }}</td>
<td>{{ filter.expire_after if filter.expire_after }}</td>
<td>
<a href="{{ url_for('user.user_settings_filters_edit', filter_id=filter.id) }}">Edit</a> |
<a href="{{ url_for('user.user_settings_filters_delete', filter_id=filter.id) }}" class="confirm_first">Delete</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>{{ _('No filters defined yet.') }}</p>
{% endif %}
<h5>Blocks</h5>
<p class="card-text">Manage what users, communities, domains or instances you want to block. Blocking them means you will no longer see any posts associated with them.</p>
<a class="btn btn-primary" href="">Manage User Blocks</a>
<a class="btn btn-primary" href="">Manage Communities Blocks</a>
<a class="btn btn-primary" href="">Manage Domain Blocks</a>
<a class="btn btn-primary" href="">Manage Instance Blocks</a>
</div>
</div>
{% endblock %}

View file

@ -54,7 +54,7 @@
<a class="w-100 btn btn-primary" href="/u/{{ current_user.user_name }}/profile">{{ _('Profile') }}</a>
</div>
<div class="col-6">
<a class="w-100 btn btn-primary" href="/u/{{ current_user.user_name }}/settings">{{ _('Settings') }}</a>
<a class="w-100 btn btn-primary" href="/user/settings">{{ _('Settings') }}</a>
</div>
</div>
</div>

View file

@ -108,7 +108,7 @@
<aside id="side_pane" class="col-12 col-md-4 side_pane" role="complementary">
{% if current_user.is_authenticated and current_user.id == user.id %}
<div class="card">
<div class="card mb-3">
<div class="card-header">
<h2>{{ _('Manage') }}</h2>
</div>
@ -125,7 +125,7 @@
</div>
{% endif %}
{% if len(subscribed) > 0 or len(moderates) > 0 %}
<div class="card mt-3">
<div class="card mb-3">
<div class="card-header">
<h2>{{ _('Communities') }}</h2>
</div>
@ -154,7 +154,7 @@
</div>
{% endif %}
{% if current_user.is_authenticated and (user_access('ban users', current_user.id) or user_access('manage users', current_user.id)) and user.id != current_user.id %}
<div class="card mt-3">
<div class="card mb-3">
<div class="card-header">
<h2>{{ _('Crush') }}</h2>
</div>
@ -184,7 +184,7 @@
</div>
{% endif %}
{% if upvoted %}
<div class="card mt-3">
<div class="card mb-3">
<div class="card-header">
<h2>{{ _('Upvoted') }}</h2>
</div>

View file

@ -207,7 +207,6 @@ def change_settings():
joined_communities=joined_communities(current_user.get_id())
)
@bp.route('/u/<actor>/ban', methods=['GET'])
@login_required
def ban_profile(actor):