diff --git a/app/logical/table_builder.rb b/app/logical/table_builder.rb index c5a2398bb..e89faca2d 100644 --- a/app/logical/table_builder.rb +++ b/app/logical/table_builder.rb @@ -2,12 +2,14 @@ class TableBuilder class Column attr_reader :attribute, :name, :block, :header_attributes, :body_attributes - def initialize(attribute = nil, header_attributes=nil, body_attributes=nil, &block) + def initialize(attribute = nil, th: {}, td: {}, width: nil, name: nil, &block) @attribute = attribute - @header_attributes = header_attributes - @body_attributes = body_attributes - @name = attribute.kind_of?(String) ? attribute : attribute.to_s.titleize + @header_attributes = { width: width, **th } + @body_attributes = td @block = block + + @name = name || attribute + @name = @name.to_s.titleize unless @name.kind_of?(String) end def value(item, i, j) diff --git a/app/views/artist_commentary_versions/_listing.html.erb b/app/views/artist_commentary_versions/_listing.html.erb index bf66b7786..38e100b20 100644 --- a/app/views/artist_commentary_versions/_listing.html.erb +++ b/app/views/artist_commentary_versions/_listing.html.erb @@ -33,7 +33,7 @@ <%= compact_time commentary_version.updated_at %> <% end %> <% if artist_commentary_versions_listing_type == :revert %> - <% t.column "", {width: "7%"} do |commentary_version| %> + <% t.column width: "7%" do |commentary_version| %> <%= link_to "Revert to", revert_artist_commentary_path(commentary_version.post_id, :version_id => commentary_version.id), :remote => true, :method => :put, :data => {:confirm => "Are you sure you want to revert to this version?"} %> <% end %> <% end %> diff --git a/app/views/artist_versions/_listing.html.erb b/app/views/artist_versions/_listing.html.erb index 9c8b67aa2..4d939820d 100644 --- a/app/views/artist_versions/_listing.html.erb +++ b/app/views/artist_versions/_listing.html.erb @@ -20,7 +20,7 @@ <%= artist_version_other_names_diff(artist_version) %> <% end %> <% end %> - <% t.column "URLs", nil, {class: "col-expand"} do |artist_version| %> + <% t.column "URLs", td: {class: "col-expand"} do |artist_version| %> <%= artist_version_urls_diff(artist_version) if artist_version.visible? %> <% end %> <% t.column "Updated" do |artist_version| %> @@ -34,7 +34,7 @@

<% end %> <% if artist_versions_listing_type == :revert %> - <% t.column "" do |artist_version| %> + <% t.column do |artist_version| %> <%= link_to "Revert to", revert_artist_path(artist_version.artist_id, version_id: artist_version.id), method: :put, "data-confirm": "Are you sure you want to revert to this version?" %> <% end %> <% end %> diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb index 2c94a946c..1101152db 100644 --- a/app/views/artists/index.html.erb +++ b/app/views/artists/index.html.erb @@ -10,7 +10,7 @@ (group: <%= link_to artist.group_name, artist %>) <% end %> <% end %> - <% t.column "Other Names", nil, {class: "col-expand"} do |artist| %> + <% t.column "Other Names", td: {class: "col-expand"} do |artist| %> <% artist.other_names.each do |name| %> <%= link_to name, artists_path(search: { any_name_matches: name }), class: "artist-other-name" %> <% end %> @@ -27,7 +27,7 @@ <% t.column "Updated" do |artist| %> <%= time_ago_in_words_tagged(artist.updated_at) %> <% end %> - <% t.column "" do |artist| %> + <% t.column do |artist| %> <% if CurrentUser.is_member? %> <%= link_to "Edit", edit_artist_path(artist) %> diff --git a/app/views/bans/index.html.erb b/app/views/bans/index.html.erb index 64e7609ee..f5cba6bbe 100644 --- a/app/views/bans/index.html.erb +++ b/app/views/bans/index.html.erb @@ -12,7 +12,7 @@ <% t.column "Duration" do |ban| %> <%= humanized_duration(ban.created_at, ban.expires_at) %> <% end %> - <% t.column "Reason", nil, {class: "col-expand"} do |ban| %> + <% t.column "Reason", td: {class: "col-expand"} do |ban| %>
<%= format_text ban.reason %>
@@ -22,7 +22,7 @@ <%= link_to "»", bans_path(search: { banner_name: ban.banner.name }) %>
<%= time_ago_in_words_tagged(ban.created_at) %>
<% end %> - <% t.column "" do |ban| %> + <% t.column do |ban| %> <% if CurrentUser.is_moderator? %> <%= link_to "Edit", edit_ban_path(ban) %> | <%= link_to "Delete", ban_path(ban), :method => :delete, :remote => true %> diff --git a/app/views/bulk_update_requests/_listing.html.erb b/app/views/bulk_update_requests/_listing.html.erb index f294765df..0969e254d 100644 --- a/app/views/bulk_update_requests/_listing.html.erb +++ b/app/views/bulk_update_requests/_listing.html.erb @@ -27,7 +27,7 @@ <%= link_to "»", bulk_update_requests_path(search: { user_name: request.user.name }) %>
<%= time_ago_in_words_tagged(request.created_at) %>
<% end %> - <% t.column "" do |request| %> + <% t.column do |request| %> <%= link_to "Show", bulk_update_request_path(request) %> | <%= render "bulk_update_requests/bur_edit_links", bur: request %> <% end %> diff --git a/app/views/comment_votes/index.html.erb b/app/views/comment_votes/index.html.erb index a7ebd4246..63c90fad0 100644 --- a/app/views/comment_votes/index.html.erb +++ b/app/views/comment_votes/index.html.erb @@ -14,7 +14,7 @@ <% t.column "Post" do |vote| %> <%= PostPresenter.preview(vote.comment.post, show_deleted: true) %> <% end %> - <% t.column "Comment", nil, {class: "col-expand"} do |vote| %> + <% t.column "Comment", td: {class: "col-expand"} do |vote| %>
<%= format_text(vote.comment.body) %>
@@ -32,7 +32,7 @@ <%= link_to "»", comment_votes_path(search: { user_name: vote.user.name }) %>
<%= time_ago_in_words_tagged(vote.created_at) %>
<% end %> - <% t.column "" do |vote| %> + <% t.column do |vote| %> <% if vote.user == CurrentUser.user %> <%= link_to "unvote", comment_comment_votes_path(vote.comment), remote: true, method: :delete %> <% end %> diff --git a/app/views/delayed_jobs/index.html.erb b/app/views/delayed_jobs/index.html.erb index ef31dd4a3..8fcff0452 100644 --- a/app/views/delayed_jobs/index.html.erb +++ b/app/views/delayed_jobs/index.html.erb @@ -7,11 +7,11 @@ <% t.column "Name" do |job| %> <%= raw print_name(job) %> <% end %> - <% t.column "Handler", nil, {class: "col-expand"} do |job| %> + <% t.column "Handler", td: {class: "col-expand"} do |job| %> <%= raw print_handler(job) %> <% end %> <% t.column :attempts %> - <% t.column "Last error", nil, {class: "col-expand"} do |job| %> + <% t.column "Last error", td: {class: "col-expand"} do |job| %> <% if job.last_error %> <%= job.last_error.split(/\n/)[0] %> <%= job.last_error.split(/\n/)[1..-1].grep(/releases/).join("\n") %> @@ -23,7 +23,7 @@ <% t.column "Run at" do |job| %> <%= time_ago_in_words_tagged(job.run_at) %> <% end %> - <% t.column "" do |job| %> + <% t.column do |job| %> <% if CurrentUser.is_admin? %> <% if job.locked_at? %> Running diff --git a/app/views/dmails/index.html.erb b/app/views/dmails/index.html.erb index b8ab751c1..4f1242d52 100644 --- a/app/views/dmails/index.html.erb +++ b/app/views/dmails/index.html.erb @@ -31,7 +31,7 @@ <%= link_to dmail.title, dmail_path(dmail) %> <% end %> <% end %> - <% t.column "" do |dmail| %> + <% t.column do |dmail| %> <%= link_to "delete", dmail_path(dmail), :method => :delete, :data => {:confirm => "Are you sure you want to delete this Dmail?"} %> <% end %> <% end %> diff --git a/app/views/dtext_links/index.html.erb b/app/views/dtext_links/index.html.erb index 9ebe71dc2..3a393e08a 100644 --- a/app/views/dtext_links/index.html.erb +++ b/app/views/dtext_links/index.html.erb @@ -21,7 +21,7 @@ <% end %> <% end %> - <% t.column "Link", {}, class: "col-expand" do |dtext_link| %> + <% t.column "Link", td: { class: "col-expand" } do |dtext_link| %> <% if dtext_link.external_link? %> <%= external_link_to(dtext_link.link_target) %> <% elsif dtext_link.wiki_link? %> diff --git a/app/views/favorite_groups/index.html.erb b/app/views/favorite_groups/index.html.erb index 9b1dc3eef..5f6b0c759 100644 --- a/app/views/favorite_groups/index.html.erb +++ b/app/views/favorite_groups/index.html.erb @@ -2,7 +2,6 @@
<%= table_for @favorite_groups, width: "100%" do |t| %> - <% t.column nil, {width: "5%"} %> <% t.column "Name", {width: "60%"} do |favgroup| %> <%= link_to favgroup.pretty_name, favorite_group_path(favgroup) %> <% if favgroup.post_count > CurrentUser.user.per_page %> diff --git a/app/views/forum_post_votes/index.html.erb b/app/views/forum_post_votes/index.html.erb index 28693d79a..942d8714a 100644 --- a/app/views/forum_post_votes/index.html.erb +++ b/app/views/forum_post_votes/index.html.erb @@ -15,7 +15,7 @@ <%= link_to "Forum ##{forum_post_vote.forum_post_id}", forum_post_vote.forum_post %> <%= link_to "»", forum_post_votes_path(search: { forum_post_id: forum_post_vote.forum_post_id }) %> <% end %> - <% t.column "Forum Topic", nil, {class: "col-expand"} do |forum_post_vote| %> + <% t.column "Forum Topic", td: {class: "col-expand"} do |forum_post_vote| %> <%= link_to forum_post_vote.forum_post.topic.title, forum_post_vote.forum_post.topic %> <% end %> <% t.column "Score" do |forum_post_vote| %> @@ -31,7 +31,7 @@ <%= link_to "»", forum_post_votes_path(search: { creator_name: forum_post_vote.creator.name }) %>
<%= time_ago_in_words_tagged(forum_post_vote.created_at) %>
<% end %> - <% t.column "" do |forum_post_vote| %> + <% t.column do |forum_post_vote| %> <% if forum_post_vote.creator == CurrentUser.user %> <%= link_to "unvote", forum_post_vote_path(forum_post_vote, format: "js"), remote: true, method: :delete %> <% end %> diff --git a/app/views/forum_posts/index.html.erb b/app/views/forum_posts/index.html.erb index a31130969..d0cc54fd4 100644 --- a/app/views/forum_posts/index.html.erb +++ b/app/views/forum_posts/index.html.erb @@ -2,10 +2,10 @@
<%= table_for @forum_posts, width: "100%" do |t| %> - <% t.column "Topic", nil, {class: "forum-post-topic-title"} do |forum_post| %> + <% t.column "Topic", td: {class: "forum-post-topic-title"} do |forum_post| %> <%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %> <% end %> - <% t.column "Excerpt", nil, {class: "forum-post-excerpt"} do |forum_post| %> + <% t.column "Excerpt", td: {class: "forum-post-excerpt"} do |forum_post| %> <%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %> <% end %> <% t.column "Creator" do |forum_post| %> diff --git a/app/views/forum_topics/_listing.html.erb b/app/views/forum_topics/_listing.html.erb index 298e24a39..2a6075ee3 100644 --- a/app/views/forum_topics/_listing.html.erb +++ b/app/views/forum_topics/_listing.html.erb @@ -25,10 +25,10 @@ <% t.column "Creator" do |topic| %> <%= link_to_user topic.creator %> <% end %> - <% t.column "Updated by", {class: "updater"} do |topic| %> + <% t.column "Updated by", th: { class: "updater" }, td: { class: "updater" } do |topic| %> <%= link_to_user topic.updater %> <% end %> - <% t.column "Updated at", {class: "updated-at"} do |topic| %> + <% t.column "Updated at", th: { class: "updated-at" }, td: { class: "updated-at" } do |topic| %> <%= compact_time topic.updated_at %> <% end %> <% end %> diff --git a/app/views/ip_addresses/_index.html.erb b/app/views/ip_addresses/_index.html.erb index 4f3a947f3..3c4b2268d 100644 --- a/app/views/ip_addresses/_index.html.erb +++ b/app/views/ip_addresses/_index.html.erb @@ -16,7 +16,7 @@ <% t.column "Date" do |ip| %> <%= time_ago_in_words_tagged ip.created_at %> <% end %> - <% t.column "" do |ip| %> + <% t.column do |ip| %> <%= link_to "IP info", "https://ipinfo.io/#{ip.ip_addr}" %> <% end %> <% end %> diff --git a/app/views/ip_bans/index.html.erb b/app/views/ip_bans/index.html.erb index f3a8e9eb0..1cfc759c4 100644 --- a/app/views/ip_bans/index.html.erb +++ b/app/views/ip_bans/index.html.erb @@ -10,7 +10,7 @@ <%= link_to_user ip_ban.creator %> <% end %> <% t.column :reason %> - <% t.column "" do |ip_ban| %> + <% t.column do |ip_ban| %> <%= link_to "Unban", ip_ban_path(ip_ban), :remote => true, :method => :delete, :data => {:confirm => "Do your really want to unban #{ip_ban.ip_addr}?"} %> <% end %> <% end %> diff --git a/app/views/mod_actions/index.html.erb b/app/views/mod_actions/index.html.erb index 97e17a7aa..50b7825bc 100644 --- a/app/views/mod_actions/index.html.erb +++ b/app/views/mod_actions/index.html.erb @@ -8,7 +8,7 @@ <% t.column "Category" do |mod_action| %> <%= link_to mod_action.category.humanize, mod_actions_path(search: { category: mod_action.category_id }) %> <% end %> - <% t.column "Message", nil, {class: "col-expand"} do |mod_action| %> + <% t.column "Message", td: {class: "col-expand"} do |mod_action| %> <%= format_text(mod_action.description) %> <% end %> <% t.column "Created" do |mod_action| %> diff --git a/app/views/moderator/post/disapprovals/index.html.erb b/app/views/moderator/post/disapprovals/index.html.erb index 85c94a97c..9f96a96aa 100644 --- a/app/views/moderator/post/disapprovals/index.html.erb +++ b/app/views/moderator/post/disapprovals/index.html.erb @@ -18,7 +18,7 @@ <%= link_to "post ##{post_disapproval.post_id}", post_path(post_disapproval.post_id) %> <%= link_to "»", moderator_post_disapprovals_path(search: params[:search].merge(post_id: post_disapproval.post_id)) %> <% end %> - <% t.column "Message", nil, {class: "col-expand"} do |post_disapproval| %> + <% t.column "Message", td: {class: "col-expand"} do |post_disapproval| %>
<%= format_text(post_disapproval.message) %>
diff --git a/app/views/news_updates/index.html.erb b/app/views/news_updates/index.html.erb index 2245bc6b0..e9616fa69 100644 --- a/app/views/news_updates/index.html.erb +++ b/app/views/news_updates/index.html.erb @@ -7,7 +7,7 @@ <%= link_to_user news_update.creator %> <% end %> <% t.column :message %> - <% t.column "" do |news_update| %> + <% t.column do |news_update| %> <%= link_to "Edit", edit_news_update_path(news_update) %> | <%= link_to "Delete", news_update_path(news_update), :method => :delete %> <% end %> diff --git a/app/views/note_versions/_listing.html.erb b/app/views/note_versions/_listing.html.erb index 3dcc10f2b..132c4f1cf 100644 --- a/app/views/note_versions/_listing.html.erb +++ b/app/views/note_versions/_listing.html.erb @@ -14,7 +14,7 @@ <%= link_to "»", note_versions_path(search: {note_id: note_version.note_id}) %> <% end %> <% end %> - <% t.column "Body", nil, {class: "col-expand"} do |note_version| %> + <% t.column "Body", td: {class: "col-expand"} do |note_version| %> <%= h(note_version.body) %> <% unless note_version.is_active? %> (deleted) diff --git a/app/views/notes/index.html.erb b/app/views/notes/index.html.erb index 49f22112f..f0a548f29 100644 --- a/app/views/notes/index.html.erb +++ b/app/views/notes/index.html.erb @@ -10,7 +10,7 @@ <%= link_to "#{note.id}.#{note.version}", post_path(note.post_id, anchor: "note-#{note.id}") %> <%= link_to "»", note_versions_path(search: { note_id: note.id }) %> <% end %> - <% t.column "Body", class: "col-expand" do |note| %> + <% t.column "Body", td: { class: "col-expand" } do |note| %> <%= note.body %> <% unless note.is_active? %> (deleted) diff --git a/app/views/pool_versions/_listing.html.erb b/app/views/pool_versions/_listing.html.erb index 5f5a7e60d..389db36de 100644 --- a/app/views/pool_versions/_listing.html.erb +++ b/app/views/pool_versions/_listing.html.erb @@ -5,7 +5,7 @@ <%= link_to pool_version.pretty_name, pool_path(pool_version.pool_id), class: "pool-category-#{pool_version.pool.category}" %> <%= link_to "»", pool_versions_path(search: { pool_id: pool_version.pool_id }), class: "pool-category-#{pool_version.pool.category}" %> <% end %> - <% t.column "Changes", class: "col-expand" do |pool_version| %> + <% t.column "Changes", td: { class: "col-expand" } do |pool_version| %> <%= render "pool_versions/diff", diff: pool_version.build_diff %> <% end %> <% t.column "Post Count" do |pool_version| %> @@ -29,7 +29,7 @@ <%= compact_time pool_version.updated_at %> <% end %> <% if pool_versions_listing_type == :revert %> - <% t.column "" do |pool_version| %> + <% t.column do |pool_version| %> <%= link_to "Revert to", revert_pool_path(pool_version.pool_id, :version_id => pool_version.id), :method => :put, :remote => true %> <% end %> <% end %> diff --git a/app/views/pools/index.html.erb b/app/views/pools/index.html.erb index c5955a8df..48e8817da 100644 --- a/app/views/pools/index.html.erb +++ b/app/views/pools/index.html.erb @@ -3,7 +3,6 @@ <%= render "search", :path => pools_path %> <%= table_for @pools, width: "100%" do |t| %> - <% t.column nil, {width: "5%"} %> <% t.column "Name", {width: "60%"} do |pool| %> <%= link_to pool.pretty_name, pool_path(pool) %> <% if pool.is_deleted? %> diff --git a/app/views/post_events/index.html.erb b/app/views/post_events/index.html.erb index 57effc0af..5f27ee763 100644 --- a/app/views/post_events/index.html.erb +++ b/app/views/post_events/index.html.erb @@ -3,7 +3,7 @@

Post Events

<%= table_for @events, class: "striped autofit", width: "100%" do |t| %> - <% t.column :type_name, nil, { name: "Type" } %> + <% t.column :type_name, name: "Type" %> <% t.column "User" do |event| %> <% if event.is_creator_visible? %> <%= link_to_user event.creator %> @@ -12,12 +12,12 @@ <% end %>
<%= time_ago_in_words_tagged event.created_at %> <% end %> - <% t.column "Description", {}, { class: "col-expand" } do |event| %> + <% t.column "Description", td: { class: "col-expand" } do |event| %>
<%= format_text event.reason %>
<% end %> - <% t.column :is_resolved, {}, name: "Resolved" %> + <% t.column :is_resolved, name: "Resolved" %> <% end %>
diff --git a/app/views/post_versions/_listing.html.erb b/app/views/post_versions/_listing.html.erb index 4fe37b168..13eff5c82 100644 --- a/app/views/post_versions/_listing.html.erb +++ b/app/views/post_versions/_listing.html.erb @@ -5,7 +5,7 @@ <%= table_for @post_versions, {id: "post-versions-table", class: "striped autofit"} do |t| %> <% if CurrentUser.user.is_builder? %> - <% t.column tag.label(tag.input type: :checkbox, id: "post-version-select-all-checkbox", class: "post-version-select-checkbox"), { class: "post-version-select-column" } do |post_version| %> + <% t.column tag.label(tag.input type: :checkbox, id: "post-version-select-all-checkbox", class: "post-version-select-checkbox"), th: { class: "post-version-select-column" }, td: { class: "post-version-select-column" } do |post_version| %> > <% end %> <% end %> @@ -17,7 +17,7 @@ <% t.column "Version" do |post_version| %> <%= link_to "#{post_version.post_id}.#{post_version.version}", post_versions_path(search: { post_id: post_version.post_id }, anchor: "post-version-#{post_version.id}") %> <% end %> - <% t.column "Tags", {class: "col-expand"} do |post_version| %> + <% t.column "Tags", td: {class: "col-expand"} do |post_version| %> <%= post_version_diff(post_version) %> <% end %> <% t.column "Updated" do |post_version| %> @@ -30,7 +30,7 @@ <% end %> <% end %> - <% t.column "" do |post_version| %> + <% t.column do |post_version| %> <% if post_version.can_undo?(CurrentUser.user) %> <%= link_to "Undo", undo_post_version_path(post_version), method: :put, remote: true, class: "post-version-undo-link" %> <% end %> diff --git a/app/views/post_votes/index.html.erb b/app/views/post_votes/index.html.erb index ded591da9..4cf009465 100644 --- a/app/views/post_votes/index.html.erb +++ b/app/views/post_votes/index.html.erb @@ -12,7 +12,7 @@ <% t.column "Post" do |vote| %> <%= PostPresenter.preview(vote.post, show_deleted: true) %> <% end %> - <% t.column "Tags", nil, {class: "col-expand"} do |vote| %> + <% t.column "Tags", td: {class: "col-expand"} do |vote| %> <%= TagSetPresenter.new(vote.post.tag_array).inline_tag_list_html %> <% end %> <% t.column "Score" do |vote| %> @@ -28,7 +28,7 @@ <%= link_to "»", post_votes_path(search: { user_name: vote.user.name }) %>
<%= time_ago_in_words_tagged(vote.created_at) %>
<% end %> - <% t.column "" do |vote| %> + <% t.column do |vote| %> <% if vote.user == CurrentUser.user %> <%= link_to "unvote", post_post_votes_path(vote.post), remote: true, method: :delete %> <% end %> diff --git a/app/views/saved_searches/index.html.erb b/app/views/saved_searches/index.html.erb index 421deb996..438373586 100644 --- a/app/views/saved_searches/index.html.erb +++ b/app/views/saved_searches/index.html.erb @@ -15,10 +15,10 @@ <% end %> <%= table_for @saved_searches, {class: "striped autofit", width: "100%"} do |t| %> - <% t.column "Query", {"data-sort": "string"}, {class: "col-expand"} do |ss| %> + <% t.column "Query", th: {"data-sort": "string"}, td: {class: "col-expand"} do |ss| %> <%= link_to ss.query, posts_path(tags: ss.query) %> <% end %> - <% t.column "Labels", {"data-sort": "string"} do |ss| %> + <% t.column "Labels", th: {"data-sort": "string"} do |ss| %> <% ss.labels.each do |label| %> <%= link_to label, posts_path(:tags => "search:#{label}") %> <% end %> @@ -36,7 +36,7 @@ <% t.column "Created" do |ss| %> <%= time_ago_in_words_tagged ss.created_at %> <% end %> - <% t.column "", {class: "links"}, {class: "links"} do |ss| %> + <% t.column th: {class: "links"}, td: {class: "links"} do |ss| %> <%= link_to "edit", edit_saved_search_path(ss) %> | <%= link_to "delete", saved_search_path(ss), :method => :delete, :remote => true %> <% end %> diff --git a/app/views/tag_aliases/_listing.html.erb b/app/views/tag_aliases/_listing.html.erb index 9a69d3a01..3d0dfd7be 100644 --- a/app/views/tag_aliases/_listing.html.erb +++ b/app/views/tag_aliases/_listing.html.erb @@ -16,7 +16,7 @@ <% t.column "Status", {width: "5%"} do |tag_alias| %> <%= tag_alias.status %> <% end %> - <% t.column "", {width: "15%"} do |tag_alias| %> + <% t.column width: "15%" do |tag_alias| %> <%= link_to "Show", tag_alias_path(tag_alias) %> <% if tag_alias.is_pending? && tag_alias.editable_by?(CurrentUser.user) %> diff --git a/app/views/tag_implications/_listing.html.erb b/app/views/tag_implications/_listing.html.erb index 5fd7fc768..305a662b2 100644 --- a/app/views/tag_implications/_listing.html.erb +++ b/app/views/tag_implications/_listing.html.erb @@ -16,7 +16,7 @@ <% t.column "Status", {width: "5%"} do |tag_implication| %> <%= tag_implication.status %> <% end %> - <% t.column "", {width: "15%"} do |tag_implication| %> + <% t.column width: "15%" do |tag_implication| %> <%= link_to "Show", tag_implication_path(tag_implication) %> <% if tag_implication.is_pending? && tag_implication.editable_by?(CurrentUser.user) %> diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 94d21adcf..96dc2b32e 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -3,8 +3,8 @@ <%= render "search" %> <%= table_for @tags, {class: "striped autofit"} do |t| %> - <% t.column :post_count, nil, {name: "Count"} %> - <% t.column "Name", nil, {class: "col-expand"} do |tag| %> + <% t.column :post_count, name: "Count" %> + <% t.column "Name", td: {class: "col-expand"} do |tag| %> <%= link_to_wiki "?", tag.name, class: "tag-type-#{tag.category}" %> <%= link_to tag.name, posts_path(tags: tag.name), class: "tag-type-#{tag.category}" %> <% end %> diff --git a/app/views/uploads/index.html.erb b/app/views/uploads/index.html.erb index 583b30420..28a33a483 100644 --- a/app/views/uploads/index.html.erb +++ b/app/views/uploads/index.html.erb @@ -7,7 +7,7 @@ <% t.column "Upload" do |upload| %> <%= PostPresenter.preview(upload.post, tags: "user:#{upload.uploader.name}", show_deleted: true) %> <% end %> - <% t.column "Info", nil, {class: "col-expand upload-info"} do |upload| %> + <% t.column "Info", td: {class: "col-expand upload-info"} do |upload| %> Upload <%= link_to "##{upload.id}", upload %> @@ -54,7 +54,7 @@ <%= link_to "»", uploads_path(search: params[:search].merge(uploader_name: upload.uploader.name)) %>
<%= time_ago_in_words_tagged upload.created_at %> <% end %> - <% t.column "Status", nil, {class: "col-normal"} do |upload| %> + <% t.column "Status", td: {class: "col-normal"} do |upload| %> <%= render_status(upload) %> <% end %> <% end %> diff --git a/app/views/user_feedbacks/index.html.erb b/app/views/user_feedbacks/index.html.erb index 54d973fc0..36b63c89a 100644 --- a/app/views/user_feedbacks/index.html.erb +++ b/app/views/user_feedbacks/index.html.erb @@ -18,7 +18,7 @@ <%= link_to_user feedback.user %> <%= link_to "»", user_feedbacks_path(search: { user_name: feedback.user.name }) %> <% end %> - <% t.column "Message", nil, {class: "col-expand"} do |feedback| %> + <% t.column "Message", td: {class: "col-expand"} do |feedback| %>
<%= format_text(feedback.body) %>
@@ -37,7 +37,7 @@ <%= link_to "»", user_feedbacks_path(search: { creator_name: feedback.creator.name }) %>
<%= time_ago_in_words_tagged(feedback.created_at) %>
<% end %> - <% t.column "" do |feedback| %> + <% t.column do |feedback| %> <% if feedback.editable_by?(CurrentUser.user) %> <%= link_to "edit", edit_user_feedback_path(feedback) %> <% if feedback.deletable_by?(CurrentUser.user) && !feedback.is_deleted? %> diff --git a/app/views/user_name_change_requests/index.html.erb b/app/views/user_name_change_requests/index.html.erb index b130ef42d..3a275c9cb 100644 --- a/app/views/user_name_change_requests/index.html.erb +++ b/app/views/user_name_change_requests/index.html.erb @@ -15,7 +15,7 @@ <% t.column "Date" do |change_request| %> <%= compact_time change_request.created_at %> <% end %> - <% t.column "" do |change_request| %> + <% t.column do |change_request| %> <%= link_to "view", user_name_change_request_path(change_request) %> <% end %> <% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index dff758873..182ae9436 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,7 +3,7 @@

Users

<%= table_for @users, width: "100%" do |t| %> - <% t.column "" do |user| %> + <% t.column do |user| %> <% if CurrentUser.is_admin? %> <%= link_to "Edit", edit_admin_user_path(user) %> <% end %> diff --git a/app/views/wiki_page_versions/_global_listing.html.erb b/app/views/wiki_page_versions/_global_listing.html.erb index b349cc8f9..108a0e36b 100644 --- a/app/views/wiki_page_versions/_global_listing.html.erb +++ b/app/views/wiki_page_versions/_global_listing.html.erb @@ -1,7 +1,7 @@
<%= 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| %> diff --git a/app/views/wiki_page_versions/_page_listing.html.erb b/app/views/wiki_page_versions/_page_listing.html.erb index 94d9d31f1..292ff6729 100644 --- a/app/views/wiki_page_versions/_page_listing.html.erb +++ b/app/views/wiki_page_versions/_page_listing.html.erb @@ -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| %>