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:
BrokenEagle
2020-02-08 06:49:31 +00:00
parent d62f7e786e
commit ede7167bb8
6 changed files with 49 additions and 62 deletions

View File

@@ -114,6 +114,37 @@ class PoolArchive < ApplicationRecord
@previous.first
end
def self.status_fields
{
name: "Renamed",
description: "Description",
was_deleted: "Deleted",
was_undeleted: "Undeleted",
was_activated: "Activated",
was_deactivated: "Deactivated",
}
end
def was_deleted
is_deleted && !previous.is_deleted
end
def was_undeleted
!is_deleted && previous.is_deleted
end
def was_activated
is_active && !previous.is_active
end
def was_deactivated
!is_active && previous.is_active
end
def text_field_changed
previous.present? && (name_changed || description_changed)
end
def pretty_name
name.tr("_", " ")
end