diff --git a/app/views/spree/admin/taxons/_form.html.haml b/app/views/spree/admin/taxons/_form.html.haml index 19a8af5936..72ba498a4d 100644 --- a/app/views/spree/admin/taxons/_form.html.haml +++ b/app/views/spree/admin/taxons/_form.html.haml @@ -1,11 +1,11 @@ -.row{"data-hook" => "admin_inside_taxon_form"} +.row .alpha.five.columns = f.field_container :name do = f.label :name, t(:name) %span.required * %br/ - = error_message_on :taxon, :name, :class => 'fullwidth title' - = text_field :taxon, :name, :class => 'fullwidth' + = error_message_on :taxon, :name, class: 'fullwidth title' + = text_field :taxon, :name, class: 'fullwidth' = f.field_container :permalink_part do = f.label :permalink_part, t(:permalink) %span.required * @@ -20,17 +20,17 @@ = f.field_container :meta_title do = f.label :meta_title, t(:meta_title) %br/ - = f.text_field :meta_title, :class => 'fullwidth', :rows => 6 + = f.text_field :meta_title, class: 'fullwidth', rows: 6 = f.field_container :meta_description do = f.label :meta_description, t(:meta_description) %br/ - = f.text_field :meta_description, :class => 'fullwidth', :rows => 6 + = f.text_field :meta_description, class: 'fullwidth', rows: 6 = f.field_container :meta_description do = f.label :meta_keywords, t(:meta_keywords) %br/ - = f.text_field :meta_keywords, :class => 'fullwidth', :rows => 6 + = f.text_field :meta_keywords, class: 'fullwidth', rows: 6 .omega.seven.columns = f.field_container :description do = f.label :description, t(:description) %br/ - = f.text_area :description, :class => 'fullwidth', :rows => 6 + = f.text_area :description, class: 'fullwidth', rows: 6 diff --git a/app/views/spree/admin/taxons/_taxon_table.html.erb b/app/views/spree/admin/taxons/_taxon_table.html.erb deleted file mode 100644 index 1598bfb470..0000000000 --- a/app/views/spree/admin/taxons/_taxon_table.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - <% 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/_taxon_table.html.haml b/app/views/spree/admin/taxons/_taxon_table.html.haml new file mode 100644 index 0000000000..7917db0c97 --- /dev/null +++ b/app/views/spree/admin/taxons/_taxon_table.html.haml @@ -0,0 +1,20 @@ +%table.index + %thead + %tr + %th= t("spree.name") + %th= t("spree.path") + %th + %tbody + - taxons.each do |taxon| + - tr_class = cycle('odd', 'even') + - tr_id = spree_dom_id(taxon) + %tr{class: tr_class, id: tr_id} + %td= taxon.name + %td= taxon_path taxon + %td.actions + = link_to_delete taxon, url: remove_admin_product_taxon_url(@product, taxon), name: icon('delete') + ' ' + t("spree.remove") + - if taxons.empty? + %tr + %td{colspan: "3"} + = t("spree.none") + \. diff --git a/app/views/spree/admin/taxons/edit.html.erb b/app/views/spree/admin/taxons/edit.html.erb deleted file mode 100644 index 2335bee1c5..0000000000 --- a/app/views/spree/admin/taxons/edit.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= 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/edit.html.haml b/app/views/spree/admin/taxons/edit.html.haml new file mode 100644 index 0000000000..7e1e0a45e4 --- /dev/null +++ b/app/views/spree/admin/taxons/edit.html.haml @@ -0,0 +1,17 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.taxon_edit") + +- content_for :page_actions do + %li + = button_link_to t("spree.back_to_taxonomies_list"), spree.admin_taxonomies_path, icon: 'icon-arrow-left' + +- # 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 } + .form-buttons + = button t('spree.actions.update'), 'icon-refresh' + = t("spree.or") + = button_link_to t('spree.actions.cancel'), edit_admin_taxonomy_url(@taxonomy), icon: "icon-remove" diff --git a/app/views/spree/admin/taxons/search.rabl b/app/views/spree/admin/taxons/search.rabl index ac5f36f979..5214337d12 100644 --- a/app/views/spree/admin/taxons/search.rabl +++ b/app/views/spree/admin/taxons/search.rabl @@ -2,4 +2,3 @@ object false child(@taxons => :taxons) do attributes :name, :pretty_name, :id end -