Merge pull request #13618 from annando/display

Frio: Improved display of disabled activities
This commit is contained in:
Hypolite Petovan 2023-11-07 14:09:13 -08:00 committed by GitHub
commit a1b5ec94fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 30 deletions

View File

@ -889,9 +889,10 @@ class Conversation
$condition['author-hidden'] = false; $condition['author-hidden'] = false;
} }
if ($this->config->get('system', 'emoji_activities')) {
$emojis = $this->getEmojis($uriids); $emojis = $this->getEmojis($uriids);
$quoteshares = $this->getQuoteShares($uriids); $quoteshares = $this->getQuoteShares($uriids);
if (!$this->config->get('system', 'legacy_activities')) {
$condition = DBA::mergeConditions($condition, ["(`gravity` != ? OR `origin`)", ItemModel::GRAVITY_ACTIVITY]); $condition = DBA::mergeConditions($condition, ["(`gravity` != ? OR `origin`)", ItemModel::GRAVITY_ACTIVITY]);
} }

View File

@ -597,6 +597,7 @@ class Post
'quoteshares' => $this->getQuoteShares($item['quoteshares']), 'quoteshares' => $this->getQuoteShares($item['quoteshares']),
'reactions' => $reactions, 'reactions' => $reactions,
'responses' => $responses, 'responses' => $responses,
'legacy_activities' => DI::config()->get('system', 'legacy_activities'),
'switchcomment' => DI::l10n()->t('Comment'), 'switchcomment' => DI::l10n()->t('Comment'),
'reply_label' => DI::l10n()->t('Reply to %s', $profile_name), 'reply_label' => DI::l10n()->t('Reply to %s', $profile_name),
'comment_html' => $comment_html, 'comment_html' => $comment_html,

View File

@ -290,9 +290,9 @@ return [
// restricts develop log writes to requests originating from this IP address. // restricts develop log writes to requests originating from this IP address.
'dlogip' => '', 'dlogip' => '',
// emoji_activities (Boolean) // legacy_activities (Boolean)
// Display received activities (like, dislike, reshare) as emojis // Display received activities (like, dislike, reshare) as detailed list
'emoji_activities' => false, 'legacy_activities' => true,
// expire-notify-priority (integer) // expire-notify-priority (integer)
// Priority for the expiry notification // Priority for the expiry notification
@ -520,7 +520,7 @@ return [
'png_quality' => 8, 'png_quality' => 8,
// process_view (Boolean) // 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, 'process_view' => false,
// profiler (Boolean) // profiler (Boolean)

View File

@ -1988,6 +1988,10 @@ code > .hl-main {
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
.wall-item-actions button:disabled,
button[disabled] {
color: $font_color_lighter;
}
.wall-item-actions .active { .wall-item-actions .active {
font-weight: bold; font-weight: bold;
color: $link_color; color: $link_color;

View File

@ -19,4 +19,5 @@ $background_color = '#000000';
$contentbg_transp = '0'; $contentbg_transp = '0';
$font_color = '#cccccc'; $font_color = '#cccccc';
$font_color_darker = '#acacac'; $font_color_darker = '#acacac';
$font_color_lighter = '#cdcdcd';
$background_image = ''; $background_image = '';

View File

@ -33,4 +33,5 @@ switch ($scheme_accent) {
$contentbg_transp = 4; $contentbg_transp = 4;
$font_color = '#e4e4e4'; $font_color = '#e4e4e4';
$font_color_darker = '#dcdcdc'; $font_color_darker = '#dcdcdc';
$font_color_lighter = '#ababab';
$background_image = ''; $background_image = '';

View File

@ -209,6 +209,7 @@ $options = [
'$login_bg_image' => $login_bg_image, '$login_bg_image' => $login_bg_image,
'$login_bg_color' => $login_bg_color, '$login_bg_color' => $login_bg_color,
'$font_color_darker' => $font_color_darker ?? '#222', '$font_color_darker' => $font_color_darker ?? '#222',
'$font_color_lighter' => $font_color_lighter ?? '#aaa',
'$font_color' => $font_color ?? '#444', '$font_color' => $font_color ?? '#444',
]; ];

View File

@ -307,49 +307,55 @@ as the value of $top_child_total (this is done at the end of this file)
<div class="wall-item-actions-row"> <div class="wall-item-actions-row">
{{* Button to open the comment text field *}} {{* Button to open the comment text field *}}
{{if $item.comment_html}}
<span class="wall-item-response"> <span class="wall-item-response">
{{if $item.comment_html}}
<button type="button" class="btn-link button-comments" id="comment-{{$item.id}}" title="{{$item.switchcomment}}" {{if $item.thread_level != 1}}onclick="openClose('item-comments-{{$item.id}}'); commentExpand({{$item.id}});" {{else}} onclick="openClose('item-comments-{{$item.id}}'); commentExpand({{$item.id}});"{{/if}}><i class="fa fa-commenting" aria-hidden="true"></i></button> <button type="button" class="btn-link button-comments" id="comment-{{$item.id}}" title="{{$item.switchcomment}}" {{if $item.thread_level != 1}}onclick="openClose('item-comments-{{$item.id}}'); commentExpand({{$item.id}});" {{else}} onclick="openClose('item-comments-{{$item.id}}'); commentExpand({{$item.id}});"{{/if}}><i class="fa fa-commenting" aria-hidden="true"></i></button>
<span title="{{$item.responses.comment.title}}">{{$item.responses.comment.total}}</span> <span title="{{$item.responses.comment.title}}">{{$item.responses.comment.total}}</span>
</span> {{elseif $item.remote_comment}}
{{/if}}
{{if $item.remote_comment}}
<span class="wall-item-response">
<a href="{{$item.remote_comment.2}}" class="btn-link button-comments" title="{{$item.remote_comment.0}}"><i class="fa fa-commenting" aria-hidden="true"></i></a> <a href="{{$item.remote_comment.2}}" class="btn-link button-comments" title="{{$item.remote_comment.0}}"><i class="fa fa-commenting" aria-hidden="true"></i></a>
</span> {{else}}
<button type="button" class="btn-link button-comments" id="comment-{{$item.id}}" title="{{$item.switchcomment}}" disabled><i class="fa fa-commenting-o" aria-hidden="true"></i></button>
{{/if}} {{/if}}
</span>
{{* Button for sharing the item *}} {{* Button for sharing the item *}}
{{if $item.vote}} {{if $item.vote}}
{{if $item.vote.announce}}
<span class="wall-item-response"> <span class="wall-item-response">
{{if $item.vote.announce}}
<button type="button" class="btn-link button-announces{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doActivityItemAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" ><i class="fa fa-retweet" aria-hidden="true"></i></button> <button type="button" class="btn-link button-announces{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doActivityItemAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" ><i class="fa fa-retweet" aria-hidden="true"></i></button>
<span title="{{$item.responses.announce.title}}">{{$item.responses.announce.total}}</span> <span title="{{$item.responses.announce.title}}">{{$item.responses.announce.total}}</span>
</span> {{else}}
<button type="button" class="btn-link button-announces" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" disabled><i class="fa fa-retweet" aria-hidden="true"></i></button>
{{/if}} {{/if}}
{{if $item.vote.share}} </span>
<span class="wall-item-response"> <span class="wall-item-response">
{{if $item.vote.share}}
<button type="button" class="btn-link button-votes" id="share-{{$item.id}}" title="{{$item.vote.share.0}}" onclick="jotShare({{$item.id}});"><i class="fa fa-share" aria-hidden="true"></i></button> <button type="button" class="btn-link button-votes" id="share-{{$item.id}}" title="{{$item.vote.share.0}}" onclick="jotShare({{$item.id}});"><i class="fa fa-share" aria-hidden="true"></i></button>
<span title="{{$item.quoteshares.title}}">{{$item.quoteshares.total}}</span> <span title="{{$item.quoteshares.title}}">{{$item.quoteshares.total}}</span>
</span> {{else}}
<button type="button" class="btn-link button-votes" id="share-{{$item.id}}" title="{{$item.vote.share.0}}" disabled><i class="fa fa-share" aria-hidden="true"></i></button>
{{/if}} {{/if}}
</span>
{{/if}} {{/if}}
{{* Buttons for like and dislike *}} {{* Buttons for like and dislike *}}
{{if $item.vote}} {{if $item.vote}}
{{if $item.vote.like}}
<span class="wall-item-response"> <span class="wall-item-response">
{{if $item.vote.like}}
<button type="button" class="btn-link button-likes{{if $item.responses.like.self}} active" aria-pressed="true{{/if}}" id="like-{{$item.id}}" title="{{$item.vote.like.0}}" onclick="doActivityItemAction({{$item.id}}, 'like'{{if $item.responses.like.self}}, true{{/if}});" ><i class="fa fa-thumbs-up" aria-hidden="true"></i></button> <button type="button" class="btn-link button-likes{{if $item.responses.like.self}} active" aria-pressed="true{{/if}}" id="like-{{$item.id}}" title="{{$item.vote.like.0}}" onclick="doActivityItemAction({{$item.id}}, 'like'{{if $item.responses.like.self}}, true{{/if}});" ><i class="fa fa-thumbs-up" aria-hidden="true"></i></button>
<span title="{{$item.responses.like.title}}">{{$item.responses.like.total}}</span> <span title="{{$item.responses.like.title}}">{{$item.responses.like.total}}</span>
</span> {{else}}
<button type="button" class="btn-link button-likes" id="like-{{$item.id}}" title="{{$item.vote.like.0}}" disabled><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
{{/if}} {{/if}}
{{if $item.vote.dislike}} </span>
<span class="wall-item-response"> <span class="wall-item-response">
{{if $item.vote.dislike}}
<button type="button" class="btn-link button-likes{{if $item.responses.dislike.self}} active" aria-pressed="true{{/if}}" id="dislike-{{$item.id}}" title="{{$item.vote.dislike.0}}" onclick="doActivityItemAction({{$item.id}}, 'dislike'{{if $item.responses.dislike.self}}, true{{/if}});" ><i class="fa fa-thumbs-down" aria-hidden="true"></i></button> <button type="button" class="btn-link button-likes{{if $item.responses.dislike.self}} active" aria-pressed="true{{/if}}" id="dislike-{{$item.id}}" title="{{$item.vote.dislike.0}}" onclick="doActivityItemAction({{$item.id}}, 'dislike'{{if $item.responses.dislike.self}}, true{{/if}});" ><i class="fa fa-thumbs-down" aria-hidden="true"></i></button>
<span title="{{$item.responses.dislike.title}}">{{$item.responses.dislike.total}}</span> <span title="{{$item.responses.dislike.title}}">{{$item.responses.dislike.total}}</span>
</span> {{else}}
<button type="button" class="btn-link button-likes" id="dislike-{{$item.id}}" title="{{$item.vote.dislike.0}}" disabled><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
{{/if}} {{/if}}
</span>
{{foreach $item.reactions as $emoji}} {{foreach $item.reactions as $emoji}}
<span class="wall-item-emoji" title="{{$emoji.title}}">{{$emoji.emoji}} {{$emoji.total}}</span> <span class="wall-item-emoji" title="{{$emoji.title}}">{{$emoji.emoji}} {{$emoji.total}}</span>
@ -357,6 +363,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} {{/if}}
{{* Event attendance buttons *}} {{* Event attendance buttons *}}
<span class="vote-event">
{{if $item.isevent}} {{if $item.isevent}}
<span class="wall-item-response"> <span class="wall-item-response">
<button type="button" class="btn-link button-event{{if $item.responses.attendyes.self}} active" aria-pressed="true{{/if}}" id="attendyes-{{$item.id}}" title="{{$item.attend.0}}" onclick="doActivityItemAction({{$item.id}}, 'attendyes'{{if $item.responses.attendyes.self}}, true{{/if}});"><i class="fa fa-check" aria-hidden="true"><span class="sr-only">{{$item.attend.0}}</span></i></button> <button type="button" class="btn-link button-event{{if $item.responses.attendyes.self}} active" aria-pressed="true{{/if}}" id="attendyes-{{$item.id}}" title="{{$item.attend.0}}" onclick="doActivityItemAction({{$item.id}}, 'attendyes'{{if $item.responses.attendyes.self}}, true{{/if}});"><i class="fa fa-check" aria-hidden="true"><span class="sr-only">{{$item.attend.0}}</span></i></button>
@ -370,8 +377,12 @@ as the value of $top_child_total (this is done at the end of this file)
<button type="button" class="btn-link button-event{{if $item.responses.attendmaybe.self}} active" aria-pressed="true{{/if}}" id="attendmaybe-{{$item.id}}" title="{{$item.attend.2}}" onclick="doActivityItemAction({{$item.id}}, 'attendmaybe'{{if $item.responses.attendmaybe.self}}, true{{/if}});"><i class="fa fa-question" aria-hidden="true"><span class="sr-only">{{$item.attend.2}}</span></i></button> <button type="button" class="btn-link button-event{{if $item.responses.attendmaybe.self}} active" aria-pressed="true{{/if}}" id="attendmaybe-{{$item.id}}" title="{{$item.attend.2}}" onclick="doActivityItemAction({{$item.id}}, 'attendmaybe'{{if $item.responses.attendmaybe.self}}, true{{/if}});"><i class="fa fa-question" aria-hidden="true"><span class="sr-only">{{$item.attend.2}}</span></i></button>
<span title="{{$item.responses.attendmaybe.title}}">{{$item.responses.attendmaybe.total}}</span> <span title="{{$item.responses.attendmaybe.title}}">{{$item.responses.attendmaybe.total}}</span>
</span> </span>
{{else}}
<span class="wall-item-response"></span>
<span class="wall-item-response"></span>
<span class="wall-item-response"></span>
{{/if}} {{/if}}
</span>
</div> </div>
</div> </div>
<span class="wall-item-actions-right hidden-xs"> <span class="wall-item-actions-right hidden-xs">
@ -475,12 +486,14 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} {{/if}}
</ul> </ul>
</span> </span>
{{if $item.drop.pagedrop}}
<span class="pull-right checkbox"> <span class="pull-right checkbox">
{{if $item.drop && $item.drop.pagedrop}} {{if $item.drop}}
<input type="checkbox" title="{{$item.drop.select}}" name="itemselected[]" id="checkbox-{{$item.id}}" class="item-select" value="{{$item.id}}" /> <input type="checkbox" title="{{$item.drop.select}}" name="itemselected[]" id="checkbox-{{$item.id}}" class="item-select" value="{{$item.id}}" />
<label for="checkbox-{{$item.id}}"></label> <label for="checkbox-{{$item.id}}"></label>
{{/if}} {{/if}}
</span> </span>
{{/if}}
</span> </span>
<div class="wall-item-actions-items btn-toolbar btn-group visible-xs" role="group"> <div class="wall-item-actions-items btn-toolbar btn-group visible-xs" role="group">
@ -653,12 +666,14 @@ as the value of $top_child_total (this is done at the end of this file)
</ul> </ul>
</div> </div>
{{/if}} {{/if}}
{{if $item.drop.pagedrop}}
<span class="pull-right checkbox"> <span class="pull-right checkbox">
{{if $item.drop && $item.drop.pagedrop}} {{if $item.drop}}
<input type="checkbox" title="{{$item.drop.select}}" name="itemselected[]" id="checkbox-{{$item.id}}" class="item-select" value="{{$item.id}}" /> <input type="checkbox" title="{{$item.drop.select}}" name="itemselected[]" id="checkbox-{{$item.id}}" class="item-select" value="{{$item.id}}" />
<label for="checkbox-{{$item.id}}"></label> <label for="checkbox-{{$item.id}}"></label>
{{/if}} {{/if}}
</span> </span>
{{/if}}
</div> </div>
</div> </div>
</div><!--./wall-item-actions--> </div><!--./wall-item-actions-->
@ -666,7 +681,7 @@ as the value of $top_child_total (this is done at the end of this file)
<div class="wall-item-links"></div> <div class="wall-item-links"></div>
{{* Display likes, dislike and attendance stats *}} {{* Display likes, dislike and attendance stats *}}
{{if !$item.emojis && $item.responses}} {{if $item.legacy_activities}}
<div class="wall-item-responses"> <div class="wall-item-responses">
{{foreach $item.responses as $verb=>$response}} {{foreach $item.responses as $verb=>$response}}
<div class="wall-item-{{$verb}}" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.output nofilter}}</div> <div class="wall-item-{{$verb}}" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.output nofilter}}</div>