From f5f18518da35245f5200654dcc53d20c960cc38f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 7 Nov 2023 21:25:00 +0000 Subject: [PATCH] Frio: Improved display of disabled activities --- src/Content/Conversation.php | 7 +-- src/Object/Post.php | 1 + static/defaults.config.php | 8 +-- view/theme/frio/css/style.css | 4 ++ view/theme/frio/scheme/black.php | 1 + view/theme/frio/scheme/dark.php | 1 + view/theme/frio/style.php | 1 + view/theme/frio/templates/wall_thread.tpl | 61 ++++++++++++++--------- 8 files changed, 54 insertions(+), 30 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 5a32bf32f2..90479cf407 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -889,9 +889,10 @@ class Conversation $condition['author-hidden'] = false; } - if ($this->config->get('system', 'emoji_activities')) { - $emojis = $this->getEmojis($uriids); - $quoteshares = $this->getQuoteShares($uriids); + $emojis = $this->getEmojis($uriids); + $quoteshares = $this->getQuoteShares($uriids); + + if (!$this->config->get('system', 'legacy_activities')) { $condition = DBA::mergeConditions($condition, ["(`gravity` != ? OR `origin`)", ItemModel::GRAVITY_ACTIVITY]); } diff --git a/src/Object/Post.php b/src/Object/Post.php index 7f4b715dad..ce3781a306 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -597,6 +597,7 @@ class Post 'quoteshares' => $this->getQuoteShares($item['quoteshares']), 'reactions' => $reactions, 'responses' => $responses, + 'legacy_activities' => DI::config()->get('system', 'legacy_activities'), 'switchcomment' => DI::l10n()->t('Comment'), 'reply_label' => DI::l10n()->t('Reply to %s', $profile_name), 'comment_html' => $comment_html, diff --git a/static/defaults.config.php b/static/defaults.config.php index 3f6971dfa0..b6e26cb59b 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -290,9 +290,9 @@ return [ // restricts develop log writes to requests originating from this IP address. 'dlogip' => '', - // emoji_activities (Boolean) - // Display received activities (like, dislike, reshare) as emojis - 'emoji_activities' => false, + // legacy_activities (Boolean) + // Display received activities (like, dislike, reshare) as detailed list + 'legacy_activities' => true, // expire-notify-priority (integer) // Priority for the expiry notification @@ -520,7 +520,7 @@ return [ 'png_quality' => 8, // process_view (Boolean) - // Process the "View" activity that is used by Peertube. View activities are displayed, when "emoji_activities" are enabled. + // Process the "View" activity that is used by Peertube. 'process_view' => false, // profiler (Boolean) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 6e1668a3e3..adfbf140b5 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1988,6 +1988,10 @@ code > .hl-main { padding-left: 5px; padding-right: 5px; } +.wall-item-actions button:disabled, +button[disabled] { + color: $font_color_lighter; +} .wall-item-actions .active { font-weight: bold; color: $link_color; diff --git a/view/theme/frio/scheme/black.php b/view/theme/frio/scheme/black.php index 9305417576..bb5009f6d7 100644 --- a/view/theme/frio/scheme/black.php +++ b/view/theme/frio/scheme/black.php @@ -19,4 +19,5 @@ $background_color = '#000000'; $contentbg_transp = '0'; $font_color = '#cccccc'; $font_color_darker = '#acacac'; +$font_color_lighter = '#cdcdcd'; $background_image = ''; diff --git a/view/theme/frio/scheme/dark.php b/view/theme/frio/scheme/dark.php index eb1d3ca7bd..031a6d9614 100644 --- a/view/theme/frio/scheme/dark.php +++ b/view/theme/frio/scheme/dark.php @@ -33,4 +33,5 @@ switch ($scheme_accent) { $contentbg_transp = 4; $font_color = '#e4e4e4'; $font_color_darker = '#dcdcdc'; +$font_color_lighter = '#ababab'; $background_image = ''; diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 863a62f1e8..182f36bd0f 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -209,6 +209,7 @@ $options = [ '$login_bg_image' => $login_bg_image, '$login_bg_color' => $login_bg_color, '$font_color_darker' => $font_color_darker ?? '#222', + '$font_color_lighter' => $font_color_lighter ?? '#aaa', '$font_color' => $font_color ?? '#444', ]; diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 9f1b809eab..170b0bc3b2 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -307,49 +307,55 @@ as the value of $top_child_total (this is done at the end of this file)
{{* Button to open the comment text field *}} - {{if $item.comment_html}} + {{if $item.comment_html}} {{$item.responses.comment.total}} - - {{/if}} - {{if $item.remote_comment}} - + {{elseif $item.remote_comment}} + {{else}} + + {{/if}} - {{/if}} {{* Button for sharing the item *}} {{if $item.vote}} - {{if $item.vote.announce}} + {{if $item.vote.announce}} {{$item.responses.announce.total}} - + {{else}} + {{/if}} - {{if $item.vote.share}} + + {{if $item.vote.share}} {{$item.quoteshares.total}} - + {{else}} + {{/if}} + {{/if}} {{* Buttons for like and dislike *}} {{if $item.vote}} - {{if $item.vote.like}} + {{if $item.vote.like}} {{$item.responses.like.total}} - + {{else}} + {{/if}} - {{if $item.vote.dislike}} + + {{if $item.vote.dislike}} {{$item.responses.dislike.total}} - + {{else}} + {{/if}} - + {{foreach $item.reactions as $emoji}} {{$emoji.emoji}} {{$emoji.total}} @@ -357,6 +363,7 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} {{* Event attendance buttons *}} + {{if $item.isevent}} @@ -370,8 +377,12 @@ as the value of $top_child_total (this is done at the end of this file) {{$item.responses.attendmaybe.total}} + {{else}} + + + {{/if}} - +
+ {{if $item.drop.pagedrop}} - {{if $item.drop && $item.drop.pagedrop}} - - + {{if $item.drop}} + + {{/if}} - - + + {{/if}} +
@@ -653,12 +666,14 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} + {{if $item.drop.pagedrop}} - {{if $item.drop && $item.drop.pagedrop}} + {{if $item.drop}} {{/if}} + {{/if}}
@@ -666,7 +681,7 @@ as the value of $top_child_total (this is done at the end of this file) {{* Display likes, dislike and attendance stats *}} - {{if !$item.emojis && $item.responses}} + {{if $item.legacy_activities}}
{{foreach $item.responses as $verb=>$response}}
{{$response.output nofilter}}