mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 13:44:23 +08:00
Partially fixed according to pull request review, added comments to code review
This commit is contained in:
parent
d4aa5e60a2
commit
1bed2c2a3c
7 changed files with 20 additions and 20 deletions
|
@ -72,7 +72,7 @@
|
|||
function notificationsSettings() {
|
||||
var notification_settings = [ "recent_notification",
|
||||
"assignments_notification",
|
||||
"popover_v2_toggle" ]
|
||||
"popovers_enabled" ]
|
||||
|
||||
for (var i = 0; i < notification_settings.length; i++ ) {
|
||||
var setting = $('[name="' + notification_settings[i] + '"]');
|
||||
|
|
|
@ -79,7 +79,7 @@ module ClientApi
|
|||
:assignments_email_notification, :recent_notification,
|
||||
:recent_email_notification,
|
||||
:system_message_email_notification,
|
||||
:popover_v2_toggle)
|
||||
:popovers_enabled)
|
||||
end
|
||||
|
||||
def success_response(args = {})
|
||||
|
|
|
@ -41,8 +41,8 @@ module Users
|
|||
params[:assignments_notification_email] ? true : false
|
||||
@user.system_message_email_notification =
|
||||
params[:system_message_notification_email] ? true : false
|
||||
@user.popover_v2_toggle =
|
||||
params[:popover_v2_toggle] ? true : false
|
||||
@user.popovers_enabled =
|
||||
params[:popovers_enabled] ? true : false
|
||||
if @user.save
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
|
|
|
@ -43,9 +43,9 @@ class User < ApplicationRecord
|
|||
assignments_email: false,
|
||||
recent: true,
|
||||
recent_email: false,
|
||||
system_message_email: false,
|
||||
popover_v2_toggle: true
|
||||
}
|
||||
system_message_email: false
|
||||
},
|
||||
popovers_enabled: true
|
||||
)
|
||||
|
||||
# Relations
|
||||
|
@ -458,7 +458,7 @@ class User < ApplicationRecord
|
|||
assignments_email_notification
|
||||
recent_email_notification
|
||||
system_message_email_notification
|
||||
popover_v2_toggle )
|
||||
popovers_enabled )
|
||||
# declare notifications getters
|
||||
NOTIFICATIONS_TYPES.each do |name|
|
||||
define_method(name) do
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
data-atwho-rep-items-url="<%= atwho_rep_items_team_path(current_team) %>"
|
||||
data-atwho-menu-items="<%= atwho_menu_items_team_path(current_team) %>"
|
||||
data-file-max-size-mb="<%= Rails.configuration.x.file_max_size_mb %>"
|
||||
data-popover_v2_enabled="<%= current_user.popover_v2_toggle %>"
|
||||
data-popover_v2_enabled="<%= current_user.popovers_enabled %>"
|
||||
<% end %>
|
||||
>
|
||||
|
||||
|
|
|
@ -133,8 +133,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><%= t('notifications.tips.title') %></h4>
|
||||
<h4><%= t('users.settings.account.preferences.edit.tips.title') %></h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<span class="assignment hidden-sm">
|
||||
|
@ -142,20 +141,21 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<p><%=t 'notifications.tips.text1' %></p>
|
||||
<p><%=t 'notifications.tips.text2' %></p>
|
||||
<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 'notifications.tips.toggle' %>
|
||||
<%=t 'users.settings.account.preferences.edit.tips.toggle' %>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<%= check_box_tag :popover_v2_toggle, @user.popover_v2_toggle %>
|
||||
<%= check_box_tag :popovers_enabled, @user.popovers_enabled %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1413,6 +1413,11 @@ en:
|
|||
time_zone_label: "Time zone"
|
||||
time_zone_sublabel: "Time zone setting affects all time & date fields throughout application."
|
||||
time_zone_title: "Time zone"
|
||||
tips:
|
||||
title: "Help Tips"
|
||||
text1: "When you place your mouse over specific element of SciNote, we show you a tip with description of this element."
|
||||
text2: "You may want to turn that off if you feel confident in here."
|
||||
toggle: "Show Help Tips"
|
||||
update_flash: "Preferences successfully updated."
|
||||
addons:
|
||||
head_title: "Settings | Add-ons"
|
||||
|
@ -1801,11 +1806,6 @@ en:
|
|||
|
||||
notifications:
|
||||
title: "Notifications"
|
||||
tips:
|
||||
title: "Help Tips"
|
||||
text1: "When you place your mouse over specific element of SciNote, we show you a tip with description of this element."
|
||||
text2: "You may want to turn that off if you feel confident in here."
|
||||
toggle: "Show Help Tips NO/YES"
|
||||
email_settings: "E-mail notifications"
|
||||
form:
|
||||
assignments: "Assignment"
|
||||
|
|
Loading…
Add table
Reference in a new issue