]> git.openstreetmap.org Git - rails.git/commitdiff
Remove custom table styling
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 1 Apr 2020 10:06:36 +0000 (12:06 +0200)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 1 Apr 2020 10:29:01 +0000 (12:29 +0200)
This removes the custom table styling code, and move to using bootstrap table styling for almost all remaining tables.

app/assets/stylesheets/common.scss
app/views/issues/index.html.erb
app/views/messages/inbox.html.erb
app/views/messages/outbox.html.erb
app/views/notes/mine.html.erb
app/views/oauth_clients/index.html.erb
app/views/site/key.html.erb
app/views/traces/_trace.html.erb
app/views/traces/show.html.erb
test/controllers/messages_controller_test.rb
test/controllers/traces_controller_test.rb

index 9b6b69db797673f2cdd1a338d7c95e32d01fe9a8..a13f73d7a8ba0a2aa7228b927da1ea54e664f968 100644 (file)
@@ -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;
-  }
-}
index 1c45f41246395d9eb97d4598fef1df7db910ee1b..1f3ca3118f54b824278ab1dc09b979b6c8899a40 100644 (file)
@@ -18,7 +18,7 @@
 
 <br />
 
-<table class="issues-list">
+<table class="table table-sm">
   <thead>
     <tr>
       <th><%= t ".status" %></th>
@@ -32,7 +32,7 @@
     <% @issues.each do |issue| %>
       <tr>
         <td><%= t ".states.#{issue.status}" %></td>
-        <td><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
+        <td class="text-nowrap"><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
         <td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
         <td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user) if issue.reported_user %></td>
         <td>
index c3065f911f2de1cd2b2686df20af227852648939..0fb5107ce606aa0b946b484eb6590e06a5c45e16 100644 (file)
@@ -9,7 +9,7 @@
   <h4><%= render :partial => "message_count" %></h4>
 
 <% if current_user.messages.size > 0 %>
-  <table class="messages">
+  <table class="table table-sm">
     <thead>
       <tr>
         <th><%= t ".from" %></th>
index 806f1207ae014e5426aa56516354da6f6425b39f..5ae9706b7d6dd61f30daec44271d6e56ef5aa2af 100644 (file)
@@ -9,7 +9,7 @@
 <h4><%= t ".messages", :count => current_user.sent_messages.size %></h4>
 
 <% if current_user.sent_messages.size > 0 %>
-  <table class="messages">
+  <table class="table table-sm">
     <thead>
       <tr>
         <th><%= t ".to" %></th>
index 266349b30ab9f5d8c916f0993746529b12bd59e4..2f68ba5c61359cb89591030d033543b821cfefc7 100644 (file)
@@ -5,7 +5,7 @@
 
 <%= render :partial => "notes_paging_nav" %>
 
-<table class="note_list">
+<table class="table table-sm note_list">
   <thead>
     <tr>
       <th></th>
index 0ce09d57c9014a34df87a33f4e9b81d850d9a59f..113374e3fb2f3d33db4feac58e7f2d980cfbdaa7 100644 (file)
@@ -5,7 +5,7 @@
 <% unless @tokens.empty? %>
 <h3><%= t ".my_tokens" %></h3>
 <p><%= t ".list_tokens" %></p>
-<table>
+<table class="table table-sm">
   <thead>
     <tr>
       <th><%= t ".application" %></th>
index 317266b1fb5fb4a4afe4f82f64d329053d81f8c9..e43d2c29a3da5aa2d25d4fc007fbc51b46a6b22d 100644 (file)
@@ -1,9 +1,9 @@
 <div id="mapkey">
-  <table class="mapkey-table">
+  <table class="table table-sm table-borderless mapkey-table">
     <% YAML.load_file(Rails.root.join("config/key.yml")).each do |name,data| %>
       <% data.each do |entry| %>
         <tr class="mapkey-table-entry" data-layer="<%= name %>" data-zoom-min="<%= entry["min_zoom"] %>" data-zoom-max="<%= entry["max_zoom"] %>">
-          <td class="mapkey-table-key">
+          <td class="mapkey-table-key align-middle">
             <%= image_tag "key/#{name}/#{entry['image']}" %>
           </td>
           <td class="mapkey-table-value">
index 8c662ef8750b4b3c3865d3b32d9fdb794157faef..8980cb8f21cf2aae556845a1c26710f251379ad0 100644 (file)
@@ -9,7 +9,7 @@
     <% end %>
   </td>
   <td><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
-    <span class="trace_summary" title="<%= trace.timestamp %>"> ...
+    <span class="deemphasize" title="<%= trace.timestamp %>"> ...
       <% if trace.inserted %>
         (<%= t ".count_points", :count => trace.size %>)
       <% end %>
index e652453695b30a8942b5df14fd3420b110db9260..19d1b06b823e7b6c7a6a3d45bd8b0858aaf4ae2d 100644 (file)
@@ -10,7 +10,7 @@
   <% end %>
 <% end %>
 
-<table border="0">
+<table class="table table-borderless table-sm">
   <tr>
     <td><%= t ".filename" %></td>
     <td><%= @trace.name %> (<%= link_to t(".download"), trace_data_path(@trace) %>)</td>
index 0348163bab100535279fe5d355f48bb5dd0d7ff9..35bd4dc9f6b65dce19930b2a93229e5d9e14a1ee 100644 (file)
@@ -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
index 72a3759390850b0fdb743d133feda1a96e43ed5f..7e13ff54f2f64821d0c53fc6b01c30b651ce3644 100644 (file)
@@ -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