mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Convert spree/admin/shipping_categories views from erb to haml
This commit is contained in:
@@ -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>
|
||||
@@ -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
|
||||
@@ -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 %>
|
||||
15
app/views/spree/admin/shipping_categories/edit.html.haml
Normal file
15
app/views/spree/admin/shipping_categories/edit.html.haml
Normal 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'
|
||||
@@ -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>
|
||||
24
app/views/spree/admin/shipping_categories/index.html.haml
Normal file
24
app/views/spree/admin/shipping_categories/index.html.haml
Normal 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
|
||||
@@ -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 %>
|
||||
15
app/views/spree/admin/shipping_categories/new.html.haml
Normal file
15
app/views/spree/admin/shipping_categories/new.html.haml
Normal 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'
|
||||
Reference in New Issue
Block a user