Move more logic to the helper modules

- Diff view changes
-- Only show pool description changes in diff view
-- Conditionally render diff link when applicable values are changed
-- Conditionally show diff view sections when values are changed
- Show renames on index view
-- There is plenty of space
-- This wasn't shown at all for wikis
-- Having to navigate to an alternate page is unwieldy for pools
- Show "posts" as a status on pools
-- This is so all changes among versions are quantified as a status
- Standardize diff/index titles
This commit is contained in:
BrokenEagle
2020-03-17 05:23:51 +00:00
parent 4b30e644bb
commit a95e57d938
15 changed files with 152 additions and 105 deletions

View File

@@ -14,4 +14,24 @@ module ArtistVersionsHelper
diff_list_html(new_urls, old_urls, latest_urls)
end
def artist_version_name_diff(artist_version)
previous = artist_version.previous
if previous.present? && (artist_version.name != previous.name)
name_diff = diff_name_html(artist_version.name, previous.name)
%(<br><br><b>Rename:</b><br>&ensp;#{name_diff}</p>).html_safe
else
""
end
end
def artist_version_group_name_diff(artist_version)
previous = artist_version.previous
if artist_version.group_name.present? || (previous.present? && previous.group_name.present?)
group_name_diff = diff_name_html(artist_version.group_name, previous.group_name)
%(<b>Group:</b><br>&ensp;#{group_name_diff}<br><br>).html_safe
else
""
end
end
end