Sha256: 6c40a54c669f7209a11fa4b62a35f0b39d2a6310df3670d230cf4bc486787d0e
Contents?: true
Size: 833 Bytes
Versions: 10
Compression:
Stored size: 833 Bytes
Contents
module Cms::PagesHelper def layouts_for_page(page) page.new_record? ? @context.pages.layouts : @context.pages.layouts.reject{|pg| pg == page} end def delete_page_link(page) options = {:method => :delete, :confirm => "Are you sure you want to delete the \"#{page}\" page?"} # use a remote link if there are no children since if we remove the current page list item, all the children items get removed (in the UI) as well # it's easier to just remove the item otherwise with a normal post and refresh the page if page.content_pages.empty? link_to cms_icon('delete.png', :title => 'Delete'), cms_page_path(page), {:remote => true, :indicator => dom_id(page, 'progress')}.merge(options) else link_to cms_icon('delete.png', :title => 'Delete'), cms_page_path(page), options end end end
Version data entries
10 entries across 10 versions & 1 rubygems