<% provide(:head_title, t("users.settings.account.preferences.head_title")) %> <% provide(:container_class, "no-second-nav-container") %> <%= render partial: "users/settings/sidebar" %>

<%= t('users.settings.account.preferences.title') %>

<%= label_tag t("users.settings.account.preferences.edit.time_zone_label") %>
<%= select_tag "time-zone-input-field", options_for_select( ActiveSupport::TimeZone.all.map{ |tz| [tz.formatted_offset + " " + tz.name, tz.name] }, @user.settings[:time_zone] ),{ 'data-path-to-update': update_preferences_path(format: :json), class: 'hidden' } %>
<%= t("users.settings.account.preferences.edit.time_zone_sublabel") %>
<%= label_tag t("users.settings.account.preferences.edit.date_format_label") %>
<%= select_tag "date-format-input-field", options_for_select( Constants::SUPPORTED_DATE_FORMATS.map { |df| ["#{l(Time.new(2019, 11, 25), format: :full_date, date_format: df)}", df] }, @user.settings[:date_format] ),{ 'data-path-to-update': update_preferences_path(format: :json), class: 'hidden' } %>
<%= t("users.settings.account.preferences.edit.date_format_sublabel") %>

<%= form_for(@user, url: update_togglable_settings_path(format: :json), html: { method: :post, id: 'togglable-settings-panel' }, remote: true) do |f| %>

<%= t('notifications.title') %>

<%=t 'notifications.form.assignments' %>

<%=t 'notifications.form.assignments_description' %>

<%=t 'notifications.form.notification_scinote' %>
<%= check_box_tag :assignments_notification, @user.assignments_notification %>
<%=t 'notifications.form.notification_email' %>
<%= check_box_tag :assignments_notification_email, @user.assignments_email_notification %>
<%=t 'notifications.form.recent_notification' %>

<%=t 'notifications.form.recent_notification_description' %>

<%=t 'notifications.form.notification_scinote' %>
<%= check_box_tag :recent_notification, @user.recent_notification %>
<%=t 'notifications.form.notification_email' %>
<%= check_box_tag :recent_notification_email, @user.recent_email_notification %>
<%=t 'notifications.form.system_message' %>

<%=t 'notifications.form.system_message_description' %>

<%=t 'notifications.form.notification_scinote' %>
<%= check_box_tag :system_message_notification %>
<%=t 'notifications.form.notification_email' %>
<%= check_box_tag :system_message_notification_email, @user.system_message_email_notification %>
<% end %>
<%= javascript_include_tag "users/settings/account/preferences/index" %>