Commit 33c5cb2c

mo k <mo@mokhan.ca>
2012-06-14 13:07:31
move title and user to above the creation image
1 parent 6c85f83
Changed files (2)
app/views/creations/show.html.erb
@@ -11,7 +11,7 @@
   </small> 
 </h1>
 <% @creation.categories.each do |category| %>
-  <span class="label"><a href="/categories/<%= category.slug %>"><%= category.name %></a></span>
+  <a href="/categories/<%= category.slug %>"><span class="label"><%= category.name %></span></a>
 <% end %> 
 </div>
 <div class="row">
@@ -79,6 +79,7 @@
 </div>
 <br />
 <div class="row">
+  <a href="#" id="comments"></a>
   <div class="span12">
     <% unless user_signed_in? %>
       <p style="float:right;"><%= link_to "sign in", new_user_session_path %>  to comment </p>
@@ -88,9 +89,11 @@
     <table class="table table-striped">
       <% @creation.comment_threads.each do |comment| %>
         <tr>
-          <td><%= gravatar_for comment.user %></td>
-          <td><%= comment.body %></td>
-          <td><%= comment.created_at.to_s :foomat %></td>
+          <td> <%= gravatar_for(comment.user) %> </td>
+          <td>
+            <h5>On <%= comment.created_at.to_s :foomat %> <%= comment.user.name %> said...</h5>
+            <p><%= comment.body %></p>
+          </td>
         </tr>
       <% end -%>
     </table>
app/views/shared/_creation_image_gallery.html.erb
@@ -2,20 +2,18 @@
   <% @creations.each do |creation| %>
     <li class="span3">
     <div class="thumbnail">
-      <a href="<%= url_for creation %>"><img src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>" rel="nofollow" width="260" /></a>
       <div class="caption">
         <h5><a href="<%= url_for creation %>"><%= short_name(creation, 20) %></a></h5>
         <h6><a href="<%= url_for profile_path(creation.user) %>"><%= creation.user.name %></a></h6>
+      </div>
+      <a href="<%= url_for creation %>"><img src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>" rel="nofollow" width="260" /></a>
+      <div class="caption">
         <% if creation.favorites.count > 0 %>
           <span> <a href="<%= url_for creation_favorites_path(:creation_id => creation.id) %>"><%= creation.favorites.count %><i class="icon-heart"></i></a> </span>
         <% else %>
           <span>&nbsp;</span>
         <% end %>
-        <% if creation.comment_threads.count > 0 %>
-          <span class="badge badge-success" title="<%= creation.comment_threads.count %> comments"><%= creation.comment_threads.count %> </span>
-        <% else %>
-          <span>&nbsp;</span>
-        <% end %>
+        <a href="<%= url_for creation %>#comments"><span class="badge badge-success" title="<%= pluralize( creation.comment_threads.count, "comments") %>"><%= creation.comment_threads.count %></span></a>
       </div>
     </div>
     </li>