scinote-web/app/views/users/settings/account/preferences/index.html.erb

129 lines
5.6 KiB
Text
Raw Normal View History

<% provide(:head_title, t("users.settings.account.preferences.head_title")) %>
<% provide(:container_class, "no-second-nav-container") %>
2016-02-12 23:52:43 +08:00
<%= render partial: "users/settings/sidebar" %>
<div class="tab-content user-account-preferences">
<div class="tab-pane content-pane active" role="tabpanel">
2016-02-12 23:52:43 +08:00
2017-02-09 18:34:52 +08:00
<div class="row">
<div class="col-xs-12 col-sm-12">
2020-07-13 20:51:51 +08:00
<h1 class="preferences-title"><%= t('users.settings.account.preferences.title') %></h1>
<div class="time-zone-container">
<%= label_tag t("users.settings.account.preferences.edit.time_zone_label") %>
<div class="time-zone-selector-container">
2019-11-29 19:52:27 +08:00
<%= 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'
2019-11-29 19:52:27 +08:00
}
%>
2016-02-12 23:52:43 +08:00
</div>
<small><%= t("users.settings.account.preferences.edit.time_zone_sublabel") %></small>
</div>
<div class="date-format-container">
<%= label_tag t("users.settings.account.preferences.edit.date_format_label") %>
<div class="date-format-selector-container">
2019-11-29 19:52:27 +08:00
<%= select_tag "date-format-input-field",
options_for_select(
Constants::SUPPORTED_DATE_FORMATS.map { |df|
["#{l(Time.new(2024, 4, 22), format: :full_date, date_format: df)}", df]
},
@user.settings[:date_format]
),{
'data-path-to-update': update_preferences_path(format: :json),
class: 'hidden'
2019-11-29 19:52:27 +08:00
}
%>
2016-02-12 23:52:43 +08:00
</div>
<small><%= t("users.settings.account.preferences.edit.date_format_sublabel") %></small>
</div>
2017-02-09 18:34:52 +08:00
<hr>
<%= form_for(@user,
url: update_togglable_settings_path(format: :json),
html: { method: :post, id: 'togglable-settings-panel' },
remote: true) do |f| %>
<div class="preferences-settings-container">
<h4><%= t('notifications.title') %></h4>
<div class="row">
2023-06-19 21:45:22 +08:00
<div class="col-sm-12">
<strong><%=t 'notifications.form.assignments' %></strong>
<p><%=t 'notifications.form.assignments_description' %></p>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_scinote' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :assignments_notification, @user.assignments_notification %>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_email' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :assignments_notification_email, @user.assignments_email_notification %>
</div>
</div>
2017-02-09 18:34:52 +08:00
</div>
</div>
<div class="row">
2023-06-19 21:45:22 +08:00
<div class="col-sm-12">
<strong><%=t 'notifications.form.recent_notification' %></strong>
<p><%=t 'notifications.form.recent_notification_description' %></p>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_scinote' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :recent_notification, @user.recent_notification %>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_email' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :recent_notification_email, @user.recent_email_notification %>
</div>
</div>
</div>
</div>
<div class="row">
2023-06-19 21:45:22 +08:00
<div class="col-sm-12">
<strong><%=t 'notifications.form.system_message' %></strong>
<p><%=t 'notifications.form.system_message_description' %></p>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_scinote' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :system_message_notification %>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<%=t 'notifications.form.notification_email' %>
</div>
<div class="col-sm-8">
<%= check_box_tag :system_message_notification_email, @user.system_message_email_notification %>
</div>
</div>
</div>
2017-02-09 18:34:52 +08:00
</div>
</div>
<% end %>
<br>
2016-10-04 21:52:48 +08:00
</div>
</div>
2016-02-12 23:52:43 +08:00
</div>
<div class="tab-pane tab-pane-settings" role="tabpanel"></div>
</div>
<%= javascript_include_tag "users/settings/account/preferences/index" %>