From f1528e0faef9c79268980e40d6c1d88b1cecfa3d Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 6 Jan 2020 02:12:04 -0600 Subject: [PATCH] table builder: add 'striped' css class by default. --- app/logical/table_builder.rb | 4 ++-- app/views/artist_commentaries/index.html.erb | 2 +- app/views/bulk_update_requests/_listing.html.erb | 2 +- app/views/dmails/index.html.erb | 2 +- app/views/favorite_groups/index.html.erb | 2 +- app/views/forum_posts/index.html.erb | 2 +- app/views/forum_topics/_listing.html.erb | 4 ++-- app/views/ip_bans/index.html.erb | 2 +- app/views/news_updates/index.html.erb | 2 +- app/views/pools/index.html.erb | 2 +- app/views/post_appeals/index.html.erb | 2 +- app/views/post_approvals/index.html.erb | 2 +- app/views/post_flags/index.html.erb | 2 +- app/views/tag_aliases/_listing.html.erb | 2 +- app/views/tag_implications/_listing.html.erb | 2 +- app/views/user_name_change_requests/index.html.erb | 2 +- app/views/users/index.html.erb | 2 +- app/views/wiki_page_versions/_global_listing.html.erb | 2 +- app/views/wiki_page_versions/_page_listing.html.erb | 2 +- app/views/wiki_pages/index.html.erb | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/logical/table_builder.rb b/app/logical/table_builder.rb index 7260fd33d..ccda7e0b3 100644 --- a/app/logical/table_builder.rb +++ b/app/logical/table_builder.rb @@ -24,10 +24,10 @@ class TableBuilder attr_reader :columns, :table_attributes, :items - def initialize(items, table_attributes=nil) + def initialize(items, **table_attributes) @items = items @columns = [] - @table_attributes = table_attributes + @table_attributes = { class: "striped", **table_attributes } yield self if block_given? end diff --git a/app/views/artist_commentaries/index.html.erb b/app/views/artist_commentaries/index.html.erb index ddb774837..c5c3ef765 100644 --- a/app/views/artist_commentaries/index.html.erb +++ b/app/views/artist_commentaries/index.html.erb @@ -4,7 +4,7 @@ <%= render "posts/partials/common/inline_blacklist" %> - <%= table_for @commentaries, {class: "striped", width: "100%"} do |t| %> + <%= table_for @commentaries, width: "100%" do |t| %> <% t.column "Post", {width: "1%"} do |commentary| %> <%= PostPresenter.preview(commentary.post, :tags => "status:any") %> <% end %> diff --git a/app/views/bulk_update_requests/_listing.html.erb b/app/views/bulk_update_requests/_listing.html.erb index f5ce9b4a7..f294765df 100644 --- a/app/views/bulk_update_requests/_listing.html.erb +++ b/app/views/bulk_update_requests/_listing.html.erb @@ -1,4 +1,4 @@ -<%= table_for bulk_update_requests, {class: "striped", width: "100%"} do |t| %> +<%= table_for bulk_update_requests, width: "100%" do |t| %> <% t.column "Request" do |request| %> <% if request.forum_post.present? %>

<%= link_to "Topic ##{request.forum_topic_id}: #{request.forum_topic.title}", forum_topic_path(request.forum_topic_id, page: request.forum_post.forum_topic_page, anchor: "forum_post_#{request.forum_post_id}") %>

diff --git a/app/views/dmails/index.html.erb b/app/views/dmails/index.html.erb index 10c7e8047..b8ab751c1 100644 --- a/app/views/dmails/index.html.erb +++ b/app/views/dmails/index.html.erb @@ -10,7 +10,7 @@ <%= render "search" %> - <%= table_for @dmails, {class: "striped", width: "100%"} do |t| %> + <%= table_for @dmails, width: "100%" do |t| %> <% t.column "Date" do |dmail| %> <%= compact_time(dmail.created_at) %> <% end %> diff --git a/app/views/favorite_groups/index.html.erb b/app/views/favorite_groups/index.html.erb index f3c83d406..9b1dc3eef 100644 --- a/app/views/favorite_groups/index.html.erb +++ b/app/views/favorite_groups/index.html.erb @@ -1,7 +1,7 @@
- <%= table_for @favorite_groups, {class: "striped", width: "100%"} do |t| %> + <%= 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) %> diff --git a/app/views/forum_posts/index.html.erb b/app/views/forum_posts/index.html.erb index 040f87155..a31130969 100644 --- a/app/views/forum_posts/index.html.erb +++ b/app/views/forum_posts/index.html.erb @@ -1,7 +1,7 @@
- <%= table_for @forum_posts, {class: "striped", width: "100%"} do |t| %> + <%= table_for @forum_posts, width: "100%" do |t| %> <% t.column "Topic", nil, {class: "forum-post-topic-title"} do |forum_post| %> <%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %> <% end %> diff --git a/app/views/forum_topics/_listing.html.erb b/app/views/forum_topics/_listing.html.erb index 8121940e4..298e24a39 100644 --- a/app/views/forum_topics/_listing.html.erb +++ b/app/views/forum_topics/_listing.html.erb @@ -1,4 +1,4 @@ -<%= table_for forum_topics, {class: "striped", width: "100%"} do |t| %> +<%= table_for forum_topics, width: "100%" do |t| %> <% t.column "Title" do |topic| %> <% if topic.is_sticky? %> Sticky: @@ -40,4 +40,4 @@ .updated-at { display: none; } } -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/ip_bans/index.html.erb b/app/views/ip_bans/index.html.erb index 1905e676a..f3a8e9eb0 100644 --- a/app/views/ip_bans/index.html.erb +++ b/app/views/ip_bans/index.html.erb @@ -2,7 +2,7 @@

IP Bans

- <%= table_for @ip_bans, {class: "striped", width: "100%"} do |t| %> + <%= table_for @ip_bans, width: "100%" do |t| %> <% t.column "IP Address" do |ip_ban| %> <%= link_to_ip ip_ban.subnetted_ip %> <% end %> diff --git a/app/views/news_updates/index.html.erb b/app/views/news_updates/index.html.erb index 3326f8e8e..2245bc6b0 100644 --- a/app/views/news_updates/index.html.erb +++ b/app/views/news_updates/index.html.erb @@ -2,7 +2,7 @@

News Updates

- <%= table_for @news_updates, {class: "striped", width: "100%"} do |t| %> + <%= table_for @news_updates, width: "100%" do |t| %> <% t.column "Creator" do |news_update| %> <%= link_to_user news_update.creator %> <% end %> diff --git a/app/views/pools/index.html.erb b/app/views/pools/index.html.erb index 29b798c28..c5955a8df 100644 --- a/app/views/pools/index.html.erb +++ b/app/views/pools/index.html.erb @@ -2,7 +2,7 @@
<%= render "search", :path => pools_path %> - <%= table_for @pools, {class: "striped", width: "100%"} do |t| %> + <%= 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) %> diff --git a/app/views/post_appeals/index.html.erb b/app/views/post_appeals/index.html.erb index 6d99b37b6..a1e7853bb 100644 --- a/app/views/post_appeals/index.html.erb +++ b/app/views/post_appeals/index.html.erb @@ -4,7 +4,7 @@ <%= render "search" %> <%= render "posts/partials/common/inline_blacklist" %> - <%= table_for @post_appeals, {class: "striped", width: "100%"} do |t| %> + <%= table_for @post_appeals, width: "100%" do |t| %> <% t.column "Post", {width: "1%"} do |post_appeal| %> <%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %> <% end %> diff --git a/app/views/post_approvals/index.html.erb b/app/views/post_approvals/index.html.erb index 83e667b25..8955aeff5 100644 --- a/app/views/post_approvals/index.html.erb +++ b/app/views/post_approvals/index.html.erb @@ -9,7 +9,7 @@ <%= f.submit "Search" %> <% end %> - <%= table_for @post_approvals, {class: "striped", width: "100%"} do |t| %> + <%= table_for @post_approvals, width: "100%" do |t| %> <% t.column "Post", {width: "1%"} do |post_approval| %> <%= PostPresenter.preview(post_approval.post, :tags => "status:any") %> <% end %> diff --git a/app/views/post_flags/index.html.erb b/app/views/post_flags/index.html.erb index 2b66c1168..c20847856 100644 --- a/app/views/post_flags/index.html.erb +++ b/app/views/post_flags/index.html.erb @@ -4,7 +4,7 @@ <%= render "search" %> <%= render "posts/partials/common/inline_blacklist" %> - <%= table_for @post_flags, {class: "striped", width: "100%"} do |t| %> + <%= table_for @post_flags, width: "100%" do |t| %> <% t.column "Post", {width: "1%"} do |post_flag| %> <%= PostPresenter.preview(post_flag.post, :tags => "status:any") %> <% end %> diff --git a/app/views/tag_aliases/_listing.html.erb b/app/views/tag_aliases/_listing.html.erb index 0b5a405db..9a69d3a01 100644 --- a/app/views/tag_aliases/_listing.html.erb +++ b/app/views/tag_aliases/_listing.html.erb @@ -1,4 +1,4 @@ -<%= table_for tag_aliases, {class: "striped", width: "100%"} do |t| %> +<%= table_for tag_aliases, width: "100%" do |t| %> <% t.column "From", {width: "25%"} do |tag_alias| %> <%= link_to tag_alias.antecedent_name, posts_path(:tags => tag_alias.antecedent_name) %> <%= tag_alias.antecedent_tag.post_count rescue 0 %> <% end %> diff --git a/app/views/tag_implications/_listing.html.erb b/app/views/tag_implications/_listing.html.erb index 1b0905869..5fd7fc768 100644 --- a/app/views/tag_implications/_listing.html.erb +++ b/app/views/tag_implications/_listing.html.erb @@ -1,4 +1,4 @@ -<%= table_for tag_implications, {class: "striped", width: "100%"} do |t| %> +<%= table_for tag_implications, width: "100%" do |t| %> <% t.column "From", {width: "25%"} do |tag_implication| %> <%= link_to tag_implication.antecedent_name, posts_path(:tags => tag_implication.antecedent_name) %> <%= tag_implication.antecedent_tag.post_count rescue 0 %> <% end %> diff --git a/app/views/user_name_change_requests/index.html.erb b/app/views/user_name_change_requests/index.html.erb index 7e6d7c74d..b130ef42d 100644 --- a/app/views/user_name_change_requests/index.html.erb +++ b/app/views/user_name_change_requests/index.html.erb @@ -2,7 +2,7 @@

Name Change Requests

- <%= table_for @change_requests, {class: "striped", width: "100%"} do |t| %> + <%= table_for @change_requests, width: "100%" do |t| %> <% t.column "User" do |change_request| %> <%= link_to_user change_request.user %> <% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4426ecfb9..dff758873 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -2,7 +2,7 @@

Users

- <%= table_for @users, {class: "striped", width: "100%"} do |t| %> + <%= table_for @users, width: "100%" do |t| %> <% t.column "" do |user| %> <% if CurrentUser.is_admin? %> <%= link_to "Edit", edit_admin_user_path(user) %> diff --git a/app/views/wiki_page_versions/_global_listing.html.erb b/app/views/wiki_page_versions/_global_listing.html.erb index 9b6cc3a1e..b349cc8f9 100644 --- a/app/views/wiki_page_versions/_global_listing.html.erb +++ b/app/views/wiki_page_versions/_global_listing.html.erb @@ -1,6 +1,6 @@
- <%= table_for @wiki_page_versions, {class: "striped", width: "100%"} do |t| %> + <%= table_for @wiki_page_versions, width: "100%" do |t| %> <% 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 %> diff --git a/app/views/wiki_page_versions/_page_listing.html.erb b/app/views/wiki_page_versions/_page_listing.html.erb index d5f220236..94d9d31f1 100644 --- a/app/views/wiki_page_versions/_page_listing.html.erb +++ b/app/views/wiki_page_versions/_page_listing.html.erb @@ -1,7 +1,7 @@
<%= form_tag(diff_wiki_page_versions_path, :method => :get) do %> - <%= table_for @wiki_page_versions, {class: "striped", width: "100%"} do |t| %> + <%= table_for @wiki_page_versions, width: "100%" do |t| %> <% 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) %> diff --git a/app/views/wiki_pages/index.html.erb b/app/views/wiki_pages/index.html.erb index 8a6b5e798..9033b7c1f 100644 --- a/app/views/wiki_pages/index.html.erb +++ b/app/views/wiki_pages/index.html.erb @@ -3,7 +3,7 @@ <% content_for(:content) do %>

Wiki

- <%= table_for @wiki_pages, {class: "striped", width: "100%"} do |t| %> + <%= table_for @wiki_pages, width: "100%" do |t| %> <% t.column "Title" do |wiki_page| %> <%= link_to_wiki wiki_page.title %> <% end %>