mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-16 04:24:23 +00:00
Adding properties tab to admin enterprise edit form
This commit is contained in:
@@ -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
|
||||
|
||||
12
app/views/admin/enterprises/form/_properties.html.haml
Normal file
12
app/views/admin/enterprises/form/_properties.html.haml
Normal 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();
|
||||
// }
|
||||
// });
|
||||
12
app/views/admin/producer_properties/_form.html.haml
Normal file
12
app/views/admin/producer_properties/_form.html.haml
Normal 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
|
||||
@@ -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)};
|
||||
|
||||
Reference in New Issue
Block a user