mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Convert spree/admin/countries from erb to haml
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
<div data-hook="admin_country_form_fields" class="row">
|
||||
<div class="alpha four columns">
|
||||
<div data-hook="name" class="field">
|
||||
<%= f.label :name, Spree.t(:name) %>
|
||||
<%= f.text_field :name, :class => 'fullwidth' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="four columns">
|
||||
<div data-hook="iso_name" class="field">
|
||||
<%= f.label :iso_name, Spree.t(:iso_name) %>
|
||||
<%= f.text_field :iso_name, :class => 'fullwidth' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="omega four columns">
|
||||
<div data-hook="states_required" class="field checkbox">
|
||||
<label>
|
||||
<%= f.check_box :states_required %>
|
||||
<%= Spree.t(:states_required) %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
14
app/views/spree/admin/countries/_form.html.haml
Normal file
14
app/views/spree/admin/countries/_form.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
.row
|
||||
.alpha.four.columns
|
||||
.field
|
||||
= f.label :name, t("spree.name")
|
||||
= f.text_field :name, class: 'fullwidth'
|
||||
.four.columns
|
||||
.field
|
||||
= f.label :iso_name, t("spree.iso_name")
|
||||
= f.text_field :iso_name, class: 'fullwidth'
|
||||
.omega.four.columns
|
||||
.field.checkbox
|
||||
%label
|
||||
= f.check_box :states_required
|
||||
= t("spree.states_required")
|
||||
@@ -1,21 +0,0 @@
|
||||
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
||||
|
||||
<% content_for :page_title do %>
|
||||
<%= Spree.t(:editing_country) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_actions do %>
|
||||
<li>
|
||||
<%= button_link_to Spree.t(:back_to_countries_list), spree.admin_countries_path, :icon => 'icon-arrow-left' %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @country } %>
|
||||
|
||||
<%= form_for [:admin, @country] do |f| %>
|
||||
<fieldset class="no-border-top">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div class="clear"></div>
|
||||
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
16
app/views/spree/admin/countries/edit.html.haml
Normal file
16
app/views/spree/admin/countries/edit.html.haml
Normal file
@@ -0,0 +1,16 @@
|
||||
= render partial: 'spree/admin/shared/configuration_menu'
|
||||
|
||||
- content_for :page_title do
|
||||
= t("spree.editing_country")
|
||||
|
||||
- content_for :page_actions do
|
||||
%li
|
||||
= button_link_to t("spree.back_to_countries_list"), spree.admin_countries_path, icon: 'icon-arrow-left'
|
||||
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @country }
|
||||
|
||||
= form_for [:admin, @country] do |f|
|
||||
%fieldset.no-border-top
|
||||
= render partial: 'form', locals: { f: f }
|
||||
.clear
|
||||
= render partial: 'spree/admin/shared/edit_resource_links'
|
||||
@@ -1,34 +0,0 @@
|
||||
<%= render :partial => 'spree/admin/shared/configuration_menu' %>
|
||||
|
||||
<% content_for :page_title do %>
|
||||
<%= Spree.t(:listing_countries) %>
|
||||
<% end %>
|
||||
|
||||
<table class="index" id='listing_countries' data-hook>
|
||||
<colgroup>
|
||||
<col style="width: 35%" />
|
||||
<col style="width: 35%" />
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 10%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr data-hook="tax_header">
|
||||
<th><%= Spree.t(:country_name) %></th>
|
||||
<th><%= Spree.t(:iso_name) %></th>
|
||||
<th><%= Spree.t(:states_required) %></th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @countries.each do |country| %>
|
||||
<tr id="<%= spree_dom_id country %>" data-hook="country_row" class="<%= cycle('odd', 'even')%>">
|
||||
<td><%= country.name %></td>
|
||||
<td><%= country.iso_name %></td>
|
||||
<td class="align-center"><%= country.states_required.to_s.titleize %></td>
|
||||
<td class="actions">
|
||||
<%= link_to_edit country, :no_text => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
27
app/views/spree/admin/countries/index.html.haml
Normal file
27
app/views/spree/admin/countries/index.html.haml
Normal file
@@ -0,0 +1,27 @@
|
||||
= render partial: 'spree/admin/shared/configuration_menu'
|
||||
|
||||
- content_for :page_title do
|
||||
= t("spree.listing_countries")
|
||||
|
||||
%table#listing_countries.index
|
||||
%colgroup
|
||||
%col{:style => "width: 35%"}/
|
||||
%col{:style => "width: 35%"}/
|
||||
%col{:style => "width: 20%"}/
|
||||
%col{:style => "width: 10%"}/
|
||||
%thead
|
||||
%tr
|
||||
%th= t("spree.country_name")
|
||||
%th= t("spree.iso_name")
|
||||
%th= t("spree.states_required")
|
||||
%th.actions
|
||||
%tbody
|
||||
- @countries.each do |country|
|
||||
- tr_class = cycle('odd', 'even')
|
||||
- tr_id = spree_dom_id(country)
|
||||
%tr{class: tr_class, id: tr_id}
|
||||
%td= country.name
|
||||
%td= country.iso_name
|
||||
%td.align-center= country.states_required.to_s.titleize
|
||||
%td.actions
|
||||
= link_to_edit country, no_text: true
|
||||
Reference in New Issue
Block a user