mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Bring image_settings view from spree_backend
This commit is contained in:
126
app/views/spree/admin/image_settings/edit.html.erb
Normal file
126
app/views/spree/admin/image_settings/edit.html.erb
Normal file
@@ -0,0 +1,126 @@
|
||||
<%= 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) %>
|
||||
|
||||
<fieldset class="no-border-top">
|
||||
<fieldset class="no-border-bottom">
|
||||
<legend align="center"><%= Spree.t(:general_settings)%></legend>
|
||||
|
||||
<div class="field">
|
||||
<div class="warning note"><%= Spree.t(:image_settings_warning) %></div>
|
||||
</div>
|
||||
|
||||
<div data-hook="attachment_path" class="field">
|
||||
<%= label_tag 'preferences[attachment_path]', Spree.t(:attachment_path) %>
|
||||
<%= preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string %>
|
||||
</div>
|
||||
|
||||
<div class="alpha eight columns">
|
||||
<div data-hook="attachment_default_url" class="field">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alpha eight columns">
|
||||
<div data-hook="attachment_url" class="field">
|
||||
<%= label_tag 'preferences[attachment_url]', Spree.t(:attachment_url) %>
|
||||
<%= preference_field_tag 'preferences[attachment_url]', Spree::Config[:attachment_url], :type => :string %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="omega four columns">
|
||||
<div data-hook="attachment_default_style" class="field">
|
||||
<%= 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' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div data-hook="use_s3" class="field">
|
||||
<%= preference_field_tag 'preferences[use_s3]', Spree::Config[:use_s3], :type => :boolean %>
|
||||
<%= label_tag 'preferences[use_s3]', Spree.t(:use_s3) %>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="no-border-bottom" id="attachment_styles" data-hook="attachment_styles">
|
||||
<legend align="center"><%= Spree.t(:attachment_styles) %></legend>
|
||||
|
||||
<div id="styles_list" class="row frameless">
|
||||
<% @styles.each_with_index do |(style_name, style_value), index| %>
|
||||
<div class="field three columns">
|
||||
<%= label_tag "attachment_styles[#{style_name}]", style_name %>
|
||||
<a href='#' alt="<%= destroy %>" title="<%= destroy %>" class='destroy_style with-tip'><i class='icon-trash'></i></a>
|
||||
<%= text_field_tag "attachment_styles[#{style_name}]", style_value, :class => 'fullwidth' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="new-styles" class="row frameless"></div>
|
||||
|
||||
<div class="field">
|
||||
<%= link_to_with_icon 'icon-plus', Spree.t(:add_new_style), '#', :class => 'add_new_style button' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="row">
|
||||
<div class="alpha six columns" id="s3_settings" data-hook="s3_settings" style="display: none">
|
||||
<fieldset class="no-border-bottom">
|
||||
<legend align="center"><%= Spree.t(:configure_s3) %></legend>
|
||||
|
||||
<div data-hook="s3_access_key" class="field">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
|
||||
<div data-hook="s3_secret" class="field">
|
||||
<%= label_tag 'preferences[s3_secret]', Spree.t(:s3_secret) %>
|
||||
<%= preference_field_tag 'preferences[s3_secret]', Spree::Config[:s3_secret], :type => :string %>
|
||||
</div>
|
||||
|
||||
<div data-hook="s3_bucket" class="field">
|
||||
<%= label_tag 'preferences[s3_bucket]', Spree.t(:s3_bucket) %>
|
||||
<%= preference_field_tag 'preferences[s3_bucket]', Spree::Config[:s3_bucket], :type => :string %>
|
||||
</div>
|
||||
|
||||
<div data-hook="s3_protocol" class="field">
|
||||
<%= label_tag 'preferences[s3_protocol]', Spree.t(:s3_protocol) %>
|
||||
<%= preference_field_tag 'preferences[s3_protocol]', Spree::Config[:s3_protocol], :type => :string %>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="omega six columns" id="s3_headers" data-hook="s3_headers" style="display: none">
|
||||
<fieldset class="no-border-bottom">
|
||||
<legend align="center"><%= Spree.t(:s3_headers) %></legend>
|
||||
|
||||
<div id="headers_list">
|
||||
<% @headers.each do |header_name, header_value| %>
|
||||
<div class="field">
|
||||
<%= label_tag "s3_headers[#{header_name}]", header_name %>
|
||||
<a href="#" alt="<%= destroy %>" title="<%= destroy %>" class="destroy_header with-tip"><i class="icon-trash"></i></a>
|
||||
<%= text_field_tag "s3_headers[#{header_name}]", header_value, :class => 'fullwidth' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to_with_icon 'icon-plus', Spree.t(:add_new_header), '#', :class => 'add_header button' %>
|
||||
|
||||
</fiedlset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
||||
<%= button Spree.t('actions.update'), 'icon-refresh' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user