%= render :partial => 'spree/admin/shared/configuration_menu' %>
<%= render :partial => 'js_head' %>
<% content_for :page_title do %>
<%= t(:taxonomy_edit) %>
<% end %>
<% content_for :page_actions do %>
<%= button_link_to t(:back_to_taxonomies_list), spree.admin_taxonomies_path, :icon => 'icon-arrow-left' %>
<% end %>
<%= form_for [:admin, @taxonomy] do |f| %>
<% end %>
<% content_for :head do %>
<%= javascript_tag do -%>
var initial = [
{ "attr" :
{ "id" : "<%= @taxonomy.root.id %>", "rel" : "root" },
"data" : "<%= escape_javascript(raw(@taxonomy.root.name)) %>",
"state" : "open",
"children" : [
<% @taxonomy.root.children.each_with_index do |taxon,i| %>
{
"attr" :
{ "id" : "<%= taxon.id %>"},
"data" : "<%= escape_javascript(raw(taxon.name)) %>"
<% unless taxon.children.empty? %>
,"state" : "closed"
<% end %>
}<%= ',' if i < (@taxonomy.root.children.size - 1) %>
<% end %>
]
}
];
<% end -%>
<% end %>