diff --git a/app/views/spree/admin/countries/_form.html.erb b/app/views/spree/admin/countries/_form.html.erb deleted file mode 100644 index 347d5e6577..0000000000 --- a/app/views/spree/admin/countries/_form.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
-
-
- <%= f.label :name, Spree.t(:name) %> - <%= f.text_field :name, :class => 'fullwidth' %> -
-
-
-
- <%= f.label :iso_name, Spree.t(:iso_name) %> - <%= f.text_field :iso_name, :class => 'fullwidth' %> -
-
-
-
- -
-
-
\ No newline at end of file diff --git a/app/views/spree/admin/countries/_form.html.haml b/app/views/spree/admin/countries/_form.html.haml new file mode 100644 index 0000000000..8a2951ca9c --- /dev/null +++ b/app/views/spree/admin/countries/_form.html.haml @@ -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") diff --git a/app/views/spree/admin/countries/edit.html.erb b/app/views/spree/admin/countries/edit.html.erb deleted file mode 100644 index d5f8fc27d1..0000000000 --- a/app/views/spree/admin/countries/edit.html.erb +++ /dev/null @@ -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 %> -
  • - <%= button_link_to Spree.t(:back_to_countries_list), spree.admin_countries_path, :icon => 'icon-arrow-left' %> -
  • -<% end %> - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @country } %> - -<%= form_for [:admin, @country] do |f| %> -
    - <%= render :partial => 'form', :locals => { :f => f } %> -
    - <%= render :partial => 'spree/admin/shared/edit_resource_links' %> -
    -<% end %> diff --git a/app/views/spree/admin/countries/edit.html.haml b/app/views/spree/admin/countries/edit.html.haml new file mode 100644 index 0000000000..5c46ea91ea --- /dev/null +++ b/app/views/spree/admin/countries/edit.html.haml @@ -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' diff --git a/app/views/spree/admin/countries/index.html.erb b/app/views/spree/admin/countries/index.html.erb deleted file mode 100644 index 2ad4c47956..0000000000 --- a/app/views/spree/admin/countries/index.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:listing_countries) %> -<% end %> - - - - - - - - - - - - - - - - - - <% @countries.each do |country| %> - - - - - - - <% end %> - -
    <%= Spree.t(:country_name) %><%= Spree.t(:iso_name) %><%= Spree.t(:states_required) %>
    <%= country.name %><%= country.iso_name %><%= country.states_required.to_s.titleize %> - <%= link_to_edit country, :no_text => true %> -
    \ No newline at end of file diff --git a/app/views/spree/admin/countries/index.html.haml b/app/views/spree/admin/countries/index.html.haml new file mode 100644 index 0000000000..0eb473667b --- /dev/null +++ b/app/views/spree/admin/countries/index.html.haml @@ -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