]> git.openstreetmap.org Git - rails.git/commitdiff
Add tabbed navigation to user's diary comments page
authorAnton Khorev <tony29@yandex.ru>
Sat, 18 Jan 2025 23:58:56 +0000 (02:58 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 19 Jan 2025 01:24:35 +0000 (04:24 +0300)
app/views/users/diary_comments/index.html.erb
config/locales/en.yml
test/controllers/users/diary_comments_controller_test.rb

index e68b3fb6b9ba58773080a06fbb3359441323eaad..9bd23df317bf9211cc02e2a8caec96819b327d8b 100644 (file)
@@ -1,6 +1,12 @@
+<% content_for :heading_class, "pb-0" %>
+
 <% content_for :heading do %>
-  <h1><%= t ".heading", :user => @user.display_name %></h1>
-  <p><%= t ".subheading_html", :user => link_to(@user.display_name, @user) %></p>
+  <h1><%= t ".heading_html", :user => link_to(@user.display_name, @user) %></h1>
+  <ul class="nav nav-tabs">
+    <li class="nav-item">
+      <a class="nav-link active"><%= t ".diary_entries" %></a>
+    </li>
+  </ul>
 <% end %>
 
 <% if @comments.empty? %>
index 4e2923ee6e8deda42f7e758d020ca1b02d870491..747c23c83bc235ba327184d69ec46aceeb4329cb 100644 (file)
@@ -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
index 0145153e55bda4695dc478ca6f76c0e2ec2c4070..372cc32821d9402af328898c243600d1c9a32a32 100644 (file)
@@ -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)