app/views/plugins/ecommerce/admin/settings/index.html.erb in camaleon_ecommerce-1.2 vs app/views/plugins/ecommerce/admin/settings/index.html.erb in camaleon_ecommerce-1.2.1

- old
+ new

@@ -1,24 +1,36 @@ <div class="panel panel-default"> <div class="panel-heading ui-draggable-handle"> - <h4><span class="fa fa-cogs"></span> <%= t('plugin.ecommerce.e_commerce_settings') %></h4> + <h4><span class="fa fa-cogs"></span> <%= cama_t('plugins.ecommerce.e_commerce_settings') %></h4> </div> - <%= form_tag(action: :saved, :method => "post", :class => "validate-settings") do %> + <%= form_tag(url_for(action: :saved, :method => "post"), :class => "validate-settings", id: 'ecommerce_settings_form') do %> <div class="panel-body"> + <div class="form-group col-md-4"> + <label><%= cama_t('plugins.ecommerce.table.system_currency_unit') %></label><br> + <%= select_tag( "setting[current_unit]", options_for_select(e_get_all_currencies.collect{|k, x| ["#{x[:label]} (#{x[:symbol]})", k]}, e_system_currency), class: "form-control required masked_select", 'data-live-search' => true) %> + </div> - <div class="form-group col-md-6"> - <label><%= t('plugin.ecommerce.table.currency_unit') %></label><br> - <%= select_tag( "setting[current_unit]", options_for_select(e_get_currency_units.collect{|k, x| ["#{x['name']} (#{x['symbol']})", x['code']]}, @setting[:current_unit] || 'USD'), class: "form-control required") %> + <div class="form-group col-md-4"> + <label><%= cama_t('plugins.ecommerce.table.available_currencies_unit') %></label><br> + <%= select_tag( "setting[visitor_unit_currencies]", options_for_select(e_get_all_currencies.collect{|k, x| ["#{x[:label]} (#{x[:symbol]})", k]}, e_visitor_unit_currencies), class: "form-control required", multiple: true, 'data-live-search' => true) %> </div> - <div class="form-group col-md-6"> - <label><%= t('plugin.ecommerce.table.currency_weight') %></label><br> - <%= select_tag( "setting[current_weight]", options_for_select(e_get_currency_weight.collect{|k,x| ["#{x['name']} (#{x['code']})", x['code']]}, @setting[:current_weight] || 'kg'), class: "form-control required") %> + <div class="form-group col-md-4"> + <label><%= cama_t('plugins.ecommerce.table.currency_weight') %></label><br> + <%= select_tag( "setting[current_weight]", options_for_select(e_get_currency_weights.collect{|k,x| ["#{x} (#{k})", k]}, @setting[:current_weight] || 'kg'), class: "form-control required") %> </div> + <div class="form-group col-md-4"> + <label><%= cama_t('plugins.ecommerce.table.shipping_countries') %></label><br> + <%= country_select :setting, :shipping_countries, {locale: I18n.locale.to_s, iso_codes: true, selected: e_shipping_countries}, { :name => 'setting[shipping_countries][]', class: 'form-control', multiple: true, 'data-live-search' => true, 'data-actions-box' => true } %> + </div> </div> <div class="panel-footer"> <a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a> <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button> </div> <% end %> </div> +<script type="application/javascript">jQuery(function(){ + var form = $('#ecommerce_settings_form'); + form.find('select[multiple], .masked_select').selectpicker(); +})</script>