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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'app/helpers/mokio/backend/breadcrumbs_helper.rb', line 6
def breadcrumbs
html = "<li>#{breadcrumbs_arrow}</li>"
t = 'backend.breadcrumbs'
route = "#{engine_root}"
unless (controller.breadcrumbs_prefix.blank?)
html << '<li>'
if (controller.breadcrumbs_prefix_link.blank?)
html << "#{I18n.t("#{t}.#{controller.breadcrumbs_prefix}")}"
else
html << "<a href='#{route}#{controller.breadcrumbs_prefix_link}'>#{I18n.t("#{t}.#{controller.breadcrumbs_prefix}")}</a>"
end
html << '</li>'
html << "<li>#{breadcrumbs_arrow}</li>"
end
if (controller_name != 'contents' || (controller_name == 'contents' && obj.nil?)) && (!defined?(obj) || obj.blank?) html << "<li>#{I18n.t("#{t}.#{controller_name}")}</li>"
else
html << "<li><a href='#{route}#{controller_name}'>#{I18n.t("#{t}.#{controller_name}")}</a></li>"
end
if (controller_name == 'contents') && !obj.nil? html << "<li>#{breadcrumbs_arrow}</li>"
index_link = obj.class.to_s.demodulize.tableize
html << "<li><a href='#{route}#{index_link}'>#{I18n.t("#{t}.#{index_link}")}</a></li>"
end
if defined?(obj) && obj.present?
html << "<li>#{breadcrumbs_arrow}</li>"
html << breadcrumbs_obj_title(I18n.t("#{t}.#{controller.action_name}"))
elsif controller.action_name != "index" && controller_name != 'dashboard'
html << "<li>#{breadcrumbs_arrow}</li>"
html << I18n.t("#{t}.#{controller.action_name}")
end
html.html_safe
end
|