Convert spree/admin/shipping_categories views from erb to haml

This commit is contained in:
luisramos0
2019-07-16 14:48:47 +01:00
parent 9ac4c0ba30
commit 856fa8685a
8 changed files with 59 additions and 81 deletions

View File

@@ -1,6 +0,0 @@
<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,5 @@
%div{"data-hook" => "admin_shipping_category_form_fields"}
.field.align-center{"data-hook" => "name"}
= label_tag Spree.t(:name)
%br/
= f.text_field :name

View File

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

View File

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

View File

@@ -1,20 +0,0 @@
<%= 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 %>

View File

@@ -0,0 +1,15 @@
= render :partial => 'spree/admin/shared/configuration_menu'
- content_for :page_title do
= Spree.t(:new_shipping_category)
- 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'
= render :partial => 'spree/shared/error_messages', :locals => { :target => @shipping_category }
= form_for [:admin, @shipping_category] do |f|
%fieldset.no-border-top
= render :partial => 'form', :locals => { :f => f }
= render :partial => 'spree/admin/shared/new_resource_links'