Sha256: d4b1e4d509565ac124f1a2beabf91a45c53281800f39664be5d218ca16ba1c36

Contents?: true

Size: 1.66 KB

Versions: 5

Compression:

Stored size: 1.66 KB

Contents

- content_for :scripts do
  :javascript
    $(function() {
      $('.preview').click(function(e) {
        e.preventDefault();
        // store the action
        var form = $(this).closest('form');
        var action = $(form).attr("action");
        // rewrite the target and action
        $(form).attr("target", "_blank");
        $(form).attr("action", "/products/preview");
        $(form).submit();
        // put things back the way they were
        $(form).removeAttr("target");
        $(form).attr("action", action);
      });

      $('#tabs').tabs();
      clearUIClasses();

      FORGE.features.nestedFields.init('#images', {after: function() { FORGE.features.nestedFields.reorganize(4, '#images-list li'); }});
      FORGE.features.nestedFields.reorganize(4, '#images-list li');
    });


= form_for [:forge, @product], :builder => ForgeFormBuilder do |f|
  = error_messages_for :product
  #tabs
    %ul.tabbed
      %li= link_to "Product Details", '#details'
      %li= link_to "Product Images", '#images'
      %li= link_to "Taxes & Shipping", '#taxes_shipping'
      %li= link_to "SEO Fields", "#seo"
    .spacer
    #details= render :partial => "forge/products/modules/details", :locals => {:f => f}
    #images= render :partial => "forge/products/modules/images", :locals => {:f => f}
    #taxes_shipping= render :partial => "forge/products/modules/taxes_shipping", :locals => {:f => f}
    #seo= render :partial => "forge/shared/seo_fields", :locals => {:f => f}
  #item-list-bottom
    .float-right
      Everything look good?
      = button_link "Preview", "javascript:;", :class => "preview button"
      = button_link "Save", "javascript:;", :class => "submit button"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/views/forge/products/_form.html.haml
forge-cli-0.1.9 lib/forge/app/views/forge/products/_form.html.haml
forge-cli-0.1.8 lib/forge/app/views/forge/products/_form.html.haml
forge-cli-0.1.7 lib/forge/app/views/forge/products/_form.html.haml
forge-cli-0.1.6 lib/forge/app/views/forge/products/_form.html.haml