Commit a91d718f

mo k <mo@mokhan.ca>
2012-02-17 04:07:22
remove carousel and other creations from creation page, and fix favorite icon link, and hide the favorite icon if there are no favorites.
1 parent 7759c44
Changed files (3)
app/views/creations/show.html.erb
@@ -2,14 +2,6 @@
   <%= @creation.name %> by <%= @creation.user.name %>
 <% end %>
 
-<script type="text/javascript" charset="utf-8">
-  $(document).ready(function(){
-      $('.myCarousel').carousel({
-        interval: 2000
-      });
-  });
-</script>
-
 <div class="page-header">
   <h1>
     <%= @creation.name %> 
@@ -69,40 +61,3 @@
     <p><%= @creation.story %></p>
   </div>
 </div>
-<hr>
-<div class="row">
-  <div class="span12">
-    <h1>Other Creations by <small><%= link_to @creation.user.name, profile_path(@creation.user) %></small></h1>
-  </div>
-</div>
-<div class="row">
-  <div class="span3">
-    <a href="<%= url_for profile_path(@profile) %>"><img src="<%= avatar_url @profile %>&amp;s=200" alt="<%= @profile.name %>" /></a>
-  </div>
-  <div class="span9">
-    <div class="carousel slide" id="myCarousel">
-      <div class="carousel-inner">
-        <% @creations.each_with_index do |creation,index| %>
-          <% if index == 0 %>
-          <div class="item active">
-          <% else %>
-          <div class="item">
-          <% end %>
-            <a href="<%= url_for creation %>"><img alt="<%= creation.name %>" src="<%= creation.image.url.to_s%>" style="display:block; margin-left:auto; margin-right:auto;" /></a>
-            <div class="carousel-caption">
-              <h4><%= creation.name %></h4>
-              <p><%= creation.short_story %></p>
-            </div>
-          </div>
-        <% end %>
-      </div>
-      <a data-slide="prev" href="#myCarousel" class="left carousel-control">‹</a>
-      <a data-slide="next" href="#myCarousel" class="right carousel-control">›</a>
-    </div>
-  </div>
-</div>
-<div class="row">
-  <div class="span12">
-    <%= render "shared/creation_image_gallery" %>
-  </div>
-</div>
app/views/home/index.html.erb
@@ -8,7 +8,7 @@
   <p><strong>Make</strong> cakes, <strong>sell</strong> cakes, or just <strong>love</strong> eating them? You've come to the right place!</p>
   <p>CakeSide is a free site to <strong>share</strong> your cake <strong>creations</strong> and <strong>ideas</strong> with other cake fanatics like yourself!</p>
   <br />
-  <p><a href="<%= url_for new_user_session_path %>" class="btn primary large">Sign me up &raquo;</a></p>
+  <p><a href="<%= url_for new_user_session_path %>" class="btn btn-large">Sign me up &raquo;</a></p>
 </div>
 <% end %>
 <%= render "shared/creation_image_gallery" %>
app/views/shared/_creation_image_gallery.html.erb
@@ -7,7 +7,13 @@
         <a href="<%= url_for creation %>">
           <img src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>" width="260px" height="180px" />
         </a>
-        <p><%= link_to creation.favorites.count, creation_favorites_path(:creation_id => creation.id) %><i class="icon-heart"></i></p>
+        <p>
+        <% if creation.favorites.count > 0 %>
+          <a href="<%= url_for creation_favorites_path(:creation_id => creation.id) %>"><%= creation.favorites.count %><i class="icon-heart"></i></a>
+        <% else %>
+          &nbsp;
+        <% end %>
+        </p>
       </div>
     </div>
     </li>