From db01891f31c1cd79725f8eba624097a283f15fa8 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Tue, 14 Jul 2026 07:22:46 +0100 Subject: [PATCH] Simplify Bootstrap classes; improve markup; DRY --- app/views/notifications/_changeset_comment.html.erb | 6 ++---- app/views/notifications/_diary_comment.html.erb | 6 ++---- app/views/notifications/_gpx_import_success.html.erb | 12 +++++------- app/views/notifications/_new_follower.html.erb | 4 ++-- app/views/notifications/_note_comment.html.erb | 4 +--- .../notifications/_notification_header.html.erb | 8 ++++---- app/views/notifications/_notification_quote.html.erb | 5 +++++ 7 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 app/views/notifications/_notification_quote.html.erb diff --git a/app/views/notifications/_changeset_comment.html.erb b/app/views/notifications/_changeset_comment.html.erb index 38728466b..d441ad1c3 100644 --- a/app/views/notifications/_changeset_comment.html.erb +++ b/app/views/notifications/_changeset_comment.html.erb @@ -14,7 +14,7 @@ "notifications/notification_body", :author => record.author ) do %> -

+

<% if record.changeset.comment %> <%= t( "notifications.changeset_comment.description_with_summary_html", @@ -36,7 +36,5 @@ ) %> <% end %>

-
- <%= record.body.to_html %> -
+ <%= render "notifications/notification_quote", :body => record.body.to_html %> <% end %> diff --git a/app/views/notifications/_diary_comment.html.erb b/app/views/notifications/_diary_comment.html.erb index b1138a35b..30795b62f 100644 --- a/app/views/notifications/_diary_comment.html.erb +++ b/app/views/notifications/_diary_comment.html.erb @@ -15,7 +15,7 @@ "notifications/notification_body", :author => record.user ) do %> -

+

<%= t( "notifications.diary_comment.description_html", :commenter_name_with_link => link_to( @@ -31,7 +31,5 @@ ) ) %>

-
- <%= record.body.to_html %> -
+ <%= render "notifications/notification_quote", :body => record.body.to_html %> <% end %> diff --git a/app/views/notifications/_gpx_import_success.html.erb b/app/views/notifications/_gpx_import_success.html.erb index e1950684d..ddfd1570a 100644 --- a/app/views/notifications/_gpx_import_success.html.erb +++ b/app/views/notifications/_gpx_import_success.html.erb @@ -13,13 +13,11 @@
<% if Settings.status != "gpx_offline" %> - <% if record.inserted %> - <%= link_to trace_icon(record), - show_trace_path(record.user, record), - :class => "d-inline-block" %> - <% else %> - <%= t ".pending" %> - <% end %> + <%= link_to( + trace_icon(record), + show_trace_path(record.user, record), + :class => "d-inline-block" + ) %> <% end %>
diff --git a/app/views/notifications/_new_follower.html.erb b/app/views/notifications/_new_follower.html.erb index ff4809296..aee2a918a 100644 --- a/app/views/notifications/_new_follower.html.erb +++ b/app/views/notifications/_new_follower.html.erb @@ -10,7 +10,7 @@ "notifications/notification_body", :author => record.follower ) do %> -

+

<%= t( "notifications.new_follower.description_html", :follower_name_with_link => link_to( @@ -22,5 +22,5 @@ follow_url(record.follower) ) ) %> -

+

<% end %> diff --git a/app/views/notifications/_note_comment.html.erb b/app/views/notifications/_note_comment.html.erb index d8cdfa91b..7cb969c75 100644 --- a/app/views/notifications/_note_comment.html.erb +++ b/app/views/notifications/_note_comment.html.erb @@ -26,8 +26,6 @@ ) %>

<% if record.body.present? %> -
- <%= record.body.to_html %> -
+ <%= render "notifications/notification_quote", :body => record.body.to_html %> <% end %> <% end %> diff --git a/app/views/notifications/_notification_header.html.erb b/app/views/notifications/_notification_header.html.erb index 99bcf01b9..fceca6432 100644 --- a/app/views/notifications/_notification_header.html.erb +++ b/app/views/notifications/_notification_header.html.erb @@ -1,6 +1,6 @@ <%# locals: (title:, uri: nil, timestamp:) %> -
-

<%= link_to_if(uri, title, uri) %>

-

<%= friendly_date_ago(timestamp) %>

-
+
+

<%= link_to_if(uri, title, uri) %>

+

<%= friendly_date_ago(timestamp) %>

+
diff --git a/app/views/notifications/_notification_quote.html.erb b/app/views/notifications/_notification_quote.html.erb new file mode 100644 index 000000000..8498a4c35 --- /dev/null +++ b/app/views/notifications/_notification_quote.html.erb @@ -0,0 +1,5 @@ +<%# locals: (body: nil) %> + +
+ <%= body %> +
-- 2.47.3