summaryrefslogtreecommitdiff
path: root/app/views/nodes/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/nodes/show.html.erb')
-rw-r--r--app/views/nodes/show.html.erb58
1 files changed, 53 insertions, 5 deletions
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index 2ab7986..036caf2 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -1,11 +1,59 @@
1<% content_for :subnavigation do %> 1<% locked_by_other = @node.locked? && @node.lock_owner != current_user %>
2 <%= link_to 'Edit', edit_node_path(@node), :class => "unselected" %>
3 <%= link_to 'Preview', preview_page_path(@page) %>
4<% end %>
5
6<div id="page_editor" class="show_node"> 2<div id="page_editor" class="show_node">
7 <h1><%= title_for_node(@node) %></h1> 3 <h1><%= title_for_node(@node) %></h1>
8 <div id="content"> 4 <div id="content">
5 <div class="node_description">Status</div>
6 <div class="node_content node_info_group node_status">
7 <div class="node_info_group_items">
8 <div class="node_info_item">
9 <span class="node_info_label">Head</span>
10 <%= @node.head ? "#{@node.head.title} (rev #{@node.head.revision}, #{@node.head.updated_at})" : "none — never published" %>
11 </div>
12 <div class="node_info_item">
13 <span class="node_info_label">Draft</span>
14 <%= @node.draft ? "#{@node.draft.title} (rev #{@node.draft.revision}, saved #{@node.draft.updated_at})" : "none" %>
15 </div>
16 <div class="node_info_item">
17 <span class="node_info_label">Autosave</span>
18 <%= @node.autosave ? "#{@node.autosave.title} (unsaved, #{@node.autosave.updated_at})" : "none" %>
19 </div>
20 </div>
21
22 <% edit_label = @node.autosave ? "Continue Editing" : (@node.draft ? "Edit Draft" : "Edit") %>
23 <div class="node_info_group_items">
24 <div class="node_info_item">
25 <% if locked_by_other %>
26 <span class="disabled_action"><%= edit_label %></span>
27 <% else %>
28 <%= link_to (@node.autosave ? "Continue Editing" : (@node.draft ? "Edit Draft" : "Lock + Edit")), edit_node_path(@node), class: "action_button" %>
29 <% if !@node.draft && !@node.autosave %>
30 <span class="field_hint">Nothing pending — this will start a fresh draft.</span>
31 <% end %>
32 <% end %>
33 </div>
34
35 <% unless locked_by_other %>
36 <% if @node.draft && !@node.autosave %>
37 <div class="node_info_item">
38 <%= button_to 'Publish', publish_node_path(@node), method: :put,
39 form: { data: { confirm: "Publish this draft?" }, class: 'button_to state_changing' } %>
40 </div>
41 <% end %>
42 <% if @node.draft || @node.autosave %>
43 <div class="node_info_item">
44 <%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard changes'),
45 revert_node_path(@node), method: :put,
46 form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %>
47 </div>
48 <% end %>
49 <% end %>
50 </div>
51
52 <% if locked_by_other %>
53 <span class="field_hint">Locked — see People below to unlock before editing, publishing, or discarding.</span>
54 <% end %>
55 </div>
56
9 <div class="node_description">People</div> 57 <div class="node_description">People</div>
10 <div class="node_content node_info_group"> 58 <div class="node_content node_info_group">
11 <div class="node_info_group_items"> 59 <div class="node_info_group_items">