<%= form_for @setting, remote: true do |setting_field| %>

<%= I18n.t('settings.settings') %>

<%= setting_field.label :language do %> <%= I18n.t('settings.language') %> <%= setting_field.select :language, I18n.available_locales.collect{|lang| [(I18n.t lang), lang.to_s]}, class: "form-control input-xs pw_settings_label" %> <% end %>
<%= setting_field.label :time_zone do %> <%= I18n.t('settings.time_zone') %> <%= setting_field.time_zone_select :time_zone, nil, default: 'Paris', class: "pw_settings_label" %> <% end %>
<%= setting_field.fields_for :display_params do |d_p_fields| %>
<%= d_p_fields.label :background_color do %> <%= I18n.t('settings.background_color') %> <%= d_p_fields.text_field :background_color, :value => @setting.display_params['background_color'][-2,2].to_i(16), class: 'slider pw_settings_label', "data-slider-id" => 'fontColorSlider' %> <% end %>
<%= d_p_fields.label :font_color do %> <%= I18n.t('settings.font_color') %> <%= d_p_fields.text_field :font_color, value: @setting.display_params['font_color'][-2,2].to_i(16), class: 'slider pw_settings_label', "data-slider-id" => 'fontColorSlider' %> <% end %>
<% end %> <% if Server.itself?(PIXADMIN_SERVER_NAME) || Server.itself?(PTREF_SERVER_NAME) %>
<%= setting_field.label :under_my_thumb do %> <%= I18n.t('settings.under_my_thumb') %> <%= setting_field.select(:under_my_thumb, options_for_select([ ['Credit PP', "normalized_credit"], [I18n.t('creator_iptc',creator_word: I18n.t(session[:creator_word])), "creator"], [I18n.t('original_filename'), "original_filename"], [I18n.t('source',provider_word: I18n.t(session[:provider_word], count: 1)).capitalize, "source"], [I18n.t('rights'), "rights"], [I18n.t('credit'), "credit"], [I18n.t('pp_created_at'), "created_at"] ], default_setting_thumb), class: "form-control input-xs pw_settings_label") %> <% end %>
<% end %>
<%= setting_field.label I18n.t('settings.thumbnail_rollover') %>
<%= setting_field.label :display_params_display_text, I18n.t('settings.display_text') %> <%= setting_field.check_box :display_params_display_text %>
<%= setting_field.label :display_params_previsualisation, I18n.t('settings.previsualisation') %> <%= setting_field.check_box :display_params_previsualisation %>
<%= setting_field.label :pagination, style: "margin-bottom: 0;" do %> <%= I18n.t('settings.endless_page') %> <%= setting_field.check_box :pagination, class: "pw_settings_label" %> <% end %>
<%= I18n.t('settings.endless_page_info') %>
<%= setting_field.label :default_sort do %> <%= I18n.t('sort').capitalize %> <%= setting_field.select(:default_sort, options_for_select(sort_list, default_setting_sort), class: "form-control input-xs pw_settings_label") %> <% end %>
<%= setting_field.label :default_media do %> Medias <%= setting_field.select(:default_media, options_for_select([ [I18n.t('all'), 'all'], ["Photos", 'photos'], ["Vidéos", 'videos'] ], default_setting_media), class: "form-control input-xs pw_settings_label") %> <% end %>
<% if Server.itself?(PIXADMIN_SERVER_NAME) || Server.itself?(VINGTMINUTES_SERVER_NAME) %>
<%= setting_field.label :reload_pref do %> <%= I18n.t('settings.refresh') %> <%= setting_field.select(:reload_pref, options_for_select([ [I18n.t('settings.no_refresh'), 0], [I18n.t('settings.1mn_refresh'), 1], [I18n.t('settings.5mn_refresh'), 5], [I18n.t('settings.10mn_refresh'), 10], [I18n.t('settings.15mn_refresh'), 15] ], @setting[:reload_pref]), class: "form-control input-xs pw_settings_label") %> <% end %>
<% end %>
<% end %>