Skip to content

Commit

Permalink
Merge branch 'main' into fix/related-panel-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BentiGorlich authored Jun 14, 2024
2 parents 0a4df47 + e8ae52d commit 5136b39
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 17 deletions.
4 changes: 4 additions & 0 deletions src/Controller/User/ThemeSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class ThemeSettingsController extends AbstractController
public const KBIN_SUBSCRIPTIONS_SIDEBARS_SAME_SIDE = 'kbin_subscriptions_sidebars_same_side';
public const KBIN_SUBSCRIPTIONS_LARGE_PANEL = 'kbin_subscriptions_large_panel';
public const KBIN_SUBSCRIPTIONS_SHOW_MAGAZINE_ICON = 'kbin_subscriptions_show_magazine_icon';
public const MBIN_MODERATION_LOG_SHOW_USER_AVATARS = 'mbin_moderation_log_show_user_avatars';
public const MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS = 'mbin_moderation_log_show_magazine_icons';

public const CLASSIC = 'classic';
public const CHAT = 'chat';
Expand Down Expand Up @@ -96,6 +98,8 @@ class ThemeSettingsController extends AbstractController
self::KBIN_SUBSCRIPTIONS_SIDEBARS_SAME_SIDE,
self::KBIN_SUBSCRIPTIONS_LARGE_PANEL,
self::KBIN_SUBSCRIPTIONS_SHOW_MAGAZINE_ICON,
self::MBIN_MODERATION_LOG_SHOW_USER_AVATARS,
self::MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS,
];

public const VALUES = [
Expand Down
5 changes: 5 additions & 0 deletions templates/components/magazine_box.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<li>{{ 'created_at'|trans }}:
{{ component('date', {date: computed.magazine.createdAt}) }}
</li>
{% if app.user is defined and app.user is not null and app.user.admin() and computed.magazine.apId is not null %}
<li>
{{ 'last_updated'|trans }}: {{ component('date', {date: computed.magazine.apFetchedAt}) }}
</li>
{% endif %}
<li>{{ 'subscribers'|trans }}: <span>{{ computed.magazine.subscriptionsCount }}</span></li>
</ul>
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions templates/layout/_options_appearance.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
{{ component('settings_row_enum', {label: 'comment_reply_position'|trans, help: 'comment_reply_position_help'|trans, settingsKey: 'KBIN_COMMENTS_REPLY_POSITION', values: [ {name: 'position_top'|trans , value: 'TOP'}, {name: 'position_bottom'|trans , value: 'BOTTOM' } ], defaultValue: 'TOP' } ) }}
{{ component('settings_row_switch', {label: 'show_avatars_on_comments'|trans, help: 'show_avatars_on_comments_help'|trans, settingsKey: 'KBIN_COMMENTS_SHOW_USER_AVATAR', defaultValue: true}) }}
</div>
<strong>{{ 'mod_log'|trans }}</strong>
<div class="settings-section">
{{ component('settings_row_switch', {label: 'show_users_avatars'|trans, settingsKey: 'MBIN_MODERATION_LOG_SHOW_USER_AVATARS', defaultValue: false}) }}
{{ component('settings_row_switch', {label: 'show_magazines_icons'|trans, settingsKey: 'MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS', defaultValue: false}) }}
</div>
</div>
30 changes: 18 additions & 12 deletions templates/modlog/_blocks.html.twig
Original file line number Diff line number Diff line change
@@ -1,58 +1,64 @@
{% block log_entry_deleted %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'removed_thread_by'|trans|lower }} {{ component('user_inline', {user: log.entry.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.entry.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'removed_thread_by'|trans|lower }} {{ component('user_inline', {user: log.entry.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.entry.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ entry_url(log.entry) }}">{{ log.entry.shortTitle(300) }}</a>
{% endblock %}

{% block log_entry_restored %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'restored_thread_by'|trans|lower }} {{ component('user_inline', {user: log.entry.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.entry.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'restored_thread_by'|trans|lower }} {{ component('user_inline', {user: log.entry.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.entry.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ entry_url(log.entry) }}">{{ log.entry.shortTitle(300) }}</a>
{% endblock %}

{% block log_entry_comment_deleted %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'removed_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'removed_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ entry_comment_view_url(log.comment) }}#{{ get_url_fragment(log.comment) }}">{{ log.comment.shortTitle(300) }}</a>
{% endblock %}

{% block log_entry_comment_restored %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'restored_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'restored_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ entry_comment_view_url(log.comment) }}#{{ get_url_fragment(log.comment) }}">{{ log.comment.shortTitle(300) }}</a>
{% endblock %}

{% block log_post_deleted %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'removed_post_by'|trans|lower }} {{ component('user_inline', {user: log.post.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.post.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'removed_post_by'|trans|lower }} {{ component('user_inline', {user: log.post.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.post.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ post_url(log.post) }}">{{ log.post.shortTitle(300) }}</a>
{% endblock %}

{% block log_post_restored %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'restored_post_by'|trans|lower }} {{ component('user_inline', {user: log.post.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.post.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'restored_post_by'|trans|lower }} {{ component('user_inline', {user: log.post.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.post.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ post_url(log.post) }}">{{ log.post.shortTitle(300) }}</a>
{% endblock %}

{% block log_post_comment_deleted %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'removed_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'removed_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ post_url(log.comment.post) }}#{{ get_url_fragment(log.comment) }}">{{ log.comment.shortTitle(300) }}</a>
{% endblock %}

{% block log_post_comment_restored %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {{ 'restored_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user, showAvatar: false}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showIcon: false }) }}{% endif %} -
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {{ 'restored_comment_by'|trans|lower }} {{ component('user_inline', {user: log.comment.user}) }}{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.comment.magazine, showAvatar: showIcons }) }}{% endif %} -
<a href="{{ post_url(log.comment.post) }}#{{ get_url_fragment(log.comment) }}">{{ log.comment.shortTitle(300) }}</a>
{% endblock %}

{% block log_ban %}
{{ component('user_inline', {user: log.user, showAvatar: false}) }} {% if log.meta is same as 'ban' %}{{ 'he_banned'|trans|lower }}{% else %}{{ 'he_unbanned'|trans|lower }}{% endif %} {{ component('user_inline', {user: log.ban.user, showAvatar: false}) }}
{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.ban.magazine, showIcon: false }) }}{% endif %}{% if log.ban.reason %} - {{ log.ban.reason }}{% endif %}
{{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }} {% if log.meta is same as 'ban' %}{{ 'he_banned'|trans|lower }}{% else %}{{ 'he_unbanned'|trans|lower }}{% endif %} {{ component('user_inline', {user: log.ban.user}) }}
{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.ban.magazine, showAvatar: showIcons }) }}{% endif %}{% if log.ban.reason %} - {{ log.ban.reason }}{% endif %}
{% endblock %}

{% block log_moderator_add %}
{% if log.actingUser is not same as null %}
{{ component('user_inline', {user: log.actingUser}) }}
{% else %}
{{ 'someone'|trans }}
{% endif %}
{{ 'magazine_log_mod_added'|trans }}: {{ component('user_inline', {user: log.user}) }}
{{ 'magazine_log_mod_added'|trans -}}
{% if showMagazine %} {{ 'in'|trans|lower }} {{ component('magazine_inline', {magazine: log.magazine, showAvatar: showIcons }) -}}{%- endif -%}: {{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }}
{% endblock %}

{% block log_moderator_remove %}
{% if log.actingUser is not same as null %}
{{ component('user_inline', {user: log.actingUser}) }}
{% else %}
{{ 'someone'|trans }}
{% endif %}
{{ 'magazine_log_mod_removed'|trans }}: {{ component('user_inline', {user: log.user}) }}
{{ 'magazine_log_mod_removed'|trans -}}
{% if showMagazine %} {{ 'from'|trans|lower }} {{ component('magazine_inline', {magazine: log.magazine, showAvatar: showIcons }) -}}{%- endif -%}: {{ component('user_inline', {user: log.user, showAvatar: showAvatars}) }}
{% endblock %}
9 changes: 8 additions & 1 deletion templates/modlog/front.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{% extends 'base.html.twig' %}
{% set V_TRUE = constant('App\\Controller\\User\\ThemeSettingsController::TRUE') %}
{% set MBIN_MODERATION_LOG_SHOW_USER_AVATARS = constant('App\\Controller\\User\\ThemeSettingsController::MBIN_MODERATION_LOG_SHOW_USER_AVATARS') %}
{% set showAvatars = app.request.cookies.get(MBIN_MODERATION_LOG_SHOW_USER_AVATARS) is same as V_TRUE %}
{% set MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS = constant('App\\Controller\\User\\ThemeSettingsController::MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS') %}
{% set showIcons = app.request.cookies.get(MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS) is same as V_TRUE %}
{% use 'modlog/_blocks.html.twig' %}

{%- block title -%}
Expand Down Expand Up @@ -27,7 +32,9 @@
<div>
{%- with {
log: log,
showMagazine: false,
showMagazine: true,
showAvatars: showAvatars,
showIcons: showIcons,
} only -%}
{{ block(log.type) }}
{%- endwith -%}
Expand Down
9 changes: 8 additions & 1 deletion templates/modlog/magazine.html.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{% extends 'base.html.twig' %}
{% set V_TRUE = constant('App\\Controller\\User\\ThemeSettingsController::TRUE') %}
{% set MBIN_MODERATION_LOG_SHOW_USER_AVATARS = constant('App\\Controller\\User\\ThemeSettingsController::MBIN_MODERATION_LOG_SHOW_USER_AVATARS') %}
{% set showAvatars = app.request.cookies.get(MBIN_MODERATION_LOG_SHOW_USER_AVATARS) is same as V_TRUE %}
{% set MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS = constant('App\\Controller\\User\\ThemeSettingsController::MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS') %}
{% set showIcons = app.request.cookies.get(MBIN_MODERATION_LOG_SHOW_MAGAZINE_ICONS) is same as V_TRUE %}
{% use 'modlog/_blocks.html.twig' %}

{%- block title -%}
{{- 'magazines'|trans }} - {{ parent() -}}
{%- endblock -%}

{% block mainClass %}page-magazines{% endblock %}
{% block mainClass %}page-magazines page-modlog{% endblock %}

{% block header_nav %}
{% endblock %}
Expand All @@ -24,6 +29,8 @@
{%- with {
log: log,
showMagazine: false,
showAvatars: showAvatars,
showIcons: showIcons,
} only -%}
{{ block(log.type) }}
{%- endwith -%}
Expand Down
5 changes: 5 additions & 0 deletions templates/user/_info.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
{% endif %}
<ul class="info">
<li>{{ 'joined'|trans }}: {{ component('date', {date: user.createdAt}) }}</li>
{% if app.user is defined and app.user is not null and app.user.admin() and user.apId is not null %}
<li>
{{ 'last_updated'|trans }}: {{ component('date', {date: user.apFetchedAt}) }}
</li>
{% endif %}
{%- set TYPE_ENTRY = constant('App\\Repository\\ReputationRepository::TYPE_ENTRY') -%}
<li><a href="{{ path('user_reputation', {username: user.username, reputationType: TYPE_ENTRY}) }}" class="stretched-link">{{ 'reputation_points'|trans }}:</a> {{ get_reputation_total(user) }}</li>
<li><a href="{{ path('user_moderated', {username: user.username}) }}"
Expand Down
23 changes: 20 additions & 3 deletions translations/messages.de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ toolbar.ordered_list: Geordnete Liste
your_account_is_not_active: Dein Profil wurde noch nicht aktiviert. Bitte prüfe deine
E-Mails und klicke den Aktivierungslink um fortzufahren. Falls du keine Mail erhalten
hast frage <a href="%link_target%">eine neue Aktivierungsmail</a> an.
your_account_has_been_banned: E-Mails für Anweisungen zur Kontoaktivierung oder <a
href="%link_target%">fordere eine neue E-Mail zur Aktivierung an</a>
your_account_has_been_banned: Dein Konto wurde gesperrt
federation_page_enabled: Föderationsseite aktiviert
federation_page_disallowed_description: Instanzen mit denen wir nicht föderieren
federation_page_allowed_description: Bekannte Instanzen mit denen wir föderieren
Expand Down Expand Up @@ -469,7 +468,7 @@ subscription_sort: Sortierung
unblock: Entblockieren
oauth.consent.grant_permissions: Gebe Berechtigungen
oauth2.grant.moderate.magazine.ban.delete: Nutzer in deinen moderierten Magazinen
entbannen.
entsperren.
subscriptions_in_own_sidebar: In eigener Seitenleiste
subscription_sidebar_pop_out_left: Nach links in eigene Seitenleiste verschieben
subscription_sidebar_pop_out_right: Nach rechts in eigene Seitenleiste verschieben
Expand Down Expand Up @@ -854,3 +853,21 @@ restrict_magazine_creation: 'Erstellung lokaler Magazine auf Admins und globale
sort_by: 'Sortieren nach'
filter_by_subscription: 'Nach Abonnements filtern'
related_entry: Zugehörig
tag: Hashtag
unban: Sperre aufheben
ban_hashtag_btn: Hashtag Sperren
unban_hashtag_btn: Hashtag Sperre Aufheben
private_instance: Nutzer zur Anmeldung zwingen um auf Inhalte zugreifen zu können
flash_thread_tag_banned_error: Thema konnte nicht erstellt werden. Der Inhalt ist
nicht erlaubt.
sso_only_mode: Anmeldung und Registrierung auf SSO Methoden beschränken
magazine_log_mod_added: hat einen Moderator hinzugefügt
magazine_log_mod_removed: hat einen Moderator entfernt
ban_hashtag_description: Durch das Sperren eines Hashtags wird verhindert, dass Beiträge
mit diesem Hashtag erstellt werden. Außerdem werden vorhandene Beiträge mit diesem
Hashtag ausgeblendet.
unban_hashtag_description: Wenn Sie eine Hashtag Sperre aufheben, können wieder Beiträge
mit diesem Hashtag erstellt werden. Vorhandene Beiträge mit diesem Hashtag werden
nicht mehr ausgeblendet.
sso_show_first: SSO als erstes auf der Anmeldungs- und Registrierungsseite anzeigen
continue_with: Weiter mit
3 changes: 3 additions & 0 deletions translations/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ reset_password: Reset password
show_more: Show more
to: to
in: in
from: from
username: Username
email: Email
repeat_password: Repeat password
Expand Down Expand Up @@ -824,5 +825,7 @@ related_entry: Related
restrict_magazine_creation: Restrict local magazine creation to admins and global mods
sso_show_first: Show SSO first on login and registration pages
continue_with: Continue with
someone: Someone
magazine_log_mod_added: has added a moderator
magazine_log_mod_removed: has removed a moderator
last_updated: Last updated

0 comments on commit 5136b39

Please sign in to comment.