Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1969787
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 17, 10:49 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, May 19, 10:49 AM (20 h, 26 m)
Engine
blob
Format
Raw Data
Handle
385250
Attached To
rWEBDNS WebDNS (edet4)
View Options
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 0727ae7..84d4997 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -1,56 +1,56 @@
module BreadcrumbHelper
# Domain
# Domain / group / example.com
# Domain / group / example.com / ns1.example.com IN A
# Domain / group / example.com / new
def breadcrumbs(leaf)
crumbs = generate_crumbs_for(leaf)
crumbs.each { |c|
# Last element should not be a link
if c == crumbs.last || c[:link].nil?
yield c[:name]
else
yield link_to(c[:name], c[:link])
end
}
end
private
# rubocop:disable all
def generate_crumbs_for(leaf)
stack = []
crumbs = []
stack.push leaf if leaf
while crumb = stack.pop # rubocop:disable Lint/AssignmentInCondition
case crumb
when Record
if crumb.persisted?
crumbs.push(
name: "#{crumb.name} IN #{crumb.type}",
link: domain_record_path(crumb.domain_id, crumb))
else
crumbs.push(name: :new)
end
stack.push crumb.domain
when Domain
if crumb.persisted?
crumbs.push(name: crumb.name, link: domain_path(crumb))
else
crumbs.push(name: :new)
end
stack.push crumb.group
when Group
crumbs.push(name: crumb.name, link: group_path(crumb))
end
end
- crumbs.push(name: 'Domains', link: '/')
+ crumbs.push(name: glyph(:home), link: '/')
crumbs.reverse
end
# rubocop:enable all
end
Event Timeline
Log In to Comment