diff --git a/dist/treebird.css b/dist/treebird.css index 950ff59..f76ad11 100644 --- a/dist/treebird.css +++ b/dist/treebird.css @@ -1104,6 +1104,50 @@ input[type=checkbox].hidden:not(:checked) + .reply-form min-width: 0; } +/* Compact notifications (statuses) */ +.notifications-compact, +.status-compact +{ + position: relative; + font-size: 14px; +} + +.status-compact .status.status-notification +{ + padding: 7px; +} + +.status-compact .pfp-td img +{ + width: 28px; + height: 28px; +} + +.status-compact .action-icon +{ + position: absolute; + background-color: #eaecf0; + border-radius: 50%; + width: 14px; + height: 14px; + border: 1px solid #cacaca; + padding: 3px; + top: 17px; + left: -17px; + z-index: 8; + font-size: 12px; +} + +.status-compact .action-icon svg +{ + width: 14px; + height: 14px; + stroke: #40455a; + /* Little fix */ + position: relative; + top: -1px; +} + /* .status .notification-text-group-with-icon .username */ /* { */ /* /\* UNDO *\/ */ diff --git a/perl/status.pm b/perl/status.pm index 2c0c8cd..091b4ab 100644 --- a/perl/status.pm +++ b/perl/status.pm @@ -29,6 +29,8 @@ sub generate_status $status = $status->{reblog}; } + my $is_statusey_notif = ($notif && ($notif->{type} eq 'mention' || $notif->{type} eq 'status')); + my %vars = ( prefix => '', ssn => $ssn, @@ -37,9 +39,26 @@ sub generate_status data => $data, notif => $notif, # May be undef compact => $is_compact, # May be undef - is_statusey_notif => ($notif && ($notif->{type} eq 'mention' || $notif->{type} eq 'status')), + is_statusey_notif => $is_statusey_notif, unique_toggle_id => $rel_context++, + interacted_with => $boost_acct || ($notif && !$is_statusey_notif), + # Functions + + action_to_string => sub { + return unless $notif; + return lang('NOTIF_LIKED') if $notif->{type} eq 'favourite'; + return lang('NOTIF_REPEATED') if $boost_acct || $notif->{type} eq 'reblog'; + return lang('NOTIF_REACTED_WITH') .' '. $notif->{emoji} if $boost_acct || $notif->{type} eq 'emoji reaction'; + }, + + action_to_icon => sub { + return unless $notif; + return get_icon('like') if $notif->{type} eq 'favourite'; + return get_icon('repeat') if $boost_acct || $notif->{type} eq 'reblog'; + return $notif->{emoji} if $notif->{type} eq 'emoji reaction'; + }, + icon => \&get_icon, lang => \&lang, rel_to_str => \&reltime_to_str, diff --git a/templates/main.tt b/templates/main.tt index 49db8c2..d4891cb 100644 --- a/templates/main.tt +++ b/templates/main.tt @@ -171,7 +171,7 @@