Commit df12e954

mo k <m@mokhan.ca>
2011-11-25 06:14:59
use partials where it makes sense.
1 parent b7e5cc9
Changed files (4)
app/views/creations/mine.html.erb
@@ -2,25 +2,9 @@
   My Creations
 <% end %>
 
-<h1>My Creations</h1>
-<% @creations.each_with_index do |creation, index| %>
-  <% if index % 4 == 0  %>
-    <div class="grid_2 alpha">
-      <a href="<%= url_for creation %>"><%= image_tag creation.image.thumb.url, :alt => creation.name %></a>
-      <p><%= creation.name %> <br /><%= link_to creation.user.name, creation %></p>
-    </div>
-  <% elsif (index+1) % 4 == 0  %>
-    <div class="grid_2 omega">
-      <a href="<%= url_for creation %>"><%= image_tag creation.image.thumb.url, :alt => creation.name %></a>
-      <p><%= creation.name %> <br /><%= link_to creation.user.name, creation %></p>
-    </div>
-    <div class="clear"></div>
-  <% else %>
-    <div class="grid_2">
-      <a href="<%= url_for creation %>"><%= image_tag creation.image.thumb.url, :alt => creation.name %></a>
-      <p><%= creation.name %> <br /><%= link_to creation.user.name, creation %></p>
-    </div>
-  <% end %>
+<% content_for :sidebar do %>
+  <%= render "shared/my_profile_sidebar" %>
 <% end %>
-<div class="clear"></div>
 
+<h1>My Creations</h1>
+<%= render "shared/creation_thumbs" %>
app/views/creations/new.html.erb
@@ -1,6 +1,11 @@
 <% content_for :title do %>
   Share my creation
 <% end %>
+
+<% content_for :sidebar do %>
+  <%= render "shared/my_profile_sidebar" %>
+<% end %>
+
 <div class="grid_9 alpha omega">
   <h1>Share your creation with other Cake artists, enthusiasts, and eaters!</h1>
   <p>We&apos;re delighted that you're going to share your latest creation with us.<p>
app/views/registrations/edit.html.erb
@@ -50,12 +50,6 @@
   </div>
 
   <div class="grid_3 omega">
-    <div class="helpbox">
-      <h4>other</h4>
-      <ul>
-        <li><a href="http://en.gravatar.com/">change your photo</a></li>
-      </ul>
-    </div>
     <div class="helpbox">
       <h4>Cancel My Account</h4>
       <p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %></p>
app/views/shared/_my_profile_sidebar.html.erb
@@ -7,7 +7,7 @@
 <div class="menu">
   <ul class="level_2 nojot">
     <li class="level_2"> <%= link_to "My Creations", profiles_mine_path %></li>
-    <li class="level_2"> <%= link_to "Add Creation", new_creation_path %></li>
+    <li class="level_2"> <%= link_to "Share Creation", new_creation_path %></li>
     <li class="level_2"><a href="http://en.gravatar.com/" target="_blank">Change My Photo</a></li>
     <li class="level_2"> <%= link_to "Edit", edit_user_registration_path %> </li>
   </ul>