Rework pool versions index/diff views
- Changed to using the diff-body CSS class -- Removed unneeded CSS style file - Removed trailing whitespace after the >>> link -- It was causing artifact line-throughs to appear after the link - Changed the diff link to only render when a text field has changed -- Because the post changes are already shown on the index view - Specifically add <br> to statuses to cause line breaks
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
module PoolVersionsHelper
|
||||
def pool_versions_listing_type
|
||||
params.dig(:search, :pool_id).present? ? :revert : :standard
|
||||
end
|
||||
|
||||
def pool_version_status_diff(pool_version)
|
||||
cur = pool_version
|
||||
prev = pool_version.previous
|
||||
|
||||
return "New" if prev.blank?
|
||||
|
||||
status = []
|
||||
status += ["Renamed"] if cur.name != prev.name
|
||||
status += ["DescChanged"] if cur.description != prev.description
|
||||
status += ["Deleted"] if cur.is_deleted? && !prev.is_deleted?
|
||||
status += ["Undeleted"] if !cur.is_deleted? && prev.is_deleted?
|
||||
status += ["Activated"] if cur.is_active? && !prev.is_active?
|
||||
status += ["Deactivated"] if !cur.is_active? && prev.is_active?
|
||||
status.join(" ")
|
||||
end
|
||||
|
||||
def pool_page_diff(pool_version, other_version)
|
||||
pattern = Regexp.new('(?:<.+?>)|(?:\w+)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
||||
DiffBuilder.new(pool_version.description, other_version.description, pattern).build
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user