From 0faf544ebb27719f77602f5cc66da1ce27df340f Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Tue, 25 Oct 2022 16:27:59 +0300 Subject: [PATCH] Add reply to and edited at headers --- .../web/static_fe/static_fe_controller.ex | 5 +- .../static_fe/static_fe/_notice.html.eex | 76 ++++++++++++------- priv/static/static-fe/static-fe.css | 35 +++++++-- 3 files changed, 82 insertions(+), 34 deletions(-) diff --git a/lib/pleroma/web/static_fe/static_fe_controller.ex b/lib/pleroma/web/static_fe/static_fe_controller.ex index d15b1eac2..3b4826981 100644 --- a/lib/pleroma/web/static_fe/static_fe_controller.ex +++ b/lib/pleroma/web/static_fe/static_fe_controller.ex @@ -161,7 +161,10 @@ defp represent(%Activity{object: %Object{data: data}} = activity, selected) do selected: selected, counts: get_counts(activity), id: activity.id, - visibility: Visibility.get_visibility(activity.object) + visibility: Visibility.get_visibility(activity.object), + reply_to: data["inReplyTo"], + reply_to_user: data["inReplyTo"] && CommonAPI.get_user(hd(data["to"])), + edited_at: data["updated"] } end diff --git a/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex index 70780b9ff..93a6a5c36 100644 --- a/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex +++ b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex @@ -12,35 +12,57 @@
-
-

- <%= raw Formatter.emojify(@user.name, @user.emoji) %> -

- +
+
+

+ <%= raw Formatter.emojify(@user.name, @user.emoji) %> +

+ +
+
+ + + + <%= if @visibility == "public" do %> + + + + <% else %> + <%= if @visibility == "unlisted" do %> + + + + <% end %> + <% end %> +
-
- - - - <%= if @visibility == "public" do %> - - - - <% else %> - <%= if @visibility == "unlisted" do %> - - - - <% end %> - <% end %> + <%= if @reply_to do %> + + <% end %> + <%= if @edited_at do %> +
+ Edited <%= time_ago(@edited_at) %> +
+ <% end %>
<%= if @title != "" do %> diff --git a/priv/static/static-fe/static-fe.css b/priv/static/static-fe/static-fe.css index 785dad3bb..008907ea8 100644 --- a/priv/static/static-fe/static-fe.css +++ b/priv/static/static-fe/static-fe.css @@ -157,12 +157,21 @@ .right-side { } .status-heading { - display: flex; margin-bottom: 0.5em; - justify-content: space-between; line-height: 1.3; } +.heading-name-row { + display: flex; + justify-content: space-between; +} + +.heading-edited-row, +.heading-reply-row { + font-size: 0.85em; + margin-top: 0.2em; +} + .status-heading a { display: inline-block; word-break: break-all; @@ -177,7 +186,7 @@ .heading-right { align-items: center; } -.status-container .account-name { +.heading-name-row .account-name { min-width: 1.6em; margin-right: 0.4em; white-space: nowrap; @@ -186,7 +195,7 @@ .status-container .account-name { flex: 1 1 0; } -.status-container .username { +.heading-name-row .username { white-space: nowrap; overflow: hidden; max-width: 85%; @@ -457,8 +466,7 @@ .attachment:not(:last-child) { .fa-icon { height: 0.875em; - margin-left: 0.5em; - margin-right: 0.3em; + margin: 0 0.3em; fill: var(--icon); } @@ -466,6 +474,14 @@ .status-actions .fa-icon { height: 1.1em; } +.user-summary .fa-icon { + margin-left: 0.5em; +} + +.reply-to-link .fa-icon { + transform: scale(-1, 1); +} + .nsfw-banner { position: absolute; height: 100%; @@ -483,3 +499,10 @@ .nsfw-banner:not(:hover) { .nsfw-banner:hover div { display: none; } + +.reply-to-link { + color: var(--faint); +} +.reply-to-link:hover { + text-decoration: underline; +}