Files
openfoodnetwork/app/views/admin/producer_properties/index.html.haml
2017-01-11 10:00:06 +11:00

28 lines
929 B
Plaintext

- content_for :page_title do
= "#{@enterprise.name}:"
= t('.title')
- content_for :page_actions do
%ul.tollbar.inline-menu
%li
= link_to_add_fields t(:add_producer_property), 'tbody#producer_properties', class: 'icon-plus button'
= render 'spree/shared/error_messages', target: @enterprise
= form_for @enterprise, url: main_app.admin_enterprise_path(@enterprise), method: :put do |f|
= 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)};
$("#producer_properties input.autocomplete").live("keydown", function() {
already_auto_completed = $(this).is('ac_input');
if (!already_auto_completed) {
$(this).autocomplete({source: properties});
$(this).focus();
}
});