spree_core 0.30.2 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/base_controller.rb +0 -31
- data/app/controllers/admin/orders_controller.rb +10 -9
- data/app/controllers/admin/overview_controller.rb +1 -1
- data/app/controllers/admin/products_controller.rb +8 -8
- data/app/controllers/admin/properties_controller.rb +1 -1
- data/app/controllers/admin/shipments_controller.rb +6 -3
- data/app/controllers/admin/shipping_methods_controller.rb +1 -1
- data/app/controllers/admin/tax_rates_controller.rb +2 -2
- data/app/controllers/admin/taxons_controller.rb +1 -2
- data/app/controllers/admin/users_controller.rb +7 -8
- data/app/controllers/admin/variants_controller.rb +2 -2
- data/app/controllers/countries_controller.rb +1 -1
- data/app/controllers/locale_controller.rb +1 -1
- data/app/controllers/spree/base_controller.rb +1 -117
- data/app/controllers/states_controller.rb +1 -1
- data/app/helpers/spree/base_helper.rb +1 -7
- data/app/helpers/taxons_helper.rb +2 -2
- data/app/models/app_configuration.rb +0 -3
- data/app/models/calculator/flat_percent_item_total.rb +2 -1
- data/app/models/calculator/vat.rb +1 -1
- data/app/models/creditcard.rb +1 -1
- data/app/models/gateway/authorize_net.rb +13 -2
- data/app/models/gateway/authorize_net_cim.rb +11 -0
- data/app/models/gateway/beanstream.rb +30 -7
- data/app/models/inventory_unit.rb +21 -31
- data/app/models/line_item.rb +7 -8
- data/app/models/order.rb +4 -1
- data/app/models/product_group.rb +4 -8
- data/app/models/property.rb +1 -3
- data/app/models/return_authorization.rb +6 -1
- data/app/models/state_event.rb +3 -3
- data/app/models/state_monitor.rb +16 -16
- data/app/models/taxon.rb +6 -7
- data/app/models/user.rb +4 -0
- data/app/views/admin/general_settings/edit.html.erb +0 -8
- data/app/views/admin/general_settings/show.html.erb +5 -10
- data/app/views/admin/images/_form.html.erb +1 -1
- data/app/views/admin/images/index.html.erb +1 -1
- data/app/views/admin/option_types/new.html.erb +1 -1
- data/app/views/admin/orders/_add_product.html.erb +3 -3
- data/app/views/admin/orders/_form.html.erb +3 -0
- data/app/views/admin/orders/_user_form.html.erb +1 -1
- data/app/views/admin/orders/index.html.erb +2 -2
- data/app/views/admin/orders/show.html.erb +3 -8
- data/app/views/admin/orders/user.html.erb +1 -1
- data/app/views/admin/product_groups/index.html.erb +1 -1
- data/app/views/admin/product_groups/show.html.erb +1 -1
- data/app/views/admin/products/index.html.erb +1 -1
- data/app/views/admin/return_authorizations/_form.html.erb +3 -1
- data/app/views/admin/shared/_address_form.html.erb +1 -1
- data/app/views/admin/shared/_configuration_menu.html.erb +11 -11
- data/app/views/admin/shared/_order_tabs.html.erb +12 -12
- data/app/views/admin/shared/_product_tabs.html.erb +6 -6
- data/app/views/admin/states/_state_list.html.erb +2 -2
- data/app/views/admin/taxonomies/_js_head.html.erb +6 -8
- data/app/views/admin/taxonomies/edit.html.erb +11 -11
- data/app/views/admin/taxonomies/get_children.json.erb +5 -5
- data/app/views/admin/taxons/available.js.erb +10 -10
- data/app/views/admin/taxons/selected.html.erb +13 -13
- data/app/views/admin/variants/index.html.erb +1 -1
- data/app/views/checkout/_address.html.erb +2 -2
- data/app/views/layouts/admin.html.erb +1 -2
- data/app/views/layouts/spree_application.html.erb +1 -2
- data/app/views/shared/_admin_head.html.erb +3 -3
- data/app/views/shared/_doc_and_xmlns.html.erb +2 -0
- data/app/views/shared/_filters.html.erb +3 -28
- data/app/views/taxons/show.html.erb +7 -5
- data/config/initializers/spree.rb +1 -19
- data/config/locales/en.yml +0 -2
- data/config/routes.rb +3 -5
- data/db/migrate/20091007134354_change_taxons_to_nested_set.rb +2 -2
- data/lib/product_filters.rb +10 -11
- data/lib/scopes/product.rb +15 -0
- data/lib/spree/mail_settings.rb +2 -4
- data/lib/spree/preference_access.rb +3 -3
- data/lib/spree_base.rb +116 -0
- data/lib/spree_core.rb +3 -1
- data/lib/spree_core/preferences/model_hooks.rb +1 -1
- data/lib/tasks/install.rake +0 -1
- data/public/javascripts/admin.js +0 -6
- data/public/javascripts/admin/checkouts/edit.js +41 -40
- data/public/javascripts/admin/orders/edit_form.js +5 -4
- data/public/javascripts/jquery.cookie.js +96 -0
- data/public/javascripts/jquery.delayedobserver.js +35 -0
- data/public/javascripts/jsTree/jquery.jstree.js +3510 -0
- data/public/javascripts/jsTree/themes/apple/d.png +0 -0
- data/public/javascripts/jsTree/themes/apple/style.css +60 -34
- data/public/javascripts/jsTree/themes/apple/throbber.gif +0 -0
- data/public/javascripts/taxonomy.js +150 -149
- data/public/stylesheets/admin/admin.css +0 -34
- metadata +36 -43
- data/app/controllers/password_resets_controller.rb +0 -48
- data/app/helpers/users_helper.rb +0 -13
- data/app/models/spree/alert.rb +0 -13
- data/app/views/admin/shared/_alert.html.erb +0 -6
- data/app/views/shared/_login.html.erb +0 -21
- data/app/views/shared/_user_form.html.erb +0 -17
- data/lib/spree/i18n_utils.rb +0 -47
- data/public/javascripts/jquery.js +0 -19
- data/public/javascripts/jrails.autocomplete.js +0 -274
- data/public/javascripts/jrails.js +0 -1
- data/public/javascripts/jsTree/jquery.tree.js +0 -2058
- data/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -129
- data/public/javascripts/jsTree/themes/apple/icons.png +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<%= render 'shared/error_messages', :target => @option_type%>
|
4
4
|
|
5
|
-
|
5
|
+
<%= form_for(:option_type, :url => collection_url) do |f| %>
|
6
6
|
<fieldset>
|
7
7
|
<legend><%= t("new_option_type") %></legend>
|
8
8
|
<%= render :partial => "form", :locals => { :f => f } %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<legend><%= t('add_product') %></legend>
|
4
4
|
<div style="float:left;width:65%;margin-right:5%;">
|
5
5
|
<%= label_tag :add_product_name, t("name_or_sku") %>
|
6
|
-
<%= text_field_tag :add_product_name,
|
6
|
+
<%= text_field_tag :add_product_name, nil, :class => 'fullwidth title' %>
|
7
7
|
<%= hidden_field_tag :add_variant_id %>
|
8
8
|
</div>
|
9
9
|
<div style="float:left;width:10%;margin-right:5%;">
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<%= text_field_tag :add_quantity, 1 , :class => 'fullwidth title' %>
|
12
12
|
</div>
|
13
13
|
<div style="float: left; width: 15%; padding-top: 17px;">
|
14
|
-
<%= link_to text_for_button_link(t("add"), :icon => 'add'),
|
14
|
+
<%= link_to text_for_button_link(t("add"), :icon => 'add'),
|
15
15
|
admin_order_line_items_url(@order),
|
16
|
-
{:id => 'add_line_item_to_order', :
|
16
|
+
{:id => 'add_line_item_to_order', :class => 'button', 'data-update' => 'order-form-wrapper'} %>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
</fieldset>
|
@@ -1,4 +1,7 @@
|
|
1
1
|
<%= render 'shared/error_messages', :target => @order %>
|
2
|
+
<% if @line_item.try(:errors).present? %>
|
3
|
+
<%= render 'shared/error_messages', :target => @line_item %>
|
4
|
+
<% end %>
|
2
5
|
|
3
6
|
<%= form_for(@order, :url => admin_order_url(@order), :html => { :method => :put}) do |f| %>
|
4
7
|
<%= f.hidden_field :number %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</tbody>
|
29
29
|
</table>
|
30
30
|
|
31
|
-
<h3><%= Address.
|
31
|
+
<h3><%= Address.model_name.human(:count => 2) %></h3>
|
32
32
|
<%= f.fields_for :bill_address do |ba_form| %>
|
33
33
|
<%= render :partial => "admin/shared/address_form", :locals => {:f => ba_form, :name => t('billing_address'), :use_billing => false} %>
|
34
34
|
<% end %>
|
@@ -58,11 +58,11 @@
|
|
58
58
|
<label><%= t("date_range") %></label><br />
|
59
59
|
<div class="yui-g date-range-filter">
|
60
60
|
<div class="yui-u sub-field first">
|
61
|
-
<%= f.spree_date_picker :
|
61
|
+
<%= f.spree_date_picker :completed_at_greater_than %><br />
|
62
62
|
<label class="sub"><%= t("start") %></label>
|
63
63
|
</div>
|
64
64
|
<div class="yui-u sub-field">
|
65
|
-
<%= f.spree_date_picker :
|
65
|
+
<%= f.spree_date_picker :completed_at_less_than %><br />
|
66
66
|
<label><%= t("stop") %></label>
|
67
67
|
</div>
|
68
68
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class='toolbar order-links'>
|
2
2
|
<%= hook :admin_order_show_buttons do %>
|
3
|
-
<%= button_link_to t("cancel"), fire_admin_order_url(@order.number, {:e => "cancel"}), :icon => 'delete'
|
3
|
+
<%= button_link_to t("cancel"), fire_admin_order_url(@order.number, {:e => "cancel"}), :icon => 'delete', :confirm => 'are you sure?' if @order.can_cancel? %>
|
4
4
|
<%= button_link_to t("edit"), edit_admin_order_url(@order.number), :icon => 'edit' %>
|
5
5
|
<% end %>
|
6
6
|
</div>
|
@@ -10,18 +10,13 @@
|
|
10
10
|
<%= hook :admin_order_show_addresses do %>
|
11
11
|
<% if @order.bill_address %>
|
12
12
|
<div class='adr'>
|
13
|
-
<h4>
|
14
|
-
<%= link_to t("bill_address"), (@current_action=="edit" ? edit_admin_checkout_url(@order.number) : admin_orders_checkout_url(@order.number)) %>
|
15
|
-
</h4>
|
13
|
+
<h4><%= t("bill_address") %></h4>
|
16
14
|
<%= render :partial => 'admin/shared/address', :locals => {:address => @order.bill_address} %>
|
17
15
|
</div>
|
18
16
|
<% end %>
|
19
17
|
<% if @order.ship_address %>
|
20
18
|
<div class='adr'>
|
21
|
-
<h4>
|
22
|
-
<%= link_to t("ship_address"), (@current_action=="edit" ? edit_admin_checkout_url(@order.number) : admin_orders_checkout_url(@order.number)) %>
|
23
|
-
<%= t("ship_address") if @order.shipments.empty? %>
|
24
|
-
</h4>
|
19
|
+
<h4><%= t("ship_address") %></h4>
|
25
20
|
<%= render :partial => 'admin/shared/address', :locals => {:address => @order.ship_address} %>
|
26
21
|
</div>
|
27
22
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<fieldset>
|
7
7
|
<legend><%= t('customer_search') %></legend>
|
8
8
|
<%= label_tag :customer_search, t("name") %>
|
9
|
-
<%= text_field_tag :customer_search,
|
9
|
+
<%= text_field_tag :customer_search, nil, :class => 'fullwidth title' %>
|
10
10
|
</fieldset>
|
11
11
|
</div>
|
12
12
|
<% end %>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<tr id="<%= dom_id pg %>">
|
26
26
|
<td><%= link_to pg.name, object_path(pg) %></td>
|
27
27
|
<td><%= link_to pg_search_path(:product_group_name => pg.permalink), pg_search_path(:product_group_name => pg.permalink) %></td>
|
28
|
-
<td
|
28
|
+
<td><%== pg.product_scopes.map(&:to_sentence).join("<br />") %></td>
|
29
29
|
<td><%= pg.products.count %></td>
|
30
30
|
<td><%= link_to_edit pg %> <%= link_to_delete pg %></td>
|
31
31
|
</tr>
|
@@ -65,7 +65,7 @@
|
|
65
65
|
</p>
|
66
66
|
<p>
|
67
67
|
<label><%= t("show_deleted") %></label><br />
|
68
|
-
<%= f.check_box :deleted_at_not_null, {}, "1", "" %>
|
68
|
+
<%= f.check_box :deleted_at_not_null, {:checked => (params[:search] and !params[:search][:deleted_at_not_null].blank?)}, "1", "" %>
|
69
69
|
</p>
|
70
70
|
<% end %>
|
71
71
|
|
@@ -67,7 +67,9 @@
|
|
67
67
|
|
68
68
|
jQuery(document).ready(function(){
|
69
69
|
$.each($("td.return_quantity input"), function(i, inpt){
|
70
|
-
$(inpt).delayedObserver(
|
70
|
+
$(inpt).delayedObserver(function() {
|
71
|
+
calculate_rma_price();
|
72
|
+
}, 0.5);
|
71
73
|
});
|
72
74
|
|
73
75
|
calculate_rma_price();
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<%= f.label :country_id, t(:country)+':' %>
|
58
58
|
</td>
|
59
59
|
<td colspan="3">
|
60
|
-
<span id="<%= name==t('shipping_address') ? "s" : "b" %>country"><%= f.collection_select :country_id,
|
60
|
+
<span id="<%= name==t('shipping_address') ? "s" : "b" %>country"><%= f.collection_select :country_id, Country.all, :id, :name, {}, {:style => 'width:150px;'} %></span>
|
61
61
|
</td>
|
62
62
|
</tr>
|
63
63
|
<tr class="<%= name == t('shipping_address') ? "shipping-row" : "billing-row" %>">
|
@@ -5,18 +5,18 @@
|
|
5
5
|
|
6
6
|
<ul class="sidebar">
|
7
7
|
<%= hook :admin_configurations_sidebar_menu do %>
|
8
|
-
<li
|
9
|
-
<li
|
10
|
-
<li
|
11
|
-
<li
|
12
|
-
<li
|
13
|
-
<li
|
14
|
-
<li
|
15
|
-
<li
|
16
|
-
<li
|
17
|
-
<li
|
8
|
+
<li<%== ' class="active"' if controller.controller_name == 'general_settings' %>><%= link_to t("general_settings"), admin_general_settings_path %></li>
|
9
|
+
<li<%== ' class="active"' if controller.controller_name == 'mail_methods' %>><%= link_to t("mail_methods"), admin_mail_methods_path %></li>
|
10
|
+
<li<%== ' class="active"' if controller.controller_name == 'tax_categories' %>><%= link_to t("tax_categories"), admin_tax_categories_path %></li>
|
11
|
+
<li<%== ' class="active"' if controller.controller_name == 'zones' %>><%= link_to t("zones"), admin_zones_path %></li>
|
12
|
+
<li<%== ' class="active"' if controller.controller_name == 'states' %>><%= link_to t("states"), admin_country_states_path(Spree::Config[:default_country_id]) %></li>
|
13
|
+
<li<%== ' class="active"' if controller.controller_name == 'payment_methods' %>><%= link_to t("payment_methods"), admin_payment_methods_path %></li>
|
14
|
+
<li<%== ' class="active"' if ['taxonomies', 'taxons'].include? controller.controller_name %>><%= link_to t("taxonomies"), admin_taxonomies_path %></li>
|
15
|
+
<li<%== ' class="active"' if controller.controller_name == 'shipping_methods' %>><%= link_to t("shipping_methods"), admin_shipping_methods_path %></li>
|
16
|
+
<li<%== ' class="active"' if controller.controller_name == 'inventory_settings' %>><%= link_to t("inventory_settings"), admin_inventory_settings_path %></li>
|
17
|
+
<li<%== ' class="active"' if controller.controller_name == 'trackers' %>><%= link_to t("analytics_trackers"), admin_trackers_path %></li>
|
18
18
|
<% end %>
|
19
|
-
<li
|
19
|
+
<li<%== ' class="active"' if controller.controller_name == 'configurations' %>><%= link_to t("complete_list"), admin_configurations_path %></li>
|
20
20
|
</ul>
|
21
21
|
|
22
22
|
<% end %>
|
@@ -16,42 +16,42 @@
|
|
16
16
|
<ul class="sidebar">
|
17
17
|
<%= hook :admin_order_tabs do %>
|
18
18
|
<% unless @order.completed? %>
|
19
|
-
<li
|
19
|
+
<li<%== ' class="active"' if current == "Order Details" %>>
|
20
20
|
<%= link_to t("order_details"), edit_admin_order_url(@order) %>
|
21
21
|
</li>
|
22
|
-
<li
|
22
|
+
<li<%== ' class="active"' if current == "Customer Details" %>>
|
23
23
|
<%= link_to t("customer_details"), user_admin_order_url(@order) %>
|
24
24
|
</li>
|
25
|
-
<li
|
25
|
+
<li<%== ' class="active"' if current == "Shipments" %>>
|
26
26
|
<%= link_to t("shipment"), @order.line_items.empty? || !@order.completed? ? "javascript:$('form').submit();" : edit_admin_order_shipment_url(@order, @order.shipment) %>
|
27
27
|
</li>
|
28
|
-
<li
|
28
|
+
<li<%== ' class="active"' if current == "Adjustments" %>>
|
29
29
|
<%= link_to t("adjustments"), @order.line_items.empty? || !@order.completed? ? "javascript:$('form').submit();" : admin_order_adjustments_url(@order) %>
|
30
30
|
</li>
|
31
|
-
<li
|
31
|
+
<li<%== ' class="active"' if current == "Payments" %>>
|
32
32
|
<%= link_to t("payment"), @order.line_items.empty? || !@order.completed? ? "javascript:$('form').submit();" : new_admin_order_payment_url(@order) %>
|
33
33
|
</li>
|
34
34
|
|
35
35
|
<% else %>
|
36
|
-
<li
|
36
|
+
<li<%== ' class="active"' if current == "Order Details" %>>
|
37
37
|
<%= link_to t("order_details"), admin_order_url(@order) %>
|
38
38
|
</li>
|
39
|
-
<li
|
39
|
+
<li<%== ' class="active"' if current == "Customer Details" %>>
|
40
40
|
<%= link_to t("customer_details"), user_admin_order_url(@order) %>
|
41
41
|
</li>
|
42
|
-
<li
|
42
|
+
<li<%== ' class="active"' if current == "Adjustments" %>>
|
43
43
|
<%= link_to t("adjustments"), admin_order_adjustments_url(@order) %>
|
44
44
|
</li>
|
45
|
-
<li
|
45
|
+
<li<%== ' class="active"' if current == "Payments" %>>
|
46
46
|
<%= link_to t("payments"), admin_order_payments_url(@order) %>
|
47
47
|
</li>
|
48
|
-
<li
|
48
|
+
<li<%== ' class="active"' if current == "Shipments" %>>
|
49
49
|
<%= link_to t("shipments"), admin_order_shipments_url(@order) %>
|
50
50
|
</li>
|
51
|
-
<li
|
51
|
+
<li<%== ' class="active"' if current == "Return Authorizations" %>>
|
52
52
|
<%= link_to t("return_authorizations"), admin_order_return_authorizations_url(@order) %>
|
53
53
|
</li>
|
54
|
-
<li
|
54
|
+
<li<%== ' class="active"' if current == "History" %>>
|
55
55
|
<%= link_to t("history"), history_admin_order_url(@order) %>
|
56
56
|
</li>
|
57
57
|
<% end %>
|
@@ -8,22 +8,22 @@
|
|
8
8
|
<ul class="sidebar product-menu">
|
9
9
|
<%= hook :admin_product_tabs, {:current => current} do %>
|
10
10
|
|
11
|
-
<li
|
11
|
+
<li<%== ' class="active"' if current == "Product Details" %>>
|
12
12
|
<%= link_to t("product_details"), edit_admin_product_url(@product) %>
|
13
13
|
</li>
|
14
|
-
<li
|
14
|
+
<li<%== ' class="active"' if current == "Images" %>>
|
15
15
|
<%= link_to t("images"), admin_product_images_url(@product) %>
|
16
16
|
</li>
|
17
|
-
<li
|
17
|
+
<li<%== ' class="active"' if current == "Variants" %>>
|
18
18
|
<%= link_to t("variants"), admin_product_variants_url(@product) %>
|
19
19
|
</li>
|
20
|
-
<li
|
20
|
+
<li<%== ' class="active"' if current == "Option Types" %>>
|
21
21
|
<%= link_to t("option_types"), selected_admin_product_option_types_url(@product) %>
|
22
22
|
</li>
|
23
|
-
<li
|
23
|
+
<li<%== ' class="active"' if current == "Product Properties" %>>
|
24
24
|
<%= link_to t("product_properties"), admin_product_product_properties_url(@product) %>
|
25
25
|
</li>
|
26
|
-
<li
|
26
|
+
<li<%== ' class="active"' if current == "Taxons" %>>
|
27
27
|
<%= link_to t("taxons"), selected_admin_product_taxons_url(@product) %>
|
28
28
|
</li>
|
29
29
|
|
@@ -8,12 +8,12 @@
|
|
8
8
|
</thead>
|
9
9
|
<tbody>
|
10
10
|
<% @states.each do |state| %>
|
11
|
-
<tr>
|
11
|
+
<tr id="<%= dom_id state %>">
|
12
12
|
<td><%=state.name %></td>
|
13
13
|
<td><%=state.abbr %></td>
|
14
14
|
<td class="actions">
|
15
15
|
<%=link_to_with_icon 'edit', t("edit"), edit_admin_country_state_url(@country, state) %>
|
16
|
-
<%=
|
16
|
+
<%=link_to_delete state %>
|
17
17
|
</td>
|
18
18
|
</tr>
|
19
19
|
<% end %>
|
@@ -1,11 +1,9 @@
|
|
1
1
|
<% content_for :head do %>
|
2
|
-
<%= javascript_tag "var taxonomy_id = #{@taxonomy.id};
|
3
|
-
var loading = '#{escape_javascript t('loading')}';
|
2
|
+
<%= javascript_tag "var taxonomy_id = #{@taxonomy.id};
|
3
|
+
var loading = '#{escape_javascript t('loading')}';
|
4
4
|
var new_taxon = '#{escape_javascript t('new_taxon')}';
|
5
5
|
var server_error = '#{escape_javascript t('server_error')}';
|
6
|
-
var taxonomy_tree_error = '#{escape_javascript t('taxonomy_tree_error')}';"
|
7
|
-
%>
|
8
|
-
<%= javascript_include_tag 'taxonomy' %>
|
9
|
-
|
10
|
-
<script type="text/javascript" src="/javascripts/jsTree/plugins/jquery.tree.contextmenu.js"></script>
|
11
|
-
<% end %>
|
6
|
+
var taxonomy_tree_error = '#{escape_javascript t('taxonomy_tree_error')}';"
|
7
|
+
%>
|
8
|
+
<%= javascript_include_tag 'taxonomy' , 'jquery.cookie.js', 'jsTree/jquery.jstree.js' %>
|
9
|
+
<% end %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<%= form_for(:taxon, :url => admin_taxonomy_url, :html => { :method => :put }) do |f| %>
|
10
10
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
11
11
|
<div>
|
12
|
-
<label><%= t("tree")%></label><br />
|
12
|
+
<label><%= t("tree")%></label><br />
|
13
13
|
<div id="taxonomy_tree" class="tree"></div>
|
14
14
|
</div>
|
15
15
|
<p id="progress" style="display:none;">
|
@@ -26,24 +26,24 @@
|
|
26
26
|
<% content_for :head do %>
|
27
27
|
<script type="text/javascript">
|
28
28
|
var initial = [
|
29
|
-
{
|
30
|
-
{ "id" : "<%= @taxonomy.root.id %>" },
|
31
|
-
data : "<%= @taxonomy.root.name %>",
|
32
|
-
state : "open",
|
33
|
-
children : [
|
29
|
+
{ "attr" :
|
30
|
+
{ "id" : "<%= @taxonomy.root.id %>", "rel" : "root" },
|
31
|
+
"data" : "<%= @taxonomy.root.name %>",
|
32
|
+
"state" : "open",
|
33
|
+
"children" : [
|
34
34
|
<% @taxonomy.root.children.each_with_index do |taxon,i| %>
|
35
35
|
{
|
36
|
-
|
37
|
-
{ id : "<%= taxon.id %>"},
|
38
|
-
data : "<%= taxon.name %>"
|
36
|
+
"attr" :
|
37
|
+
{ "id" : "<%= taxon.id %>"},
|
38
|
+
"data" : "<%= taxon.name %>"
|
39
39
|
<% unless taxon.children.empty? %>
|
40
|
-
,state : "closed"
|
40
|
+
,"state" : "closed"
|
41
41
|
<% end %>
|
42
42
|
}<%= "," if i < (@taxonomy.root.children.size - 1) %>
|
43
43
|
<% end %>
|
44
44
|
]
|
45
45
|
}
|
46
46
|
];
|
47
|
-
|
47
|
+
|
48
48
|
</script>
|
49
49
|
<% end %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
[<% @taxons.each_with_index do |t,i| %>
|
2
|
-
{
|
3
|
-
{ "id" : "<%= t.id %>" },
|
4
|
-
data : "<%= t.name %>"
|
2
|
+
{ "attr" :
|
3
|
+
{ "id" : "<%= t.id %>" },
|
4
|
+
"data" : "<%= t.name %>"
|
5
5
|
<% unless t.children.empty? %>
|
6
|
-
,state : "closed"
|
6
|
+
,"state" : "closed"
|
7
7
|
<% end %>
|
8
8
|
}<%= "," if i < (@taxons.size - 1) %>
|
9
|
-
<% end %>]
|
9
|
+
<% end %>]
|
@@ -7,23 +7,23 @@
|
|
7
7
|
</script>
|
8
8
|
<h4><%= t('available_taxons') %></h4>
|
9
9
|
<table class="index">
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th><%= t("name") %></th>
|
13
|
+
<th><%= t("path") %></th>
|
14
|
+
<th><%= t("action") %></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
18
|
<% @available_taxons.each do |taxon| %>
|
19
19
|
<tr id="<%= dom_id(taxon, :sel) %>">
|
20
20
|
<td><%= taxon.name %></td>
|
21
21
|
<td><%= taxon_path taxon %></td>
|
22
|
-
|
22
|
+
<td class="actions">
|
23
23
|
<%= link_to icon('add') + ' ' + t("select"),
|
24
24
|
select_admin_product_taxon_path(@product, taxon),
|
25
25
|
:remote => true, :class => 'iconlink' %>
|
26
|
-
|
26
|
+
</td>
|
27
27
|
</tr>
|
28
28
|
<% end %>
|
29
29
|
<% if @available_taxons.empty? %>
|
@@ -17,25 +17,25 @@
|
|
17
17
|
data: {q: jQuery("#searchtext").val() },
|
18
18
|
success: function(request){
|
19
19
|
jQuery('#search_hits').html(request);
|
20
|
-
},
|
21
|
-
type: 'post',
|
20
|
+
},
|
21
|
+
type: 'post',
|
22
22
|
url: '<%= available_admin_product_taxons_url(@product) %>'
|
23
|
-
});
|
23
|
+
});
|
24
24
|
}
|
25
|
-
|
26
|
-
jQuery("#searchtext").keypress(function (e) {
|
27
|
-
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
|
25
|
+
|
26
|
+
jQuery("#searchtext").keypress(function (e) {
|
27
|
+
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
|
28
28
|
search_for_taxons();
|
29
29
|
|
30
|
-
return false;
|
31
|
-
} else {
|
32
|
-
return true;
|
33
|
-
}
|
30
|
+
return false;
|
31
|
+
} else {
|
32
|
+
return true;
|
33
|
+
}
|
34
34
|
});
|
35
|
-
|
36
|
-
jQuery("#searchtext").delayedObserver(
|
35
|
+
|
36
|
+
jQuery("#searchtext").delayedObserver(function() {
|
37
37
|
search_for_taxons();
|
38
|
-
})
|
38
|
+
}, 0.75);
|
39
39
|
<% end %>
|
40
40
|
<br/>
|
41
41
|
<div id="search_hits"></div>
|