6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/ifd_tools/active_admin/dashboard/contact_requests.rb', line 6
def self.included(dsl)
index_page_presenter = dsl.config.get_page_presenter(:index) || ::ActiveAdmin::PagePresenter.new(title: proc { I18n.t("active_admin.dashboard") })
dsl.content(title: index_page_presenter[:title]) do
instance_exec &index_page_presenter.block if index_page_presenter.block.present?
columns do
column do
panel "Recent Contact Requests" do
table_for ::IfdTools::ContactRequest.unread.limit(20) do
column(:name) { |cr| link_to truncate(cr.to_s, length: 35), [:admin, cr] }
column(:email) { |cr| mail_to cr.email, cr.email }
column(:phone) { |cr| number_to_phone cr.phone, area_code: true }
end
end
end
instance_exec &index_page_presenter[:additional_content] if index_page_presenter[:additional_content].present?
end
end
end
|