diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 4 | ||||
| -rw-r--r-- | app/models/page.rb | 9 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 14 | ||||
| -rw-r--r-- | app/views/revisions/diff.html.erb | 10 |
4 files changed, 34 insertions, 3 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index c4de46cc..19385543 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -221,8 +221,8 @@ module NodeActionsHelper | |||
| 221 | end | 221 | end |
| 222 | 222 | ||
| 223 | def subject_ref action | 223 | def subject_ref action |
| 224 | action.node ? link_to(h(action.subject_name), node_path(action.node)) | 224 | name = action.subject_name.presence || t("admin.common.no_title") |
| 225 | : h(action.subject_name) | 225 | action.node ? link_to(h(name), node_path(action.node)) : h(name) |
| 226 | end | 226 | end |
| 227 | 227 | ||
| 228 | def asset_ref action | 228 | def asset_ref action |
diff --git a/app/models/page.rb b/app/models/page.rb index 4635f1b4..bba7e6bc 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -272,6 +272,7 @@ class Page < ApplicationRecord | |||
| 272 | end | 272 | end |
| 273 | 273 | ||
| 274 | text_diffs.merge( | 274 | text_diffs.merge( |
| 275 | address: address_diff_against(other), | ||
| 275 | tags: { added: tag_list.to_a - other.tag_list.to_a, removed: other.tag_list.to_a - tag_list.to_a }, | 276 | tags: { added: tag_list.to_a - other.tag_list.to_a, removed: other.tag_list.to_a - tag_list.to_a }, |
| 276 | template_name: { from: other.template_name, to: template_name, changed: template_name != other.template_name }, | 277 | template_name: { from: other.template_name, to: template_name, changed: template_name != other.template_name }, |
| 277 | assets: { added: assets.to_a - other.assets.to_a, removed: other.assets.to_a - assets.to_a } | 278 | assets: { added: assets.to_a - other.assets.to_a, removed: other.assets.to_a - assets.to_a } |
| @@ -417,4 +418,12 @@ class Page < ApplicationRecord | |||
| 417 | 418 | ||
| 418 | self.body = doc.to_html | 419 | self.body = doc.to_html |
| 419 | end | 420 | end |
| 421 | |||
| 422 | def address_diff_against other | ||
| 423 | changed = slug != other.slug || parent_node_id != other.parent_node_id | ||
| 424 | |||
| 425 | { :from => other.prospective_unique_name, | ||
| 426 | :to => prospective_unique_name, | ||
| 427 | :changed => changed } | ||
| 428 | end | ||
| 420 | end | 429 | end |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index 3b2d28d9..a826be37 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -50,8 +50,13 @@ | |||
| 50 | <% if @node.draft && !@node.autosave && !@node.in_trash? && !@node.trash_node? %> | 50 | <% if @node.draft && !@node.autosave && !@node.in_trash? && !@node.trash_node? %> |
| 51 | <div class="info_item"> | 51 | <div class="info_item"> |
| 52 | <% if may_change_live %> | 52 | <% if may_change_live %> |
| 53 | <% confirm = t(".confirm_publish") %> | ||
| 54 | <% if @node.prospective_unique_name != @node.unique_name %> | ||
| 55 | <% confirm += " " + t(".confirm_publish_moves", | ||
| 56 | :path => @node.prospective_unique_name) %> | ||
| 57 | <% end %> | ||
| 53 | <%= button_to t(".publish"), publish_node_path(@node), method: :put, | 58 | <%= button_to t(".publish"), publish_node_path(@node), method: :put, |
| 54 | form: { data: { confirm: t(".confirm_publish") }, class: 'button_to state_changing' } %> | 59 | form: { data: { confirm: confirm }, class: 'button_to state_changing' } %> |
| 55 | <% else %> | 60 | <% else %> |
| 56 | <span class="disabled_action"><%= t(".publish") %></span> | 61 | <span class="disabled_action"><%= t(".publish") %></span> |
| 57 | <% end %> | 62 | <% end %> |
| @@ -223,6 +228,13 @@ | |||
| 223 | locale_param = ->(locale) { locale unless locale == I18n.default_locale } | 228 | locale_param = ->(locale) { locale unless locale == I18n.default_locale } |
| 224 | %> | 229 | %> |
| 225 | 230 | ||
| 231 | <% if @node.prospective_unique_name != @node.unique_name %> | ||
| 232 | <p class="pending_address"> | ||
| 233 | <%= icon("arrow-move-right", library: "tabler", "aria-hidden": true) %> | ||
| 234 | <%= t(".pending_address", :path => @node.prospective_unique_name) %> | ||
| 235 | </p> | ||
| 236 | <% end %> | ||
| 237 | |||
| 226 | <div class="link_matrix link_matrix_<%= link_locales.size %>"> | 238 | <div class="link_matrix link_matrix_<%= link_locales.size %>"> |
| 227 | <div class="link_matrix_head"> | 239 | <div class="link_matrix_head"> |
| 228 | <span></span> | 240 | <span></span> |
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index 5c881f24..0fd9ccb9 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb | |||
| @@ -115,6 +115,16 @@ | |||
| 115 | <%= raw @diff[:body] %> | 115 | <%= raw @diff[:body] %> |
| 116 | <% end %> | 116 | <% end %> |
| 117 | 117 | ||
| 118 | <h3><%= t(".address") %></h3> | ||
| 119 | <% if @diff[:address][:changed] %> | ||
| 120 | <p> | ||
| 121 | <del><%= @diff[:address][:from] || t(".none_marker") %></del> | ||
| 122 | <ins><%= @diff[:address][:to] || t(".none_marker") %></ins> | ||
| 123 | </p> | ||
| 124 | <% else %> | ||
| 125 | <p class="diff_unchanged"><%= t(".no_change") %></p> | ||
| 126 | <% end %> | ||
| 127 | |||
| 118 | <h3><%= Page.human_attribute_name(:tag_list) %></h3> | 128 | <h3><%= Page.human_attribute_name(:tag_list) %></h3> |
| 119 | <% if @diff[:tags][:added].empty? && @diff[:tags][:removed].empty? %> | 129 | <% if @diff[:tags][:added].empty? && @diff[:tags][:removed].empty? %> |
| 120 | <p class="diff_unchanged"><%= t(".no_change") %></p> | 130 | <p class="diff_unchanged"><%= t(".no_change") %></p> |
