Add a proper title to moderation index pages
Since this is already a component, we can use the `header` method without much refactoring.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<h2><%= t("moderation.#{i18n_namespace}.index.title") %></h2>
|
<%= header %>
|
||||||
|
|
||||||
<%= render "shared/filter_subnav", i18n_namespace: "moderation.#{i18n_namespace}.index" %>
|
<%= render "shared/filter_subnav", i18n_namespace: "moderation.#{i18n_namespace}.index" %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
class Moderation::Shared::IndexComponent < ApplicationComponent
|
class Moderation::Shared::IndexComponent < ApplicationComponent
|
||||||
|
include Header
|
||||||
attr_reader :records
|
attr_reader :records
|
||||||
|
|
||||||
def initialize(records)
|
def initialize(records)
|
||||||
@@ -7,6 +8,10 @@ class Moderation::Shared::IndexComponent < ApplicationComponent
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def title
|
||||||
|
t("moderation.#{i18n_namespace}.index.title")
|
||||||
|
end
|
||||||
|
|
||||||
def i18n_namespace
|
def i18n_namespace
|
||||||
table_name
|
table_name
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% provide :main_class, "moderation-users-index" %>
|
<% provide :main_class, "moderation-users-index" %>
|
||||||
|
|
||||||
<h2><%= t("moderation.users.index.title") %></h2>
|
<%= header %>
|
||||||
|
|
||||||
<%= render Admin::SearchComponent.new(label: t("moderation.users.index.search_placeholder")) %>
|
<%= render Admin::SearchComponent.new(label: t("moderation.users.index.search_placeholder")) %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
class Moderation::Users::IndexComponent < ApplicationComponent
|
class Moderation::Users::IndexComponent < ApplicationComponent
|
||||||
|
include Header
|
||||||
attr_reader :users
|
attr_reader :users
|
||||||
|
|
||||||
def initialize(users)
|
def initialize(users)
|
||||||
@@ -7,6 +8,10 @@ class Moderation::Users::IndexComponent < ApplicationComponent
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def title
|
||||||
|
t("moderation.users.index.title")
|
||||||
|
end
|
||||||
|
|
||||||
def status(user)
|
def status(user)
|
||||||
t("admin.activity.show.actions.#{activity_action(user)}")
|
t("admin.activity.show.actions.#{activity_action(user)}")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user