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

@@ -4,13 +4,21 @@
<%= render "wiki_pages/sidebar" %>
<% content_for(:content) do %>
<h1>Wiki Page: <%= @thispage.title %></h1>
<h1>Wiki Page Version Comparison: <%= link_to @thispage.title, wiki_page_versions_path(search: { wiki_page_id: @thispage.wiki_page_id }, anchor: "wiki-page-version-#{@thispage.id}"), class: "tag-type-#{@thispage.wiki_page.category_name}" %></h1>
<p>Showing differences between <%= compact_time @thispage.updated_at %> (<%= link_to_user @thispage.updater %>) and <%= compact_time @otherpage.updated_at %> (<%= link_to_user @otherpage.updater %>)</p>
<%= wiki_other_names_diff(@thispage, @otherpage) %>
<% if wiki_version_show_other_names(@thispage, @otherpage) %>
<p><%= wiki_version_other_names_diff(@thispage, @otherpage) %></p>
<% else %>
<p><em>No changes to other names.</em></p>
<% end %>
<div class="diff-body">
<%= diff_body_html(@thispage, @otherpage, :body) %>
</div>
<% if @thispage.body != @otherpage.body %>
<div class="diff-body">
<%= diff_body_html(@thispage, @otherpage, :body) %>
</div>
<% else %>
<p><em>No changes to body.</em></p>
<% end %>
<% end %>