Skip to content

Commit 1af61eb

Browse files
committed
Use separate icons for Site root and Home page
* Site is using 'globe' icon. * Homepage is using 'home' icon.
1 parent 591bfb8 commit 1af61eb

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

app/models/cms/page.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
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? %>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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',

test/unit/models/page_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
module 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

todo_ui_Revamp.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ Tasks:
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?)

0 commit comments

Comments
 (0)