Commit 3bc2696c

mo khan <mo@mokhan.ca>
2014-10-13 18:15:59
use a star icon in place of the add to favorites button.
1 parent c757fbe
Changed files (1)
app
views
app/views/creations/_show.html.erb
@@ -4,6 +4,15 @@
   </div>
   <div class="span6">
     <h1><%= link_to @creation.name, creation_path(@creation) %></h1>
+    <% if user_signed_in? && current_user != @creation.user %>
+      <% if current_user.already_likes(@creation) %>
+        <i class="fa fa-star fa-4x pull-right"></i>
+      <% else %>
+        <%= link_to creation_favorites_path(creation_id: @creation.id), method: :post, class: 'pull-right' do %>
+          <i class="fa fa-star-o fa-4x"></i>
+        <% end %>
+      <% end %>
+    <% end %>
     <p>By <%= link_to @creation.user.name, profile_path(@creation.user) %></p>
     <% if @creation.tags.any? %>
       <span> <i class="icon-tags"></i> </span>
@@ -16,13 +25,9 @@
     <hr />
     <div class="row-fluid">
       <div class="span6">
-        <% if user_signed_in? %>
-          <% unless current_user == @creation.user || current_user.already_likes(@creation) %>
-            <%= button_to "ADD TO FAVORITES", creation_favorites_path(:creation_id => @creation.id), :method => :post, :class => 'btn btn-primary', "data-event" => 'click-add-to-favorites' %>
-      <% end %>
-      <% else %>
-        <p><%= link_to "SIGN UP FOR FREE", login_path, :class => "btn btn-primary" %></p>
-      <% end %>
+        <% unless user_signed_in? %>
+          <p><%= link_to "SIGN UP FOR FREE", login_path, :class => "btn btn-primary" %></p>
+        <% end %>
       </div>
     </div>
     <p><%= @creation.story %></p>