table builder: fix various incorrect css classes.

Change calling convention to explicitly indicate whether the attributes
are for the <th> element or the <td> element. Fixes various cases where
the two were mixed up.

* Fix .col-expand classes not being set correctly on the /post_versions,
  /pool_versions, and /notes pages.

* Fix .updater and .updated-at classes not being set correctly on the
  /forum_topics page.

* Fix the name param being ignored (noticeable in the post count field
  on the /tags page).

* Don't pass empty string when column has no name.
This commit is contained in:
evazion
2020-01-07 01:21:42 -06:00
parent cdb42aad66
commit 5c913d8ad1
36 changed files with 61 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
<div id="p-global-listing">
<%= table_for @wiki_page_versions, width: "100%" do |t| %>
<% t.column "", {width: "3%"} do |wiki_page_version| %>
<% t.column width: "3%" do |wiki_page_version| %>
<%= 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 %>
<% t.column "Title" do |wiki_page_version| %>

View File

@@ -2,17 +2,17 @@
<%= 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 width: "3%" do |wiki_page_version, i| %>
<% if i < @wiki_page_versions.length - 1 %>
<%= link_to "diff", diff_wiki_page_versions_path(:otherpage => wiki_page_version.id, :thispage => @wiki_page_versions[i + 1].id) %>
<% else %>
diff
<% end %>
<% end %>
<% t.column "", {width: "2%"} do |wiki_page_version, i| %>
<% t.column 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 width: "2%" do |wiki_page_version, i| %>
<%= radio_button_tag "otherpage", wiki_page_version.id, (i == 0) %>
<% end %>
<% t.column "Title" do |wiki_page_version| %>