Use optional parameter to set column class

- Fixes the extremely long class name on the post versions view
- Can now use one value instead of having to set th and td
- Added missing column classes on all tables
This commit is contained in:
BrokenEagle
2020-01-13 20:57:16 +00:00
parent 34c3df78d9
commit 3ab2c4c3ea
24 changed files with 35 additions and 30 deletions

View File

@@ -1,15 +1,15 @@
<div id="p-<%= wiki_page_versions_listing_type %>-listing">
<%= form_tag(diff_wiki_page_versions_path, :method => :get) do %>
<%= table_for @wiki_page_versions, width: "100%" do |t| %>
<% t.column width: "3%" do |wiki_page_version, i| %>
<% t.column column: "diff", width: "3%" do |wiki_page_version, i| %>
<%= link_to_if wiki_page_version.previous.present?, "diff", diff_wiki_page_versions_path(otherpage: wiki_page_version.previous.try(:id), thispage: wiki_page_version.id) %>
<% end %>
<% if wiki_page_versions_listing_type == :page %>
<% t.column width: "2%" do |wiki_page_version, i| %>
<% t.column column: "this-page", width: "2%" do |wiki_page_version, i| %>
<%= radio_button_tag "thispage", wiki_page_version.id, (i == 1) %>
<% end %>
<% t.column width: "2%" do |wiki_page_version, i| %>
<% t.column column: "other-page", width: "2%" do |wiki_page_version, i| %>
<%= radio_button_tag "otherpage", wiki_page_version.id, (i == 0) %>
<% end %>
<% end %>