2017-02-09 18:07:16 +08:00
|
|
|
<% provide(:head_title, t("users.settings.account.preferences.head_title")) %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% provide(:container_class, "no-second-nav-container") %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2018-04-05 22:30:02 +08:00
|
|
|
<%= render partial: "users/settings/sidebar.html.erb" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="tab-content">
|
2018-05-08 22:33:42 +08:00
|
|
|
<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">
|
2018-04-05 22:30:02 +08:00
|
|
|
<div class="col-xs-12 col-sm-12">
|
2017-02-09 18:34:52 +08:00
|
|
|
<%= form_for(@user,
|
|
|
|
url: update_preferences_path(format: :json),
|
|
|
|
remote: true,
|
2017-08-10 20:29:01 +08:00
|
|
|
html: {
|
|
|
|
method: :put,
|
|
|
|
'data-for' => 'settings[time_zone]',
|
|
|
|
'data-turbolinks' => false
|
|
|
|
}) do |f| %>
|
2017-02-09 18:34:52 +08:00
|
|
|
<div data-part="view">
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label t("users.settings.account.preferences.edit.time_zone_label") %>
|
|
|
|
<div class="input-group" style="max-width: 500px;">
|
|
|
|
<input class="form-control"
|
|
|
|
disabled="disabled"
|
|
|
|
autocomplete="off"
|
|
|
|
type="text"
|
2017-08-10 17:30:57 +08:00
|
|
|
value="<%= @user.settings[:time_zone] %>"
|
|
|
|
name="fake_user[settings][time_zone]"
|
|
|
|
id="fake_user_settings_time_zone">
|
2017-02-09 18:34:52 +08:00
|
|
|
<span class="input-group-btn">
|
|
|
|
<a href="#" class="btn btn-default" data-action="edit"><%=t "general.edit" %></a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<small><%= t("users.settings.account.preferences.edit.time_zone_sublabel") %></small>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
<div data-part="edit" style="display: none;">
|
|
|
|
<div class="well">
|
|
|
|
<h4><%=t "users.settings.account.preferences.edit.time_zone_title" %></h4>
|
|
|
|
<div class="form-group" style="max-width: 500px;">
|
|
|
|
<%= f.select :time_zone, ActiveSupport::TimeZone.all.collect { |tz|
|
|
|
|
[tz.formatted_offset + " " + tz.name, tz.name]
|
2018-08-08 17:43:18 +08:00
|
|
|
}, {}, {class: 'form-control selectpicker', 'data-role': 'clear'} %>
|
2017-02-09 18:34:52 +08:00
|
|
|
<small><%= t("users.settings.account.preferences.edit.time_zone_sublabel") %></small>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="#" class="btn btn-default" data-action="cancel"><%=t "general.cancel" %></a>
|
2018-11-09 22:58:08 +08:00
|
|
|
<%= f.submit t("general.save"), class: "btn btn-success" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%= form_for(@user,
|
|
|
|
url: update_preferences_path(format: :json),
|
|
|
|
remote: true,
|
|
|
|
html: {
|
|
|
|
method: :put,
|
|
|
|
'data-for' => 'date_format',
|
|
|
|
'data-turbolinks' => false
|
|
|
|
}) do |f| %>
|
|
|
|
<div data-part="view">
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label t("users.settings.account.preferences.edit.date_format_label") %>
|
|
|
|
<div class="input-group" style="max-width: 500px;">
|
|
|
|
<input class="form-control"
|
|
|
|
disabled="disabled"
|
|
|
|
autocomplete="off"
|
|
|
|
type="text"
|
2019-01-03 21:15:41 +08:00
|
|
|
value="<%= l(Time.new(2014, 11, 6), format: :full_date) %>"
|
2018-11-09 22:58:08 +08:00
|
|
|
name="fake_user[settings][time_zone]"
|
|
|
|
id="fake_user_settings_date_format">
|
|
|
|
<span class="input-group-btn">
|
|
|
|
<a href="#" class="btn btn-default" data-action="edit"><%=t "general.edit" %></a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<small><%= t("users.settings.account.preferences.edit.date_format_sublabel") %></small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div data-part="edit" style="display: none;">
|
|
|
|
<div class="well">
|
|
|
|
<h4><%=t "users.settings.account.preferences.edit.date_format_title" %></h4>
|
|
|
|
<div class="form-group" style="max-width: 500px;">
|
|
|
|
<%= f.select :date_format, Constants::SUPPORTED_DATE_FORMATS.collect { |df|
|
2019-01-03 21:15:41 +08:00
|
|
|
["#{l(Time.new(2014, 11, 6), format: :full_date, date_format: df)}", df]
|
2018-11-09 22:58:08 +08:00
|
|
|
}, {}, { class: 'form-control selectpicker', 'data-role': 'clear' } %>
|
|
|
|
<small><%= t("users.settings.account.preferences.edit.date_format_sublabel") %></small>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="#" class="btn btn-default" data-action="cancel"><%=t "general.cancel" %></a>
|
2018-04-25 19:57:12 +08:00
|
|
|
<%= f.submit t("general.save"), class: "btn btn-success" %>
|
2017-02-09 18:34:52 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
<% end %>
|
|
|
|
<hr>
|
2018-09-05 22:36:32 +08:00
|
|
|
<%= form_for(@user,
|
|
|
|
url: update_togglable_settings_path(format: :json),
|
|
|
|
html: { method: :post, id: 'togglable-settings-panel' },
|
|
|
|
remote: true) do |f| %>
|
2018-10-02 19:57:45 +08:00
|
|
|
<div class="preferences-settings-container">
|
2018-09-05 22:36:32 +08:00
|
|
|
<h4><%= t('notifications.title') %></h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<span class="assignment hidden-sm">
|
|
|
|
<i class="fas fa-newspaper"></i>
|
|
|
|
</span>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<strong><%=t 'notifications.form.assignments' %></strong>
|
|
|
|
<p><%=t 'notifications.form.assignments_description' %></p>
|
2017-04-12 22:56:47 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<%=t 'notifications.form.notification_scinote' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
2018-09-05 22:36:32 +08:00
|
|
|
<%= check_box_tag :assignments_notification, @user.assignments_notification %>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<%=t 'notifications.form.notification_email' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
2018-09-05 22:36:32 +08:00
|
|
|
<%= check_box_tag :assignments_notification_email, @user.assignments_email_notification %>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<%= image_tag 'icon_small/missing.png', class: 'img-circle ' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<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>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
2019-02-22 20:20:51 +08:00
|
|
|
<span class="system-message hidden-sm"><i class="fas fa-gift" aria-hidden="true"></i></span>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<strong><%=t 'notifications.form.system_message' %></strong>
|
|
|
|
<p><%=t 'notifications.form.system_message_description' %></p>
|
2017-04-12 22:56:47 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<%=t 'notifications.form.notification_scinote' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
2018-09-05 22:36:32 +08:00
|
|
|
<%= check_box_tag :system_message_notification %>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<%=t 'notifications.form.notification_email' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
2018-09-05 22:36:32 +08:00
|
|
|
<%= check_box_tag :system_message_notification_email, @user.system_message_email_notification %>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
</div>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<hr>
|
2018-10-02 19:57:45 +08:00
|
|
|
<div class="preferences-settings-container">
|
2018-09-05 22:36:32 +08:00
|
|
|
<h4><%= t('users.settings.account.preferences.edit.tips.title') %></h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<p><%=t 'users.settings.account.preferences.edit.tips.text1' %></p>
|
|
|
|
<p><%=t 'users.settings.account.preferences.edit.tips.text2' %></p>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<%=t 'users.settings.account.preferences.edit.tips.toggle' %>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<%= check_box_tag :tooltips_enabled, @user.settings[:tooltips_enabled] %>
|
|
|
|
</div>
|
2017-04-12 22:56:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
</div>
|
2016-10-04 21:52:48 +08:00
|
|
|
</div>
|
2018-09-05 22:36:32 +08:00
|
|
|
<% end %>
|
2018-08-31 18:11:51 +08:00
|
|
|
<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>
|
|
|
|
|
2017-02-09 21:33:12 +08:00
|
|
|
<%= javascript_include_tag "users/settings/account/preferences/index" %>
|