mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Convert erb to haml
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
||||
|
||||
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Properties' } %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>
|
||||
|
||||
<% content_for :page_actions do %>
|
||||
<ul class="tollbar inline-menu">
|
||||
<li>
|
||||
<%= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'icon-plus button' %>
|
||||
</li>
|
||||
<li>
|
||||
<span id="new_ptype_link">
|
||||
<%= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, 'data-update' => 'prototypes', :class => 'button icon-copy' %>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @product, :url => admin_product_url(@product), :method => :put do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<div class="add_product_properties" data-hook="add_product_properties"></div>
|
||||
|
||||
<div id="prototypes" data-hook></div>
|
||||
<%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
|
||||
|
||||
<table class="index sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
|
||||
<thead>
|
||||
<tr data-hook="product_properties_header">
|
||||
<th colspan="2"><%= Spree.t(:property) %></th>
|
||||
<th><%= Spree.t(:value) %></th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="product_properties" data-hook>
|
||||
<%= f.fields_for :product_properties do |pp_form| %>
|
||||
<%= render :partial => 'product_property_fields', :locals => { :f => pp_form } %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
||||
|
||||
<%= hidden_field_tag 'clear_product_properties', 'true' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do -%>
|
||||
var properties = <%= raw(@properties.to_json) %>;
|
||||
|
||||
$("#product_properties input.autocomplete").live("keydown", function(){
|
||||
already_auto_completed = $(this).is('ac_input');
|
||||
if (!already_auto_completed) {
|
||||
$(this).autocomplete({source: properties});
|
||||
$(this).focus();
|
||||
}
|
||||
});
|
||||
<% end -%>
|
||||
|
||||
45
app/views/spree/admin/product_properties/index.html.haml
Normal file
45
app/views/spree/admin/product_properties/index.html.haml
Normal file
@@ -0,0 +1,45 @@
|
||||
= render :partial => 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Properties' }
|
||||
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @product }
|
||||
|
||||
- content_for :page_actions do
|
||||
%ul.tollbar.inline-menu
|
||||
%li
|
||||
= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'icon-plus button'
|
||||
%li
|
||||
%span#new_ptype_link
|
||||
= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, 'data-update' => 'prototypes', :class => 'button icon-copy'
|
||||
|
||||
= form_for @product, :url => admin_product_url(@product), :method => :put do |f|
|
||||
%fieldset.no-border-top
|
||||
.add_product_properties{"data-hook" => "add_product_properties"}
|
||||
#prototypes{"data-hook" => ""}
|
||||
= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator'
|
||||
|
||||
%table.index.sortable{"data-hook" => "", "data-sortable-link" => update_positions_admin_product_product_properties_url}
|
||||
%thead
|
||||
%tr{"data-hook" => "product_properties_header"}
|
||||
%th{colspan: "2"}= Spree.t(:property)
|
||||
%th= Spree.t(:value)
|
||||
%th.actions
|
||||
|
||||
%tbody#product_properties{"data-hook" => ""}
|
||||
= f.fields_for :product_properties do |pp_form|
|
||||
= render :partial => 'product_property_fields', :locals => { :f => pp_form }
|
||||
|
||||
= render :partial => 'spree/admin/shared/edit_resource_links'
|
||||
|
||||
= hidden_field_tag 'clear_product_properties', 'true'
|
||||
|
||||
= javascript_tag do
|
||||
var properties = #{raw(@properties.to_json)};
|
||||
|
||||
$("#product_properties input.autocomplete").live("keydown", function(){
|
||||
already_auto_completed = $(this).is('ac_input');
|
||||
if (!already_auto_completed) {
|
||||
$(this).autocomplete({source: properties});
|
||||
$(this).focus();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user