File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,11 @@ def name_with_section_path
358358 ( a [ 1 ..a . size ] . map { |a | a . name } + [ name ] ) . join ( " / " )
359359 end
360360
361+ # @return [Boolean] true if this page is the home page of the site.
362+ def home?
363+ path == "/"
364+ end
365+
361366 # This will return the "top level section" for this page, which is the section directly
362367 # below the root (a.k.a My Site) that this page is in. If this page is in root,
363368 # then this will return root.
Original file line number Diff line number Diff line change 66}
77 unless @modifiable_sections.include?(parent)
88 data[:editable] = false
9- else
10-
119 end
10+ icon_name = page.home? ? "home" : "file"
1211%>
1312 <li > <%= tag "a" , { href : "#" ,
1413 class : 'selectable' ,
1514 data : data
1615} ,
1716 true %>
18- <%= icon "file" %> <%= page . name %>
17+ <%= icon icon_name %> <%= page . name %>
1918 <%= protected_content_icon parent %>
2019 < span class ="span1 ">
2120 <%= content_tag "span" , "H" , class : "status phidden" if page . hidden? %>
Original file line number Diff line number Diff line change 11<% # Handles both Root Section and Subsections
22 collapse = section.root? ? "" : "collapse"
3- icon_name = section.root? ? "home " : "folder-close"
3+ icon_name = section.root? ? "globe " : "folder-close"
44 data = {
55 target: "#section#{section.id}",
66 type: 'section',
Original file line number Diff line number Diff line change 33module Cms
44 class CreatingPageTest < ActiveSupport ::TestCase
55
6+
7+ test "home?" do
8+ @page = create ( :page , path : "/" )
9+ assert @page . home?
10+ end
11+
612 test "Testing Database should be empty and have no pages" do
713 assert_nil Cms ::Page . with_path ( "/" ) . first
814 end
Original file line number Diff line number Diff line change 22
33## UI Merge
44
5+ * Move/drag/drop sections
56* Keep open/closed/last selected state of sitemap
67* Audit/Delete/merge js/cms/sitemap.js.erb
7- * Move/drag/drop sections
88* No visual indicator of an empty section
99* Doubleclicking on items
1010* page_editor.css/page_content_editing.css shouldn't have been deleted.
1111* Can't edit the root section
12- * Delete old sitemap pages
13- * Use different 'Site' icon for My Site and Home icon for the homepage.
12+ * Delete old sitemap pages (_ section.old.erb, etc)
1413
1514## Admin Menu
1615* Reduce the different admin layouts (why are there so many?)
You can’t perform that action at this time.
0 commit comments