From: Anton Khorev Date: Sat, 18 Jan 2025 23:58:56 +0000 (+0300) Subject: Add tabbed navigation to user's diary comments page X-Git-Tag: live~264^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/43d60108daf5f097b81afd2200273713e244b9b7?ds=inline;hp=-c Add tabbed navigation to user's diary comments page --- 43d60108daf5f097b81afd2200273713e244b9b7 diff --git a/app/views/users/diary_comments/index.html.erb b/app/views/users/diary_comments/index.html.erb index e68b3fb6b..9bd23df31 100644 --- a/app/views/users/diary_comments/index.html.erb +++ b/app/views/users/diary_comments/index.html.erb @@ -1,6 +1,12 @@ +<% content_for :heading_class, "pb-0" %> + <% content_for :heading do %> -

<%= t ".heading", :user => @user.display_name %>

-

<%= t ".subheading_html", :user => link_to(@user.display_name, @user) %>

+

<%= t ".heading_html", :user => link_to(@user.display_name, @user) %>

+ <% end %> <% if @comments.empty? %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4e2923ee6..747c23c83 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2875,9 +2875,9 @@ en: diary_comments: index: title: "Diary Comments added by %{user}" - heading: "%{user}'s Diary Comments" - subheading_html: "Diary Comments added by %{user}" - no_comments: "No diary comments" + heading_html: "%{user}'s Comments" + diary_entries: "Diary entries" + no_comments: "No comments" page: post: Post when: When diff --git a/test/controllers/users/diary_comments_controller_test.rb b/test/controllers/users/diary_comments_controller_test.rb index 0145153e5..372cc3282 100644 --- a/test/controllers/users/diary_comments_controller_test.rb +++ b/test/controllers/users/diary_comments_controller_test.rb @@ -33,7 +33,7 @@ module Users get user_diary_comments_path(user) assert_response :success assert_template :index - assert_select "h4", :html => "No diary comments" + assert_select "h4", :html => "No comments" # Test a user with a comment create(:diary_comment, :user => other_user)