Created
March 26, 2012 16:13
-
-
Save Ravenna/2206220 to your computer and use it in GitHub Desktop.
Product#new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% content_for :javascripts do %> | |
| <script> | |
| $(function() { | |
| $( "#add_photo" ).sortable(); | |
| $( "#add_photo" ).disableSelection(); | |
| }); | |
| </script> | |
| <% end %> | |
| <% content_for :javascripts do %> | |
| <%= javascript_tag do %> | |
| // Sorting the list | |
| $(document).ready(function(){ | |
| $('#add_photo').sortable({ | |
| axis: 'y', | |
| dropOnEmpty: false, | |
| cursor: 'crosshair', | |
| items: 'div', | |
| opacity: 0.4, | |
| scroll: true, | |
| update: function(){ | |
| $.ajax({ | |
| type: 'post', | |
| data: $('#add_photo').sortable('serialize'), | |
| dataType: 'script', | |
| complete: function(request){ | |
| $('#add_photo').effect('highlight'); | |
| }, | |
| url: 'sort_photos'}) | |
| } | |
| }); | |
| }); | |
| <% end %> | |
| <% end %> | |
| <%= render :partial => 'shared/interior_hero' %> | |
| <div id="interior_wrapper"> | |
| <div id="interior_header_absolute"> | |
| <h6 id="int_header">New Product</h6> | |
| </div> | |
| <div id="interior_sub_head"><h5 id="sub_green_head"></h5></div> | |
| <div id="interior_pad"> | |
| <%= form_for @product, :html => { :multipart => true } do |f| %> | |
| <%= f.error_messages %> | |
| <p> | |
| <%= f.label :title %><br /> | |
| <%= f.text_field :title %> | |
| </p> | |
| <p> | |
| <%= f.label :description %><br /> | |
| <%= f.text_area :description %> | |
| </p> | |
| <p> | |
| <%= f.label :price %> $<%= f.text_field :price %> (Do not use comma's to separate thousands of $) | |
| </p> | |
| <p> | |
| <%= f.label :spotlights %> | |
| <%= select_tag "spotlight", options_for_select([ "Vintage", "None" ], "None")%> | |
| </p> | |
| <p> | |
| <%= f.label :category %> | |
| <%= f.select :category_id, Category.find(:all, :order => 'name').collect { |c| [c.name, c.id] }, :include_blank => true %> | |
| </p> | |
| <p> | |
| <%= f.label :brand %> | |
| <%= f.select :brand_id, Brand.find(:all, :order => 'name').collect { |b| [b.name, b.id] }, :include_blank => true %> | |
| </p> | |
| <fieldset> | |
| <legend>Add Photos</legend> | |
| <div id="add_photo"> | |
| <%= f.fields_for :photos do |f|%> | |
| <%= render :partial => "photo_fields", :locals => {:f => f} %> | |
| <% end %> | |
| </div> | |
| <p><%= f.link_to_add "Add a Photo", :photos %></p> | |
| </fieldset> | |
| <p><%= f.label :audioclip %> <%= f.file_field :audioclip %></p> | |
| <p> | |
| <%= f.label :video %><br /> | |
| <%= f.text_area :video %> | |
| </p> | |
| <p> | |
| <%= f.submit 'Create' %> | |
| </p> | |
| <% end %> | |
| <%= link_to 'Back', products_path %> | |
| </div> | |
| </div> | |
| <%= render :partial => 'shared/interior_footer' %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment