2017-02-09 18:07:16 +08:00
|
|
|
<% provide(:head_title, t("users.settings.account.preferences.head_title")) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
|
|
|
<%= render partial: "users/settings/navigation.html.erb" %>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane tab-pane-settings active" role="tabpanel">
|
|
|
|
|
2017-02-09 18:34:52 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 col-sm-3">
|
|
|
|
<%= render partial: 'users/settings/account/navigation.html.erb' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
<div class="col-xs-12 col-sm-9">
|
|
|
|
<%= form_for(@user,
|
|
|
|
url: update_preferences_path(format: :json),
|
|
|
|
remote: true,
|
|
|
|
html: { method: :put, 'data-for' => 'time_zone' }) do |f| %>
|
|
|
|
<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"
|
|
|
|
value="<%= @user.time_zone %>"
|
|
|
|
name="fake_user[time_zone]"
|
|
|
|
id="fake_user_time_zone">
|
|
|
|
<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]
|
|
|
|
}, {}, {class: 'form-control selectpicker', 'ata-role' => 'clear'} %>
|
|
|
|
<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>
|
|
|
|
<%= f.submit t("general.update"), class: "btn btn-primary" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
<% end %>
|
|
|
|
<% if Rails.configuration.x.enable_tutorial %>
|
|
|
|
<hr>
|
|
|
|
<strong><%= t('tutorial.title') %></strong> <br>
|
|
|
|
<%= link_to t('users.settings.account.preferences.tutorial.repeat_tutorial'),
|
|
|
|
tutorial_path(format: :json),
|
|
|
|
remote: true,
|
|
|
|
class: 'btn btn-primary',
|
|
|
|
id: 'reset-tutorial-btn' %>
|
|
|
|
<% end %>
|
|
|
|
<hr>
|
|
|
|
<div class="notification-settings-container">
|
|
|
|
<strong><%= t('notifications.title') %></strong>
|
|
|
|
<%= form_for(@user,
|
|
|
|
url: notifications_settings_path(format: :json),
|
|
|
|
html: { method: :post, id: 'notifications-settings-panel' },
|
|
|
|
remote: true) do |f| %>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4 col-sm-3 hidden-sm hidden-xs">
|
|
|
|
<div class="notification-settings-labels">
|
|
|
|
<%= image_tag 'icon_small/missing.png', class: 'img-circle ' %>
|
|
|
|
<%= f.label t('notifications.form.recent_notification') %> <br>
|
|
|
|
<span class="assignment hidden-sm"><%= fa_icon 'newspaper-o' %></span>
|
|
|
|
<%= f.label t('notifications.form.assignments') %> <br>
|
|
|
|
<span class="system-message hidden-sm"><i class="glyphicon glyphicon-tower" aria-hidden="true"></i></span>
|
|
|
|
<%= f.label t('notifications.form.system_message') %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 col-sm-3 col-text-center">
|
|
|
|
<%= f.label t('notifications.form.recent_notification'), class: 'visible-sm visible-xs'%>
|
|
|
|
<h5 class="hidden-sm hidden-xs"><%= t('notifications.title') %></h5><br>
|
|
|
|
<%= check_box_tag :recent_notification, @user.recent_notification %> <br>
|
|
|
|
<%= f.label t('notifications.form.assignments'), class: 'visible-sm visible-xs' %>
|
|
|
|
<%= check_box_tag :assignments_notification, @user.assignments_notification %> <br>
|
|
|
|
<%= f.label t('notifications.form.system_message'), class: 'visible-sm visible-xs' %>
|
|
|
|
<%= check_box_tag :system_message_notification %>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3 col-sm-3 col-text-center">
|
|
|
|
<h5 class="hidden-sm hidden-xs"><%= t('notifications.email_settings') %></h5>
|
|
|
|
<%= f.label t('notifications.form.recent_notification'), class: 'visible-sm visible-xs'%> <br>
|
|
|
|
<%= check_box_tag :recent_notification_email, @user.recent_notification_email %> <br>
|
|
|
|
<%= f.label t('notifications.form.assignments'), class: 'visible-sm visible-xs' %>
|
|
|
|
<%= check_box_tag :assignments_notification_email, @user.assignments_notification_email %> <br>
|
|
|
|
<%= f.label t('notifications.form.system_message'), class: 'visible-sm visible-xs' %>
|
|
|
|
<%= check_box_tag :system_message_notification_email, @user.system_message_notification_email %>
|
|
|
|
</div>
|
2016-10-04 21:52:48 +08:00
|
|
|
</div>
|
2017-02-09 18:34:52 +08:00
|
|
|
<% end %>
|
2016-10-06 19:47:48 +08:00
|
|
|
</div>
|
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>
|
|
|
|
|
2016-07-21 19:11:15 +08:00
|
|
|
<!-- Repeat tutorial modal -->
|
|
|
|
<div class="modal" id="repeat-tutorial-modal" tabindex="-1" role="dialog" aria-labelledby="repeat-tutorial-modal-label">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
2017-02-09 18:07:16 +08:00
|
|
|
<h4 class="modal-title" ><%= t("users.settings.account.preferences.tutorial.modal_title") %></h4>
|
2016-07-21 19:11:15 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-body"></div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-10-04 21:52:48 +08:00
|
|
|
|
|
|
|
|
2017-02-09 18:07:16 +08:00
|
|
|
<%= javascript_include_tag "users/settings/account/preferences" %>
|