Add mongoid-tree to Item

This commit is contained in:
Christophe Vilayphiou committed 2012-05-11 16:16:09 +08:00
1 parent fd52d00187
commit 6a443f0976
13 files changed
+60 -95

No files matched your search

+4 -17
View File
@@ -8,9 +8,9 @@ module Admin::ItemHelper
dest = admin_page_path(node)
when 'Link'
dest = admin_link_path(node)
no_nested = 'no-nest'
end
# ret << "<ol>" unless node.parent.nil?
ret << "<li id='#{node.id}'>"
ret << "<li id='#{node.id}' class='#{no_nested}'>"
ret << "<div class='with_action'>"
ret << (link_to node.i18n_variable[I18n.locale], dest)
ret << "<div class='quick-edit hide'>"
@@ -22,14 +22,13 @@ module Admin::ItemHelper
ret << "</div>"
ret << render_children(node)
ret << "</li>"
# ret << "</ol>" unless node.parent.nil?
end
ret.html_safe
end
def render_children(parent)
children = parent.ordered_children
if !children.entries.blank?
children = parent.children
if !parent.children.entries.blank?
ret = ''
ret << "<ol class='#{'sortable' if parent.parent.nil?}'>"
children.each do |child|
@@ -43,15 +42,3 @@ module Admin::ItemHelper
end
end
# <ol class="sortable">
# <li><div>Some content</div></li>
# <li><div>Some content</div>
# <ol>
# <li><div>Some sub-item content</div></li>
# <li><div>Some sub-item content</div></li>
# </ol>
# </li>
# <li><div>Some content</div></li>
# </ol>
+1 -1
View File
@@ -114,7 +114,7 @@ module ApplicationHelper
def page_title(page)
res = "<title>"
page_title = page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]
if page.is_home? && @site.title
if page.root? && @site.title
res << @site.title[I18n.locale]
elsif @site.title && @site.title_always_on
res << @site.title[I18n.locale] + ' - ' + page_title