diff options
Diffstat (limited to 'app/views/nodes')
| -rw-r--r-- | app/views/nodes/edit.html.erb | 9 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 12 |
2 files changed, 19 insertions, 2 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index cdc9b36e..1c194101 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -6,9 +6,16 @@ | |||
| 6 | disabled: @node.autosave.present? %> | 6 | disabled: @node.autosave.present? %> |
| 7 | 7 | ||
| 8 | <% if @node.autosave || (@node.draft && @node.head) %> | 8 | <% if @node.autosave || (@node.draft && @node.head) %> |
| 9 | <%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard changes'), | 9 | <%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard Autosave'), |
| 10 | revert_node_path(@node), method: :put, | 10 | revert_node_path(@node), method: :put, |
| 11 | form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %> | 11 | form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %> |
| 12 | <% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %> | ||
| 13 | <%= button_to 'What changed?', | ||
| 14 | diff_node_revisions_path(@node), | ||
| 15 | method: :get, | ||
| 16 | params: { start_revision: pair.first, end_revision: pair.last }, | ||
| 17 | form: { class: 'button_to computation' } %> | ||
| 18 | <% end %> | ||
| 12 | <% end %> | 19 | <% end %> |
| 13 | 20 | ||
| 14 | <%= submit_tag "Save Draft", form: dom_id(@node, :edit) %> | 21 | <%= submit_tag "Save Draft", form: dom_id(@node, :edit) %> |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index 036caf29..24693108 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -32,6 +32,16 @@ | |||
| 32 | <% end %> | 32 | <% end %> |
| 33 | </div> | 33 | </div> |
| 34 | 34 | ||
| 35 | <% @node.available_layer_pairs.each do |pair| %> | ||
| 36 | <div class="node_info_item"> | ||
| 37 | <%= button_to "Diff #{pair.first.to_s.capitalize} vs. #{pair.last.to_s.capitalize}", | ||
| 38 | diff_node_revisions_path(@node), | ||
| 39 | method: :get, | ||
| 40 | params: { start_revision: pair.first, end_revision: pair.last }, | ||
| 41 | form: { class: 'button_to computation' } %> | ||
| 42 | </div> | ||
| 43 | <% end %> | ||
| 44 | |||
| 35 | <% unless locked_by_other %> | 45 | <% unless locked_by_other %> |
| 36 | <% if @node.draft && !@node.autosave %> | 46 | <% if @node.draft && !@node.autosave %> |
| 37 | <div class="node_info_item"> | 47 | <div class="node_info_item"> |
| @@ -41,7 +51,7 @@ | |||
| 41 | <% end %> | 51 | <% end %> |
| 42 | <% if @node.draft || @node.autosave %> | 52 | <% if @node.draft || @node.autosave %> |
| 43 | <div class="node_info_item"> | 53 | <div class="node_info_item"> |
| 44 | <%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard changes'), | 54 | <%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard Autosave'), |
| 45 | revert_node_path(@node), method: :put, | 55 | revert_node_path(@node), method: :put, |
| 46 | form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %> | 56 | form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %> |
| 47 | </div> | 57 | </div> |
