Commit cc1fbb9b

mo <mokha@cisco.com>
2017-09-02 17:16:48
upgrade the dashboard views.
1 parent 1b8c52e
Changed files (3)
app/views/my/dashboard/_creation.html.erb
@@ -1,16 +1,13 @@
 <div class="media">
-  <%= link_to my_root_path(anchor: "cakes/#{item.id}"), class: 'pull-left' do %>
-    <img class="media-object" data-src="<%= item.primary_image.url_for(:thumb) %>" alt="64x64" style="width: 64px; height: 64px;" src="<%= item.primary_image.url_for(:thumb) %>">
+  <%= link_to my_root_path(anchor: "cakes/#{item.id}") do %>
+    <%= image_tag item.primary_image.url_for(:thumb), class: 'd-flex mr-3', width: '64px' %>
   <% end %>
   <div class="media-body">
-    <h4 class="media-heading"><%= link_to item.name, my_root_path(anchor: "cakes/#{item.id}") %></h4>
+    <h5 class="mt-0 mb-1"><%= item.name %></h5>
     <p>
-    <%= link_to my_root_path(anchor: "cakes/#{item.id}/edit") do %>
-      <i class="fa fa-pencil-square-o"></i> edit
-    <% end %>
-    <%= link_to cake_favorites_path(cake_id: item.id) do %>
-      <i class="fa fa-heart"></i> fanclub
-    <% end %>
+      <%= link_to my_root_path(anchor: "cakes/#{item.id}/edit") do %>
+        <i class="fa fa-pencil-square-o"></i> edit
+      <% end %>
     </p>
   </div>
 </div>
app/views/my/dashboard/_tutorial.html.erb
@@ -1,5 +1,1 @@
-<div class="media">
-  <div class="media-body">
-    <h4 class="media-heading"><%= link_to item.heading, my_root_path(anchor: "tutorials/#{item.id}") %></h4>
-  </div>
-</div>
+<li><%= link_to truncate(item.heading, length: 40), my_root_path(anchor: "tutorials/#{item.id}") %></li>
app/views/my/dashboard/index.html.erb
@@ -5,13 +5,15 @@
   </div>
   <div class="col-9" data-no-turbolink>
     <div class="row">
-      <div class="col-5">
+      <div class="col">
         <h5>My Cakes</h5>
-        <% @cakes.each do |item| %>
-          <%= render item.class.to_s.downcase, item: item %>
-        <% end %>
+        <ul class="list-unstyled">
+          <% @cakes.each do |item| %>
+            <%= render item.class.to_s.downcase, item: item %>
+          <% end %>
+        </ul>
       </div>
-      <div class="col-5">
+      <div class="col">
         <div class="well">
           <h5>My Notifications</h5>
           <% if @activities.empty? %>
@@ -22,11 +24,14 @@
             <% end %>
           <% end %>
         </div>
+
         <% if @tutorials.any? %>
           <h5>My Tutorials</h5>
-          <% @tutorials.each do |item| %>
-            <%= render item.class.to_s.downcase, item: item %>
-          <% end %>
+          <ol>
+            <% @tutorials.each do |item| %>
+              <%= render item.class.to_s.downcase, item: item %>
+            <% end %>
+          </ol>
         <% end %>
       </div>
     </div>