Adding properties tab to admin enterprise edit form

This commit is contained in:
Rob Harrington
2015-04-02 11:30:32 +11:00
parent 8926e3765e
commit 3aa5f6e023
6 changed files with 46 additions and 14 deletions

View File

@@ -31,6 +31,10 @@
%legend Images
= render 'admin/enterprises/form/images', f: f
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Properties'" } }
%legend Properties
= render 'admin/enterprises/form/properties', f: f
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Shipping Methods'" } }
%legend Shipping Methods
= render 'admin/enterprises/form/shipping_methods', f: f

View File

@@ -0,0 +1,12 @@
= render 'admin/producer_properties/form', f: f
// :javascript
// var properties = #{raw(@properties.to_json)};
//
// $("#producer_properties input.autocomplete").live("keydown", function() {
// already_auto_completed = $(this).is('ac_input');
// if (!already_auto_completed) {
// $(this).autocomplete({source: properties});
// $(this).focus();
// }
// });

View File

@@ -0,0 +1,12 @@
%fieldset.no-border-top
.add_producer_properties{"data-hook" => "add_producer_properties"}
= image_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator'
%table.index.sortable{"data-hook" => "", "data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)}
%thead
%tr{"data-hook" => "producer_properties_header"}
%th{colspan: "2"} Property
%th Value
%th.actions
%tbody#producer_properties{"data-hook" => ""}
= f.fields_for :producer_properties do |pp_form|
= render 'admin/producer_properties/producer_property_fields', f: pp_form

View File

@@ -13,20 +13,10 @@
= form_for @enterprise, url: main_app.admin_enterprise_path(@enterprise), method: :put do |f|
%fieldset.no-border-top
.add_producer_properties{"data-hook" => "add_producer_properties"}
= image_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator'
%table.index.sortable{"data-hook" => "", "data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)}
%thead
%tr{"data-hook" => "producer_properties_header"}
%th{colspan: "2"} Property
%th Value
%th.actions
%tbody#producer_properties{"data-hook" => ""}
= f.fields_for :producer_properties do |pp_form|
= render 'producer_property_fields', f: pp_form
= render 'spree/admin/shared/edit_resource_links', collection_url: main_app.admin_enterprise_producer_properties_path(@enterprise)
= hidden_field_tag 'clear_producer_properties', 'true'
= render 'form', f: f
= render 'spree/admin/shared/edit_resource_links', collection_url: main_app.admin_enterprise_producer_properties_path(@enterprise)
= hidden_field_tag 'clear_producer_properties', 'true'
:javascript
var properties = #{raw(@properties.to_json)};