Commit 1b9f4040

mo <mokha@cisco.com>
2017-08-31 22:39:49
convert profile list and tutorials list pages.
1 parent a12dd24
Changed files (3)
app/views/profiles/_index.html.erb
@@ -1,23 +1,16 @@
-<div class="row-fluid">
-  <% @profiles.each_slice(6).each do |batch| %>
-    <ul class='thumbnails'>
-      <% batch.each do |profile| %>
-        <% cache profile do %>
-          <li class="span2">
-            <div class="thumbnail">
-              <%= link_to profile_path(profile) do %>
-                <%= avatar_for(profile) %>
-              <% end %>
-              <div class="caption">
-                <small><%= link_to truncate(profile.name, length: 20), profile_path(profile) %></small>
-              </div>
-            </div>
-          </li>
-        <% end %>
+<div class="card-columns">
+  <% @profiles.each do |profile| %>
+    <div class="card">
+      <%= link_to profile_path(profile) do %>
+        <%= avatar_for(profile, clazz: 'card-img-top') %>
       <% end %>
-    </ul>
+      <div class="card-body">
+        <h4 class="card-title"><%= truncate(profile.name, length: 20) %></h4>
+        <p class="card-text"><small class="text-muted">joined <%= distance_of_time_in_words_to_now profile.created_at %> ago</small></p>
+      </div>
+    </div>
   <% end %>
 </div>
-<div id='more-button-row' class="row-fluid">
+<div id='more-button-row' class="row">
   <%= link_to_next_page @profiles, 'More...', params: { cache: false }, remote: true, class: 'more-button hidden', data: { disable_with: 'loading...' } %>
 </div>
app/views/profiles/index.html.erb
@@ -1,8 +1,8 @@
 <%= provide(:search_path, profiles_path) %>
-<% provide(:container_class, 'container-fluid') %>
+<% provide(:container_class, 'container') %>
 <div id="bakery">
   <%= render partial: 'index' %>
 </div>
-<div id="pagination-row" class="row-fluid">
+<div id="pagination-row" class="row">
   <%= render "shared/paging", items: @profiles %>
 </div>
app/views/tutorials/index.html.erb
@@ -1,20 +1,22 @@
 <% provide(:search_path, tutorials_path) %>
-<div class="row-fluid">
-  <table class='table'>
-    <% @tutorials.each do |tutorial| %>
-      <tr>
-        <td>
-          <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
-          <% tutorial.tags.each do |tag| -%>
-            <%= link_to tutorial_tag_path(tag.name) do %>
-              <span class="label"><%= tag.name %></span>
-            <% end %>
-          <% end -%>
-        </td>
-      </tr>
-    <% end %>
-  </table>
+<div class="row">
+  <div class="col">
+    <table class='table table-bordered'>
+      <tbody>
+      <% @tutorials.each do |tutorial| %>
+        <tr>
+          <td>
+            <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
+            <% tutorial.tags.each do |tag| -%>
+              <%= link_to tag.name, tutorial_tag_path(tag.name), class: 'badge badge-secondary' %>
+            <% end -%>
+          </td>
+        </tr>
+      <% end %>
+      </tbody>
+    </table>
+  </div>
 </div>
-<div class="row-fluid">
+<div class="row">
   <%= render "shared/paging", items: @tutorials %>
 </div>