Commit 6bac1fc8

mo k <mo@mokhan.ca>
2012-06-08 05:12:23
tidy up the add another photo form
1 parent d926dc3
Changed files (1)
app
views
creations
app/views/creations/show.html.erb
@@ -39,25 +39,35 @@
 <div class="row">
   <div class="span12">
     <ul class="thumbnails">
-      <li class="span8">
-      <a class="thumbnail" href="<%= url_for creation_path(@creation) %>"><img src="<%= @creation.image_url(:large).to_s %>" alt="<%= @creation.name %>" /></a>
+      <li class="span9">
+      <a class="thumbnail" href="<%= url_for creation_path(@creation) %>">
+        <img src="<%= @creation.image_url(:large).to_s %>" alt="<%= @creation.name %>" class="span9" />
+      </a>
       </li>
       <% @creation.photos.each do |photo| %>
-        <li class="span4">
-        <a class="thumbnail" href="#"><img alt="<%= @creation.name %>" src="<%= photo.image.thumb.url.to_s%>"></a>
+        <li class="span3">
+        <a class="thumbnail" href="#">
+          <img src="<%= photo.image.thumb.url.to_s %>" alt="<%= @creation.name %>" class="span3">
+        </a>
         </li>
       <% end %>
       <% if @creation.user == current_user %>
         <% if @creation.photos.length < 3 %>
-          <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| %>
-                <%= f.file_field :image, :rel => creation_photos_path(@creation) %>
-                <input type="submit" class="btn primary" value="Add photo" />
+          <div class="span3 visible-desktop">
+            <h4>Add another photo</h4>
+            <% unless @creation.new_record? %>
+              <%= form_tag(creation_photos_path(@creation), :method => "post", :multipart => true, :html => {:class => ''}) do |f| %>
+                <%= fields_for Photo.new do |f| %>
+                  <div class="control-group">
+                    <div class="controls">
+                      <%= f.file_field :image, :rel => creation_photos_path(@creation) %>
+                    </div>
+                  </div>
+                  <input type="submit" class="btn primary" value="Add photo" />
+                <% end %>
               <% end %>
             <% end %>
-          <% end %>
+          </div>
         <% end %>
       <% end -%>
     </ul>