Commit 95f6f30e
Changed files (4)
app
views
creations
app/views/creations/_form.html.erb
@@ -1,6 +1,5 @@
<%= form_for(@creation, :html => {:multipart => true, :class => "form-horizontal"}) do |f| %>
<fieldset>
- <legend>Share a new creation</legend>
<div class="control-group">
<%= f.label :name, :class => "control-label" %>
<div class="controls">
app/views/creations/edit.html.erb
@@ -5,7 +5,30 @@
<h1><small>Edit</small> <%= @creation.name %></h1>
</div>
<div class="row">
- <div class="span4">
+ <div class="span3">
+ <div class="thumbnail">
+ <img src="<%= avatar_url current_user %>&s=260" alt="<%= current_user.name %>" />
+ <div class="caption">
+ <h5><%= current_user.name %></h5>
+ </div>
+ </div>
+ </div>
+ <div class="span6">
+ <%= render 'form' %>
+ <ul class="thumbnails">
+ <% @creation.photos.each do |photo| %>
+ <li>
+ <div class="thumbnail">
+ <%= image_tag photo.image_url(:thumb) %>
+ <div class="caption">
+ <p><%= link_to "Delete »", creation_photo_path(@creation, photo), :class => 'btn', :method => :delete, :confirm => "Are you sure?" %></p>
+ </div>
+ </div>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="span3">
<ul class="thumbnails">
<li>
<a href="<%= url_for creation_path(@creation) %>">
@@ -13,8 +36,10 @@
</a>
</li>
</ul>
+ <p>Second thoughts? <%= link_to 'Delete', creation_path(@creation),:confirm => "Are you sure", :method => :delete, :class => 'btn btn-danger' %> </p>
+ <hr />
<% if @creation.photos.length < 3 %>
- <h3>Add more photos</h3>
+ <h3>Add another photo</h3>
<% unless @creation.new_record? %>
<%= form_tag(creation_photos_path(@creation), :method => "post", :multipart => true) do |f| %>
<%= fields_for Photo.new do |f| %>
@@ -25,19 +50,4 @@
<% end %>
<% end %>
</div>
- <div class="span8">
- <%= render 'form' %>
- <ul class="thumbnails">
- <% @creation.photos.each do |photo| %>
- <li>
- <div class="thumbnail">
- <%= image_tag photo.image_url(:thumb) %>
- <div class="caption">
- <p><%= link_to "Delete »", creation_photo_path(@creation, photo), :class => 'btn', :method => :delete, :confirm => "Are you sure?" %></p>
- </div>
- </div>
- </li>
- <% end %>
- </ul>
- </div>
</div>
app/views/creations/new.html.erb
@@ -1,6 +1,9 @@
<% content_for :title do %>
Share my creation
<% end %>
+<div class="page-header">
+ <h1>Share a new creation</h1>
+</div>
<div class="row">
<div class="span3">
<div class="thumbnail">
@@ -22,7 +25,6 @@
<li><a href="http://cakeside.uservoice.com/"><i class="icon-flag"></i> Help</a></li>
</ul>
</div>
-
</div>
<div class="span6">
<%= render 'form' %>
app/views/creations/show.html.erb
@@ -5,7 +5,6 @@
<small>
<% if @creation.user == current_user %>
<%= link_to '(edit)', edit_creation_path(@creation) %>
- <%= link_to 'Delete', creation_path(@creation),:confirm => "Are you sure", :method => :delete, :class => 'btn btn-danger' %>
<% end %>
submitted by <%= link_to @creation.user.name, profile_path(@creation.user) %> on <%= @creation.created_at.to_s :foomat %> with <%= link_to pluralize(@creation.favorites.length, 'fan'), creation_favorites_path(:creation_id => @creation.id)%>
</small>
@@ -72,7 +71,7 @@
</div>
<div class="row">
<div class="span12">
- <h3>Description</h3>
+ <h3>Description <% if @creation.user == current_user %><small><%= link_to '(edit)', edit_creation_path(@creation) %></small><% end %></h3>
<hr />
<p><%= @creation.story %></p>
</div>