Bring spree/admin/shipping categories from spree_backend so we can de-deface it

This commit is contained in:
luisramos0
2019-07-16 14:46:26 +01:00
parent 2709f237f5
commit 9ac4c0ba30
4 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<div data-hook="admin_shipping_category_form_fields">
<div data-hook="name" class="field align-center">
<%= label_tag Spree.t(:name) %><br>
<%= f.text_field :name %>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<% content_for :page_title do %>
<%= Spree.t(:editing_shipping_category) %>
<% end %>
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:back_to_shipping_categories), spree.admin_shipping_categories_path, :icon => 'icon-arrow-left' %>
</li>
<% end %>
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @shipping_category } %>
<%= form_for [:admin, @shipping_category] do |f| %>
<fieldset class="no-border-top">
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
</fieldset>
<% end %>

View File

@@ -0,0 +1,35 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<% content_for :page_title do %>
<%= Spree.t(:shipping_categories) %>
<% end %>
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:new_shipping_category), new_object_url, :icon => 'icon-plus' %>
</li>
<% end %>
<table class="index">
<colgroup>
<col style="width: 85%">
<col style="width: 15%">
</colgroup>
<thead>
<tr data-hook="categories_header">
<th><%= Spree.t(:name) %></th>
<th class="actions"></th>
</tr>
</thead>
<tbody>
<% @shipping_categories.each do |shipping_category|%>
<tr id="<%= spree_dom_id shipping_category %>" data-hook="category_row" class="<%= cycle('odd', 'even')%>">
<td style="width:350px;"><%= shipping_category.name %></td>
<td class="actions">
<%= link_to_edit shipping_category, :no_text => true %>
<%= link_to_delete shipping_category, :no_text => true %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,20 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<% content_for :page_title do %>
<%= Spree.t(:new_shipping_category) %>
<% end %>
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:back_to_shipping_categories_list), spree.admin_shipping_categories_path, :icon => 'icon-arrow-left' %>
</li>
<% end %>
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @shipping_category } %>
<%= form_for [:admin, @shipping_category] do |f| %>
<fieldset class="no-border-top">
<%= render :partial => 'form', :locals => { :f => f } %>
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
</fieldset>
<% end %>