]> git.openstreetmap.org Git - rails.git/commitdiff
Create user comments controller base class
authorAnton Khorev <tony29@yandex.ru>
Sun, 19 Jan 2025 00:30:18 +0000 (03:30 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 19 Jan 2025 01:24:35 +0000 (04:24 +0300)
app/controllers/users/comments_controller.rb [new file with mode: 0644]
app/controllers/users/diary_comments_controller.rb
app/views/users/comments/index.html.erb [moved from app/views/users/diary_comments/index.html.erb with 100% similarity]
config/locales/en.yml

diff --git a/app/controllers/users/comments_controller.rb b/app/controllers/users/comments_controller.rb
new file mode 100644 (file)
index 0000000..06d2d7f
--- /dev/null
@@ -0,0 +1,18 @@
+module Users
+  class CommentsController < ApplicationController
+    include UserMethods
+    include PaginationMethods
+
+    layout "site"
+
+    before_action :authorize_web
+    before_action :set_locale
+    before_action :check_database_readable
+
+    authorize_resource
+
+    before_action :lookup_user
+
+    allow_thirdparty_images
+  end
+end
index 5e6a552027376201866cbac59e28f43de8d94b54..8f41e509f365a59fa17c078b19fc513ce843105b 100644 (file)
@@ -1,20 +1,5 @@
 module Users
-  class DiaryCommentsController < ApplicationController
-    include UserMethods
-    include PaginationMethods
-
-    layout "site"
-
-    before_action :authorize_web
-    before_action :set_locale
-    before_action :check_database_readable
-
-    authorize_resource
-
-    before_action :lookup_user
-
-    allow_thirdparty_images
-
+  class DiaryCommentsController < CommentsController
     def index
       @title = t ".title", :user => @user.display_name
 
index 747c23c83bc235ba327184d69ec46aceeb4329cb..247416b7dad41d241665adb291a87cb44cb070a7 100644 (file)
@@ -2872,12 +2872,14 @@ en:
       user:
         summary_html: "%{name} created from %{ip_address} on %{date}"
         summary_no_ip_html: "%{name} created on %{date}"
-    diary_comments:
+    comments:
       index:
-        title: "Diary Comments added by %{user}"
         heading_html: "%{user}'s Comments"
         diary_entries: "Diary entries"
         no_comments: "No comments"
+    diary_comments:
+      index:
+        title: "Diary Comments added by %{user}"
       page:
         post: Post
         when: When