Skip to content

Commit 2ceaa5e

Browse files
committed
Add Visual indicator that content is not editable.
* Use icon-warning-sign if user doesn't have permission to edit.
1 parent 0fb490e commit 2ceaa5e

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

app/helpers/cms/section_nodes_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module Cms
22
module SectionNodesHelper
33

4+
def protected_content_icon(section)
5+
icon "warning-sign" unless @modifiable_sections.include?(section)
6+
end
7+
48
def icon(name)
59
content_tag("i", "", {class: "icon-#{name}"})
610
end

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
class: 'selectable',
1212
data: data},
1313
true %>
14-
<%= icon "th-list" %> <%= object.name %>
14+
<%= icon "th-list" %> <%= object.name %><%= protected_content_icon parent %>
15+
1516
<span class="span1">
1617
<%= content_tag "i", "", class: access_icon %>
1718
<%= status_tag(object) %>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class: 'selectable',
1111
data: data},
1212
true %>
13-
<%= icon "share" %> <%= link.name %>
13+
<%= icon "share" %> <%= link.name %> <%= protected_content_icon parent %>
1414
<span class="span1">
1515
<%= content_tag "i", "", class: access_icon %>
1616
</span>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
delete_path: page_path(page),
55
type: 'page'
66
}
7-
data[:editable] = false unless @modifiable_sections.include?(parent)
7+
unless @modifiable_sections.include?(parent)
8+
data[:editable] = false
9+
else
10+
11+
end
812
%>
913
<li><%= tag "a", {href: "#",
1014
class: 'selectable',
1115
data: data
1216
},
1317
true %>
14-
<%= icon "file" %> <%= page.name %>
18+
<%= icon "file" %> <%= page.name %>
19+
<%= protected_content_icon parent %>
1520
<span class="span1">
1621
<%= content_tag "span", "H", class: "status phidden" if page.hidden? %>
1722
<%= content_tag "i", "", class: access_icon %>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<li>
1717
<%= content_tag("a", href: "#", class: 'selectable', data: data) do %>
1818
<%= icon(icon_name) %> <%= section.name %>
19+
<%= protected_content_icon section %>
1920
<span class="span1">
2021
<%= content_tag "span", "H", class: "status phidden" if section.hidden? %>
2122
<%= content_tag "i", "", class: access_status(section, @public_sections) unless section.root? %>

todo_ui_Revamp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Tasks:
22

33
## UI Merge
44

5-
* Visual indicator that a section is not editable.
65
* Keep open/closed/last selected state of sitemap
76
* Audit/Delete/merge js/cms/sitemap.js.erb
87
* Move/drag/drop sections

0 commit comments

Comments
 (0)