cirandas.net

ref: master

plugins/consumers_coop/views/consumers_coop_plugin_myprofile/settings.html.erb


<%= profile.name %>

<%= form_for @profile, as: :profile_data, :url => {:controller => :consumers_coop_plugin_myprofile, :action => :settings, :profile => profile.identifier}, :html => {:multipart => true} do |f| %>

<%= t('views.profile.settings.general') %>

<%= f.fields_for :consumers_coop_settings, profile.consumers_coop_settings do |ff| %> <%= labelled_field ff, :enabled, t('views.profile.settings.collective_consumptio'), labelled_radio(ff, :enabled, t('views.profile.settings.disabled'), false) + labelled_radio(ff, :enabled, t('views.profile.settings.activated'), true) %> <%= labelled_field ff, :name_abbreviation, t('views.profile.settings.abbreviated_name_of_t'), ff.text_field(:name_abbreviation), {:help => t('views.profile.settings.this_name_will_be_use')} %> <% end %>

<%= t'views.profile.settings.default_margin_of_com' %>

<%= t'views.profile.settings.default_margin_info' %>
<%= (if profile.margin_percentage_localized then t('views.profile.settings.margin', margin: profile.margin_percentage_localized) else t('views.profile.settings.no_margin_set') end) %>
<%= modal_link_to t('views.profile.settings.change'), {controller: :suppliers_plugin_myprofile, action: :margin_change} %>
<% if defined? PaymentsPlugin %>

<%= t'views.profile.settings.payments' %>

<%= f.fields_for :consumers_coop_settings, profile.consumers_coop_settings do |ff| %> <%= labelled_field ff, :payments_enabled, t('views.profile.settings.enable_payments'), labelled_radio(ff, :payments_enabled, t('views.profile.settings.disabled'), false) + labelled_radio(ff, :payments_enabled, t('views.profile.settings.activated'), true) %> <% end %>

<%= t'views.profile.settings.set_payments' %>

<%= select_tag :payment_methods, options_for_select([[t("views.profile.settings.add_payment_method"),nil]]+@payment_methods) %>
<%= f.hidden_field 'payment_method_ids', multiple: true, value: "" %> <% profile.payment_method_ids.each do |pm| %> <%= f.hidden_field 'payment_method_ids', multiple: true, value: pm, class: "payment_method_id-"+pm.to_s %> <% method = @payment_methods.select {|method| method[1] == pm}.first %> <%= method[0] %>x <% end %>
<% end %>

<%= t('views.profile.settings.volunteers') %>

<%= f.fields_for :volunteers_settings, profile.volunteers_settings do |ff| %> <%= labelled_field ff, :cycle_volunteers_enabled, t('views.profile.settings.volunteers_enabled'), ff.check_box(:cycle_volunteers_enabled) %> <% end %> <%= f.submit t('views.profile.settings.save') %> <%= link_to t('views.profile.settings.cancel'), {:controller => :profile_editor, :profile => profile.identifier} %> <% end %>
<%= javascript_tag do %> if ( $('#profile_data_consumers_coop_settings_payments_enabled_false').attr('checked') ) { $('.payment_methods').hide(); } consumers_coop.set_payment_options() <% end %>