mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Merge pull request 'Various smaller fixes' (#240) from h3ndrik/pyfedi:fixes into main
Reviewed-on: https://codeberg.org/rimu/pyfedi/pulls/240
This commit is contained in:
commit
5d857763e5
10 changed files with 30 additions and 24 deletions
|
@ -136,8 +136,6 @@ class AddUserForm(FlaskForm):
|
|||
hide_nsfl = SelectField(_l('Show NSFL posts'), choices=hide_type_choices, default=1,
|
||||
coerce=int, render_kw={'class': 'form-select'})
|
||||
|
||||
nsfw = BooleanField(_l('Show NSFW posts'))
|
||||
nsfl = BooleanField(_l('Show NSFL posts'))
|
||||
role_options = [(2, _l('User')),
|
||||
(3, _l('Staff')),
|
||||
(4, _l('Admin')),
|
||||
|
|
2
app/static/js/moment-with-locales.min.js
vendored
Normal file
2
app/static/js/moment-with-locales.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -32,8 +32,8 @@
|
|||
{{ render_field(form.verified) }}
|
||||
{{ render_field(form.banned) }}
|
||||
{{ render_field(form.newsletter) }}
|
||||
{{ render_field(form.nsfw) }}
|
||||
{{ render_field(form.nsfl) }}
|
||||
{{ render_field(form.hide_nsfw) }}
|
||||
{{ render_field(form.hide_nsfl) }}
|
||||
{{ render_field(form.role) }}
|
||||
{{ render_field(form.submit) }}
|
||||
</form>
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<form method="get">
|
||||
<input type="search" name="search"> <input type="submit" name="submit" value="Search">
|
||||
</form>
|
||||
Result Filter:
|
||||
<a href="{{ url_for('admin.admin_communities') }}">All</a> |
|
||||
<a href="{{ url_for('admin.admin_communities_no_topic') }}">No topic</a>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
|
@ -27,17 +30,17 @@
|
|||
</tr>
|
||||
{% for community in communities.items %}
|
||||
<tr>
|
||||
<td>{{ community.name }}</td>
|
||||
<td><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</td>
|
||||
<td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
|
||||
<td><a href="/c/{{ community.link() }}">
|
||||
<img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</a></td>
|
||||
<td>{{ community.topic.name }}</td>
|
||||
<td>{{ community.post_count }}</td>
|
||||
<th>{{ '✓'|safe if community.show_home else '✗'|safe }}</th>
|
||||
<th>{{ '✓'|safe if community.show_popular else '✗'|safe }}</th>
|
||||
<th>{{ '✓'|safe if community.show_all else '✗'|safe }}</th>
|
||||
<th>{{ '⚠'|safe if community.nsfw or community.nsfl or community.content_warning else ''|safe }}</th>
|
||||
<td><a href="/c/{{ community.link() }}">View</a> |
|
||||
<a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">Edit</a> |
|
||||
<td><a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">Edit</a> |
|
||||
<a href="{{ url_for('admin.admin_community_delete', community_id=community.id) }}" class="confirm_first">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% block app_content %}
|
||||
{% macro render_topic(topic, depth) %}
|
||||
<tr>
|
||||
<td nowrap="nowrap">{{ '--' * depth }} {{ topic['topic'].name }}</td>
|
||||
<td nowrap="nowrap">{{ '--' * depth }} <a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a></td>
|
||||
<td>{{ topic['topic'].num_communities }}</td>
|
||||
<td><a href="{{ url_for('admin.admin_topic_edit', topic_id=topic['topic'].id) }}">Edit</a> |
|
||||
{% if topic['topic'].num_communities == 0 %}
|
||||
|
|
|
@ -32,9 +32,10 @@
|
|||
</tr>
|
||||
{% for user in users.items %}
|
||||
<tr>
|
||||
<td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</td>
|
||||
<td>{{ 'Local' if user.is_local() else 'Remote' }}</td>
|
||||
<td><a href="/u/{{ user.link() }}">
|
||||
<img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</a></td>
|
||||
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
|
||||
<td>{% if request.args.get('local_remote', '') == 'local' %}
|
||||
{{ moment(user.last_seen).fromNow() }}
|
||||
{% else %}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% endif %} %}
|
||||
{% from 'bootstrap/form.html' import render_form %}
|
||||
{% set active_child = 'admin_users' %}
|
||||
{% set active_child = 'admin_users_trash' %}
|
||||
|
||||
{% block app_content %}
|
||||
<div class="row">
|
||||
|
@ -34,9 +34,10 @@
|
|||
</tr>
|
||||
{% for user in users.items %}
|
||||
<tr>
|
||||
<td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</td>
|
||||
<td>{{ 'Local' if user.is_local() else 'Remote' }}</td>
|
||||
<td><a href="/u/{{ user.link() }}">
|
||||
<img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</a></td>
|
||||
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
|
||||
<td>{% if request.args.get('local_remote', '') == 'local' %}
|
||||
{{ moment(user.last_seen).fromNow() }}
|
||||
{% else %}
|
||||
|
|
|
@ -208,7 +208,6 @@
|
|||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_site' }}" href="{{ url_for('admin.admin_site') }}">{{ _('Site profile') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_misc' }}" href="{{ url_for('admin.admin_misc') }}">{{ _('Misc settings') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_communities' }}" href="{{ url_for('admin.admin_communities') }}">{{ _('Communities') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_communities' }}" href="{{ url_for('admin.admin_communities_no_topic') }}">{{ _('Communities - no topic') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_topics' }}" href="{{ url_for('admin.admin_topics') }}">{{ _('Topics') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_users' }}" href="{{ url_for('admin.admin_users', local_remote='local') }}">{{ _('Users') }}</a></li>
|
||||
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_users_trash' }}" href="{{ url_for('admin.admin_users_trash', local_remote='local') }}">{{ _('Monitoring - users') }}</a></li>
|
||||
|
@ -272,7 +271,7 @@
|
|||
|
||||
{% block scripts -%}
|
||||
{% if not low_bandwidth -%}
|
||||
{{ str(moment.include_moment()).replace('<script>', '<script nonce="' + session['nonce'] + '">')|safe }}
|
||||
{{ str(moment.include_moment(local_js='/static/js/moment-with-locales.min.js')).replace('<script>', '<script nonce="' + session['nonce'] + '">')|safe }}
|
||||
{{ str(moment.lang(g.locale)).replace('<script>', '<script nonce="' + session['nonce'] + '">')|safe }}
|
||||
{% endif -%}
|
||||
{% endblock -%}
|
||||
|
|
|
@ -63,23 +63,23 @@
|
|||
<tr>
|
||||
<th> </th>
|
||||
<th {% if not low_bandwidth -%}colspan="2"{% endif -%} scope="col">
|
||||
<a href="?sort_by=title{{ ' desc' if sort_by == 'title' }}" title="{{ _('Sort by name') }}" rel="nofollow">{{ _('Community') }}
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'community.title' }}{{ 'fe fe-chevron-down' if sort_by == 'community.title desc' }}"></span>
|
||||
<a href="?sort_by=title{{ ' asc' if sort_by == 'title desc' else ' desc' }}" title="{{ _('Sort by name') }}" rel="nofollow">{{ _('Community') }}
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'title asc' }}{{ 'fe fe-chevron-down' if sort_by == 'title desc' }}"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<a href="?sort_by=post_count{{ ' asc' if sort_by == 'post_count desc' else ' desc' }}" title="{{ _('Sort by post count') }}" rel="nofollow">{{ _('Posts') }}
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'post_count' }}{{ 'fe fe-chevron-down' if sort_by == 'community.post_count desc' }}"></span>
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'post_count asc' }}{{ 'fe fe-chevron-down' if sort_by == 'post_count desc' }}"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<a href="?sort_by=post_reply_count{{ ' asc' if sort_by == 'post_reply_count desc' else ' desc' }}" title="{{ _('Sort by reply count') }}" rel="nofollow">{{ _('Comments') }}
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'post_reply_count' }}{{ 'fe fe-chevron-down' if sort_by == 'community.post_reply_count desc' }}"></span>
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'post_reply_count asc' }}{{ 'fe fe-chevron-down' if sort_by == 'post_reply_count desc' }}"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<a href="?sort_by=last_active{{ ' asc' if sort_by == 'last_active desc' else ' desc' }}" title="{{ _('Sort by recent activity') }}" rel="nofollow">{{ _('Active') }}
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_active' }}{{ 'fe fe-chevron-down' if sort_by == 'community.last_active desc' }}"></span>
|
||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_active asc' }}{{ 'fe fe-chevron-down' if sort_by == 'last_active desc' }}"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
|
|
|
@ -40,6 +40,8 @@ class Config(object):
|
|||
BOUNCE_USERNAME = os.environ.get('BOUNCE_USERNAME') or ''
|
||||
BOUNCE_PASSWORD = os.environ.get('BOUNCE_PASSWORD') or ''
|
||||
|
||||
BOOTSTRAP_SERVE_LOCAL = True
|
||||
|
||||
SENTRY_DSN = os.environ.get('SENTRY_DSN') or None
|
||||
|
||||
AWS_REGION = os.environ.get('AWS_REGION') or None
|
||||
|
|
Loading…
Reference in a new issue