Rework wiki page versions index/diff views
- Changed to using the diff-body CSS class -- Removed unnecessary elements from the CSS style file - Does a symmetric difference on the array fields to detect differences - Add more descriptors to the status/changes column - Specifically add <br> to statuses to cause line breaks
This commit is contained in:
@@ -29,6 +29,28 @@ class WikiPageVersion < ApplicationRecord
|
||||
@previous.first
|
||||
end
|
||||
|
||||
def self.status_fields
|
||||
{
|
||||
body: "Body",
|
||||
other_names_changed: "OtherNames",
|
||||
title: "Renamed",
|
||||
was_deleted: "Deleted",
|
||||
was_undeleted: "Undeleted",
|
||||
}
|
||||
end
|
||||
|
||||
def other_names_changed
|
||||
((other_names - previous.other_names) | (previous.other_names - other_names)).length > 0
|
||||
end
|
||||
|
||||
def was_deleted
|
||||
is_deleted && !previous.is_deleted
|
||||
end
|
||||
|
||||
def was_undeleted
|
||||
!is_deleted && previous.is_deleted
|
||||
end
|
||||
|
||||
def category_name
|
||||
Tag.category_for(title)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user