From 9db4edcd0debfb93f4a02dbe0dcc262feee5e5ab Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 16 Jul 2019 14:43:20 +0100 Subject: [PATCH] Convert spree/admin/image_settings/edit.html from erb to haml --- .../spree/admin/image_settings/edit.html.erb | 126 ------------------ .../spree/admin/image_settings/edit.html.haml | 78 +++++++++++ 2 files changed, 78 insertions(+), 126 deletions(-) delete mode 100644 app/views/spree/admin/image_settings/edit.html.erb create mode 100644 app/views/spree/admin/image_settings/edit.html.haml diff --git a/app/views/spree/admin/image_settings/edit.html.erb b/app/views/spree/admin/image_settings/edit.html.erb deleted file mode 100644 index 1f84f92f8f..0000000000 --- a/app/views/spree/admin/image_settings/edit.html.erb +++ /dev/null @@ -1,126 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:image_settings) %> -<% end %> - -<%= form_tag admin_image_settings_path, :method => :put do %> - <% destroy = Spree.t(:destroy) %> - -
-
- <%= Spree.t(:general_settings)%> - -
-
<%= Spree.t(:image_settings_warning) %>
-
- -
- <%= label_tag 'preferences[attachment_path]', Spree.t(:attachment_path) %> - <%= preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string %> -
- -
-
- <%= label_tag 'preferences[attachment_default_url]', Spree.t(:attachment_default_url) %> - <%= preference_field_tag 'preferences[attachment_default_url]', Spree::Config[:attachment_default_url], :type => :string %> -
-
- -
-
- <%= label_tag 'preferences[attachment_url]', Spree.t(:attachment_url) %> - <%= preference_field_tag 'preferences[attachment_url]', Spree::Config[:attachment_url], :type => :string %> -
-
- -
-
- <%= label_tag 'preferences[attachment_default_style]', Spree.t(:attachment_default_style) %> - <%= collection_select 'preferences', 'attachment_default_style', @styles, :first, :first, {:selected => Spree::Config[:attachment_default_style] }, :class => 'select2 fullwidth' %> -
-
- -
- -
- <%= preference_field_tag 'preferences[use_s3]', Spree::Config[:use_s3], :type => :boolean %> - <%= label_tag 'preferences[use_s3]', Spree.t(:use_s3) %> -
- -
- -
- <%= Spree.t(:attachment_styles) %> - -
- <% @styles.each_with_index do |(style_name, style_value), index| %> -
- <%= label_tag "attachment_styles[#{style_name}]", style_name %> - - <%= text_field_tag "attachment_styles[#{style_name}]", style_value, :class => 'fullwidth' %> -
- <% end %> -
- -
- -
- <%= link_to_with_icon 'icon-plus', Spree.t(:add_new_style), '#', :class => 'add_new_style button' %> -
-
- -
- - - -
- - -
- <%= button Spree.t('actions.update'), 'icon-refresh' %> -
-
- -<% end %> diff --git a/app/views/spree/admin/image_settings/edit.html.haml b/app/views/spree/admin/image_settings/edit.html.haml new file mode 100644 index 0000000000..2716cdd848 --- /dev/null +++ b/app/views/spree/admin/image_settings/edit.html.haml @@ -0,0 +1,78 @@ += render :partial => 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = Spree.t(:image_settings) + += form_tag admin_image_settings_path, :method => :put do + - destroy = Spree.t(:destroy) + + %fieldset.no-border-top + %fieldset.no-border-bottom + %legend{:align => "center"}= Spree.t(:general_settings) + .field + .warning.note= Spree.t(:image_settings_warning) + + .field{"data-hook" => "attachment_path"} + = label_tag 'preferences[attachment_path]', Spree.t(:attachment_path) + = preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string + .alpha.eight.columns + .field{"data-hook" => "attachment_default_url"} + = label_tag 'preferences[attachment_default_url]', Spree.t(:attachment_default_url) + = preference_field_tag 'preferences[attachment_default_url]', Spree::Config[:attachment_default_url], :type => :string + .alpha.eight.columns + .field{"data-hook" => "attachment_url"} + = label_tag 'preferences[attachment_url]', Spree.t(:attachment_url) + = preference_field_tag 'preferences[attachment_url]', Spree::Config[:attachment_url], :type => :string + .omega.four.columns + .field{"data-hook" => "attachment_default_style"} + = label_tag 'preferences[attachment_default_style]', Spree.t(:attachment_default_style) + = collection_select 'preferences', 'attachment_default_style', @styles, :first, :first, {:selected => Spree::Config[:attachment_default_style] }, :class => 'select2 fullwidth' + .clear + .field{"data-hook" => "use_s3"} + = preference_field_tag 'preferences[use_s3]', Spree::Config[:use_s3], :type => :boolean + = label_tag 'preferences[use_s3]', Spree.t(:use_s3) + + %fieldset#attachment_styles.no-border-bottom{"data-hook" => "attachment_styles"} + %legend{:align => "center"}= Spree.t(:attachment_styles) + #styles_list.row.frameless + - @styles.each_with_index do |(style_name, style_value), index| + .field.three.columns + = label_tag "attachment_styles[#{style_name}]", style_name + %a.destroy_style.with-tip{:alt => destroy, :href => "#", :title => destroy} + %i.icon-trash + = text_field_tag "attachment_styles[#{style_name}]", style_value, :class => 'fullwidth' + #new-styles.row.frameless + .field + = link_to_with_icon 'icon-plus', Spree.t(:add_new_style), '#', :class => 'add_new_style button' + + .row + #s3_settings.alpha.six.columns{"data-hook" => "s3_settings", :style => "display: none"} + %fieldset.no-border-bottom + %legend{:align => "center"}= Spree.t(:configure_s3) + .field{"data-hook" => "s3_access_key"} + = label_tag 'preferences[s3_access_key]', Spree.t(:s3_access_key) + = preference_field_tag 'preferences[s3_access_key]', Spree::Config[:s3_access_key], :type => :string + .field{"data-hook" => "s3_secret"} + = label_tag 'preferences[s3_secret]', Spree.t(:s3_secret) + = preference_field_tag 'preferences[s3_secret]', Spree::Config[:s3_secret], :type => :string + .field{"data-hook" => "s3_bucket"} + = label_tag 'preferences[s3_bucket]', Spree.t(:s3_bucket) + = preference_field_tag 'preferences[s3_bucket]', Spree::Config[:s3_bucket], :type => :string + .field{"data-hook" => "s3_protocol"} + = label_tag 'preferences[s3_protocol]', Spree.t(:s3_protocol) + = preference_field_tag 'preferences[s3_protocol]', Spree::Config[:s3_protocol], :type => :string + + #s3_headers.omega.six.columns{"data-hook" => "s3_headers", :style => "display: none"} + %fieldset.no-border-bottom + %legend{:align => "center"}= Spree.t(:s3_headers) + #headers_list + - @headers.each do |header_name, header_value| + .field + = label_tag "s3_headers[#{header_name}]", header_name + %a.destroy_header.with-tip{:alt => destroy, :href => "#", :title => destroy} + %i.icon-trash + = text_field_tag "s3_headers[#{header_name}]", header_value, :class => 'fullwidth' + = link_to_with_icon 'icon-plus', Spree.t(:add_new_header), '#', :class => 'add_header button' + + .form-buttons.filter-actions.actions{"data-hook" => "buttons"} + = button Spree.t('actions.update'), 'icon-refresh'