From 055a9760511f270e17ab200b6caa0a6301866328 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 1 Apr 2020 12:06:36 +0200 Subject: [PATCH] Remove custom table styling This removes the custom table styling code, and move to using bootstrap table styling for almost all remaining tables. --- app/assets/stylesheets/common.scss | 75 +------------------- app/views/issues/index.html.erb | 4 +- app/views/messages/inbox.html.erb | 2 +- app/views/messages/outbox.html.erb | 2 +- app/views/notes/mine.html.erb | 2 +- app/views/oauth_clients/index.html.erb | 2 +- app/views/site/key.html.erb | 4 +- app/views/traces/_trace.html.erb | 2 +- app/views/traces/show.html.erb | 2 +- test/controllers/messages_controller_test.rb | 4 +- test/controllers/traces_controller_test.rb | 2 +- 11 files changed, 16 insertions(+), 85 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 9b6b69db7..a13f73d7a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -92,25 +92,6 @@ a { } } -/* General styles for tables */ - -table { - width: 100%; - margin-bottom: $lineheight; - th, td { - text-align: left; - padding: $lineheight/4; - line-height: $lineheight; - } - th { - font-weight: 600; - vertical-align: top; - } - td { - vertical-align: middle; - } -} - /* Utility for de-emphasizing content */ .deemphasize { @@ -873,9 +854,6 @@ header .search_forms, margin-left: auto; margin-right: auto; } - td { - padding: 0 $lineheight/4 $lineheight/4 $lineheight/4; - } } /* Rules for search sidebar */ @@ -1029,6 +1007,7 @@ tr.turn:hover { table-layout: fixed; border-collapse: separate; border-spacing: 0; + width: 100%; th, td { border-bottom: 1px solid $grey; @@ -1300,18 +1279,6 @@ tr.turn:hover { float: right; } -/* Rules for the trace list shown by the traces tab etc */ - -#trace_list { - border-width: 0px; - text-align: right; - - .trace_summary { - font-size: 12px; - color: gray; - } -} - /* Rules for the new trace form */ #new_trace { @@ -1624,43 +1591,21 @@ tr.turn:hover { /* Rules for messages pages */ .messages { - width: 100%; - border: 1px solid $grey; - input[type="submit"] { margin: auto; } - tbody tr { - border-top: 1px solid $grey; - } .inbox-row { background: $offwhite; } .inbox-row-unread { - background:#CBEEA7; + background: #CBEEA7; } .right { float: right; } - - tr td, - tr th { - padding: $lineheight/4; - } - p:last-child, - h2:last-child, - h3:last-child, - ol:last-child, - ul:last-child { - margin-bottom:0; - } - tr td { - height: 30px; - border-right: 1px solid $lightgrey; - } } .inbox-row .inbox-mark-read { @@ -2192,15 +2137,7 @@ input.richtext_title[type="text"] { .note_list { tr.creator { - background-color: $lightgrey; - } - - td { - padding: 3px; - } - - p { - margin-bottom: 0px; + background-color: $offwhite; } } @@ -2408,9 +2345,3 @@ input.richtext_title[type="text"] { background: $lightgrey; opacity: 0.7; } - -.issues-list { - td:nth-child(2) { - white-space: nowrap; - } -} diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 1c45f4124..1f3ca3118 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -18,7 +18,7 @@
- +
@@ -32,7 +32,7 @@ <% @issues.each do |issue| %> - +
<%= t ".status" %>
<%= t ".states.#{issue.status}" %><%= link_to t(".reports_count", :count => issue.reports_count), issue %><%= link_to t(".reports_count", :count => issue.reports_count), issue %> <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, user_path(issue.reported_user) if issue.reported_user %> diff --git a/app/views/messages/inbox.html.erb b/app/views/messages/inbox.html.erb index c3065f911..0fb5107ce 100644 --- a/app/views/messages/inbox.html.erb +++ b/app/views/messages/inbox.html.erb @@ -9,7 +9,7 @@

<%= render :partial => "message_count" %>

<% if current_user.messages.size > 0 %> - +
diff --git a/app/views/messages/outbox.html.erb b/app/views/messages/outbox.html.erb index 806f1207a..5ae9706b7 100644 --- a/app/views/messages/outbox.html.erb +++ b/app/views/messages/outbox.html.erb @@ -9,7 +9,7 @@

<%= t ".messages", :count => current_user.sent_messages.size %>

<% if current_user.sent_messages.size > 0 %> -
<%= t ".from" %>
+
diff --git a/app/views/notes/mine.html.erb b/app/views/notes/mine.html.erb index 266349b30..2f68ba5c6 100644 --- a/app/views/notes/mine.html.erb +++ b/app/views/notes/mine.html.erb @@ -5,7 +5,7 @@ <%= render :partial => "notes_paging_nav" %> -
<%= t ".to" %>
+
diff --git a/app/views/oauth_clients/index.html.erb b/app/views/oauth_clients/index.html.erb index 0ce09d57c..113374e3f 100644 --- a/app/views/oauth_clients/index.html.erb +++ b/app/views/oauth_clients/index.html.erb @@ -5,7 +5,7 @@ <% unless @tokens.empty? %>

<%= t ".my_tokens" %>

<%= t ".list_tokens" %>

-
+
diff --git a/app/views/site/key.html.erb b/app/views/site/key.html.erb index 317266b1f..e43d2c29a 100644 --- a/app/views/site/key.html.erb +++ b/app/views/site/key.html.erb @@ -1,9 +1,9 @@
-
<%= t ".application" %>
+
<% YAML.load_file(Rails.root.join("config/key.yml")).each do |name,data| %> <% data.each do |entry| %> " data-zoom-max="<%= entry["max_zoom"] %>"> -
+ <%= image_tag "key/#{name}/#{entry['image']}" %> diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 8c662ef87..8980cb8f2 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -9,7 +9,7 @@ <% end %> <%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %> - ... + ... <% if trace.inserted %> (<%= t ".count_points", :count => trace.size %>) <% end %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index e65245369..19d1b06b8 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -10,7 +10,7 @@ <% end %> <% end %> - +
diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index 0348163ba..35bd4dc9f 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -344,7 +344,7 @@ class MessagesControllerTest < ActionController::TestCase get :inbox assert_response :success assert_template "inbox" - assert_select "table.messages", :count => 1 do + assert_select ".content-inner > table", :count => 1 do assert_select "tr", :count => 2 assert_select "tr#inbox-#{read_message.id}.inbox-row", :count => 1 end @@ -367,7 +367,7 @@ class MessagesControllerTest < ActionController::TestCase get :outbox assert_response :success assert_template "outbox" - assert_select "table.messages", :count => 1 do + assert_select ".content-inner > table", :count => 1 do assert_select "tr", :count => 2 assert_select "tr.inbox-row", :count => 1 end diff --git a/test/controllers/traces_controller_test.rb b/test/controllers/traces_controller_test.rb index 72a375939..7e13ff54f 100644 --- a/test/controllers/traces_controller_test.rb +++ b/test/controllers/traces_controller_test.rb @@ -721,7 +721,7 @@ class TracesControllerTest < ActionController::TestCase assert_select "tr", :count => traces.length do |rows| traces.zip(rows).each do |trace, row| assert_select row, "a", Regexp.new(Regexp.escape(trace.name)) - assert_select row, "span.trace_summary", Regexp.new(Regexp.escape("(#{trace.size} points)")) if trace.inserted? + assert_select row, "span", Regexp.new(Regexp.escape("(#{trace.size} points)")) if trace.inserted? assert_select row, "td", Regexp.new(Regexp.escape(trace.description)) assert_select row, "td", Regexp.new(Regexp.escape("by #{trace.user.display_name}")) end -- 2.39.5
<%= t ".filename" %> <%= @trace.name %> (<%= link_to t(".download"), trace_data_path(@trace) %>)