Skip to content

Commit da6bacf

Browse files
author
jamesprior
committed
browsermedia#665 do not show remove button for sections that cannot be removed from sitemap
1 parent 3fadcb9 commit da6bacf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/models/cms/section_node.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def page?
7878
def link?
7979
node_type == 'Cms::Link'
8080
end
81+
82+
def deletable?
83+
!self.root? && (!section? || node.deletable?)
84+
end
8185

8286
# @param [Section] section
8387
# @param [Integer] position

app/views/cms/section_nodes/_row_buttons.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<!--<li><%= link_to("Hide", "#", class: 'add-link') unless section_node.root? %></li>-->
88
<li><%= link_to 'Remove', engine_aware_path(section_node.node),
99
class: 'add-link http_delete confirm_with_title',
10-
title: "Are you sure you want to remove #{section_node.node.name}?" unless section_node.root? %></li>
10+
title: "Are you sure you want to remove #{section_node.node.name}?" if section_node.deletable? %></li>
1111
</ul>

0 commit comments

Comments
 (0)