summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-07 20:22:37 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-07 20:22:37 +0200
commit278819cad2d2199029cc11124c95b0155f83f821 (patch)
treec98cada36cbec18a5e0c2bc1e17ef3370a9adbe8 /app/models
parente7b12a7e50e6bdb64ccaa1180d606465485a8439 (diff)
Show a pending address in the cockpit, the diff and the publish confirm
Diffstat (limited to 'app/models')
-rw-r--r--app/models/page.rb9
1 files changed, 9 insertions, 0 deletions
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
420end 429end