diff --git a/app/views/spree/admin/taxonomies/_form.html.erb b/app/views/spree/admin/taxonomies/_form.html.erb new file mode 100644 index 0000000000..1166e84a2e --- /dev/null +++ b/app/views/spree/admin/taxonomies/_form.html.erb @@ -0,0 +1,7 @@ +
+ <%= f.field_container :name do %> + <%= f.label :name, Spree.t(:name) %> *
+ <%= error_message_on :taxonomy, :name, :class => 'fullwidth title' %> + <%= text_field :taxonomy, :name %> + <% end %> +
diff --git a/app/views/spree/admin/taxonomies/_js_head.html.erb b/app/views/spree/admin/taxonomies/_js_head.html.erb new file mode 100755 index 0000000000..0b73bbbfb0 --- /dev/null +++ b/app/views/spree/admin/taxonomies/_js_head.html.erb @@ -0,0 +1,13 @@ +<% content_for :head do %> + <%= javascript_tag "var taxonomy_id = #{@taxonomy.id}; + var loading = '#{escape_javascript Spree.t(:loading)}'; + var new_taxon = '#{escape_javascript Spree.t(:new_taxon)}'; + var server_error = '#{escape_javascript Spree.t(:server_error)}'; + var taxonomy_tree_error = '#{escape_javascript Spree.t(:taxonomy_tree_error)}'; + + $(document).ready(function(){ + setup_taxonomy_tree(taxonomy_id); + }); + " + %> +<% end %> diff --git a/app/views/spree/admin/taxonomies/_list.html.erb b/app/views/spree/admin/taxonomies/_list.html.erb new file mode 100644 index 0000000000..88a9ddc049 --- /dev/null +++ b/app/views/spree/admin/taxonomies/_list.html.erb @@ -0,0 +1,26 @@ + + + + + + + + + + + + + <% @taxonomies.each do |taxonomy| %> + + + + + <% end %> + +
<%= Spree.t(:name) %>
+ + <%= taxonomy.name %> + + <%= link_to_edit taxonomy.id, :no_text => true %> + <%= link_to_delete taxonomy, :no_text => true %> +
diff --git a/app/views/spree/admin/taxonomies/_taxon.html.erb b/app/views/spree/admin/taxonomies/_taxon.html.erb new file mode 100644 index 0000000000..d5eb39190c --- /dev/null +++ b/app/views/spree/admin/taxonomies/_taxon.html.erb @@ -0,0 +1,12 @@ +<% if taxon.children.length != 0 %> + +<% end %> diff --git a/app/views/spree/admin/taxonomies/edit.erb b/app/views/spree/admin/taxonomies/edit.erb new file mode 100755 index 0000000000..e5f2dcc2b1 --- /dev/null +++ b/app/views/spree/admin/taxonomies/edit.erb @@ -0,0 +1,42 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<%= render :partial => 'js_head' %> + +<% content_for :page_title do %> + <%= Spree.t(:taxonomy_edit) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_taxonomies_list), spree.admin_taxonomies_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + + + +<%= form_for [:admin, @taxonomy] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> +
    + <%= label_tag nil, Spree.t(:tree) %>
    + +
    +
    + + +
    <%= Spree.t(:taxonomy_tree_instruction) %>
    + +
    + +
    + <%= button Spree.t('actions.update'), 'icon-refresh' %> + <%= Spree.t(:or) %> + <%= button_link_to Spree.t('actions.cancel'), admin_taxonomies_path, :icon => 'icon-remove' %> +
    +
    +<% end %> diff --git a/app/views/spree/admin/taxonomies/index.html.erb b/app/views/spree/admin/taxonomies/index.html.erb new file mode 100644 index 0000000000..57c886272d --- /dev/null +++ b/app/views/spree/admin/taxonomies/index.html.erb @@ -0,0 +1,15 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:taxonomies) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:new_taxonomy), spree.new_admin_taxonomy_url, :icon => 'icon-plus', :id => 'admin_new_taxonomy_link' %>

    +
  • +<% end %> + +
    + <%= render :partial => 'list' %> +
    diff --git a/app/views/spree/admin/taxonomies/new.html.erb b/app/views/spree/admin/taxonomies/new.html.erb new file mode 100644 index 0000000000..a46166b973 --- /dev/null +++ b/app/views/spree/admin/taxonomies/new.html.erb @@ -0,0 +1,22 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:new_taxonomy) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_taxonomies_list), spree.admin_taxonomies_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<%= form_for [:admin, @taxonomy] do |f| %> + + <%= render :partial => 'form', :locals => { :f => f } %> +
    +
    +
    + <%= button Spree.t(:create), 'icon-ok' %> +
    +
    +<% end %> diff --git a/app/views/spree/admin/taxons/_taxon_table.html.erb b/app/views/spree/admin/taxons/_taxon_table.html.erb new file mode 100644 index 0000000000..1598bfb470 --- /dev/null +++ b/app/views/spree/admin/taxons/_taxon_table.html.erb @@ -0,0 +1,23 @@ + + + + + + + + + + <% taxons.each do |taxon| %> + + + + + + <% end %> + <% if taxons.empty? %> + + <% end %> + +
    <%= Spree.t(:name) %><%= Spree.t(:path) %>
    <%= taxon.name %><%= taxon_path taxon %> + <%= link_to_delete taxon, :url => remove_admin_product_taxon_url(@product, taxon), :name => icon('delete') + ' ' + Spree.t(:remove) %> +
    <%= Spree.t(:none) %>.
    diff --git a/app/views/spree/admin/taxons/edit.html.erb b/app/views/spree/admin/taxons/edit.html.erb new file mode 100644 index 0000000000..2335bee1c5 --- /dev/null +++ b/app/views/spree/admin/taxons/edit.html.erb @@ -0,0 +1,23 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:taxon_edit) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_taxonomies_list), spree.admin_taxonomies_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<% # Because otherwise the form would attempt to use to_param of @taxon %> +<% form_url = admin_taxonomy_taxon_path(@taxonomy.id, @taxon.id) %> +<%= form_for [:admin, @taxonomy, @taxon], :method => :put, :url => form_url, :html => { :multipart => true } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> + +
    + <%= button Spree.t('actions.update'), 'icon-refresh' %> + <%= Spree.t(:or) %> + <%= button_link_to Spree.t('actions.cancel'), edit_admin_taxonomy_url(@taxonomy), :icon => "icon-remove" %> +
    +<% end %> diff --git a/app/views/spree/admin/taxons/search.rabl b/app/views/spree/admin/taxons/search.rabl new file mode 100644 index 0000000000..ac5f36f979 --- /dev/null +++ b/app/views/spree/admin/taxons/search.rabl @@ -0,0 +1,5 @@ +object false +child(@taxons => :taxons) do + attributes :name, :pretty_name, :id +end +