commit:     99121ff1198b8e5b7ceafa3be36249d398008f85
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sun Feb 22 11:17:18 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sun Feb 22 11:17:18 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=99121ff1

Responsiveness fix #4: Message tables

---
 public/css/main.css | 32 +++++++++++++++++---------------
 views/listmonth.erb | 26 ++++++++++++++------------
 2 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/public/css/main.css b/public/css/main.css
index 67488de..bd52860 100644
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -5,24 +5,26 @@
   display: block;
 }
 
-.ag-message-table {
-  width: 100%;
-  table-layout: fixed;
-}
+@media (min-width: 768px) {
+  .ag-message-table {
+    width: 100%;
+    table-layout: fixed;
+  }
 
-.ag-message-table td {
-  text-overflow: ellipsis;
-  max-height: 1.2em;
-  overflow: hidden;
-  white-space: nowrap;
-}
+  .ag-message-table td {
+    text-overflow: ellipsis;
+    max-height: 1.2em;
+    overflow: hidden;
+    white-space: nowrap;
+  }
 
-.ag-message-table-date {
-  width: 22%;
-}
+  .ag-message-table-date {
+    width: 22%;
+  }
 
-.ag-message-table-from {
-  width: 18%;
+  .ag-message-table-from {
+    width: 18%;
+  }
 }
 
 .ag-quote {

diff --git a/views/listmonth.erb b/views/listmonth.erb
index a986eb8..485df49 100644
--- a/views/listmonth.erb
+++ b/views/listmonth.erb
@@ -12,19 +12,21 @@
 </div>
 <% end %>
 
-<table class="table table-condensed table-hover ag-message-table">
-  <tr>
-    <th class="ag-message-table-subject">Subject</th>
-    <th class="ag-message-table-from">From</th>
-    <th class="ag-message-table-date">Date</th>
-  </tr>
-  <% results['hits']['hits'].each do |message| %>
+<div class="table-responsive">
+  <table class="table table-condensed table-hover ag-message-table">
     <tr>
-      <td><a href="../../message/<%= message['_id'] %>"><%= h 
message['_source']['subject'] %></a></td>
-      <td><%= h message['_source']['from_realname'] %></td>
-      <td><%= date_format message['_source']['date'] %></td>
+      <th class="ag-message-table-subject">Subject</th>
+      <th class="ag-message-table-from">From</th>
+      <th class="ag-message-table-date">Date</th>
     </tr>
-  <% end %>
-</table>
+    <% results['hits']['hits'].each do |message| %>
+      <tr>
+        <td><a href="../../message/<%= message['_id'] %>"><%= h 
message['_source']['subject'] %></a></td>
+        <td><%= h message['_source']['from_realname'] %></td>
+        <td><%= date_format message['_source']['date'] %></td>
+      </tr>
+    <% end %>
+  </table>
+</div>
 
 <%= partial :pagination, locals: { current_page: current_page, max_pages: 
max_pages } %>
\ No newline at end of file

Reply via email to