mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
fixed type, fixed settings controller, fixes setting view on mobile devices
This commit is contained in:
parent
6229e6a3a1
commit
9c7a690944
4 changed files with 14 additions and 24 deletions
|
@ -555,15 +555,11 @@ a[data-toggle="tooltip"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-settings-container {
|
.notification-settings-container {
|
||||||
margin-top: 50px;
|
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
|
margin-top: 50px;
|
||||||
|
|
||||||
.col-xs-2 {
|
.col-md-4 {
|
||||||
padding-top: 20px;
|
margin-top: 25px;
|
||||||
}
|
|
||||||
|
|
||||||
.col-xs-3 {
|
|
||||||
padding-top: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-group {
|
.btn-group {
|
||||||
|
|
|
@ -458,16 +458,8 @@ class Users::SettingsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def notifications_settings
|
def notifications_settings
|
||||||
if params[:assignments_notification]
|
@user.assignments_notification = params[:assignments_notification]
|
||||||
@user.assignments_notification = true
|
@user.recent_notification = params[:recent_notification]
|
||||||
else
|
|
||||||
@user.assignments_notification = false
|
|
||||||
end
|
|
||||||
if params[:recent_notification]
|
|
||||||
@user.recent_notification = true
|
|
||||||
else
|
|
||||||
@user.recent_notification = false
|
|
||||||
end
|
|
||||||
|
|
||||||
if @user.save
|
if @user.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -575,7 +567,7 @@ class Users::SettingsController < ApplicationController
|
||||||
message:
|
message:
|
||||||
ActionController::Base.helpers.sanitize(message),
|
ActionController::Base.helpers.sanitize(message),
|
||||||
)
|
)
|
||||||
|
|
||||||
if target_user.assignments_notification
|
if target_user.assignments_notification
|
||||||
UserNotification.create(notification: notification, user: target_user)
|
UserNotification.create(notification: notification, user: target_user)
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,17 +42,19 @@
|
||||||
html: { method: :post, id: 'notifications-settings-panel' },
|
html: { method: :post, id: 'notifications-settings-panel' },
|
||||||
remote: true) do |f| %>
|
remote: true) do |f| %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-3">
|
<div class="col-md-4 col-sm-3 hidden-sm hidden-xs">
|
||||||
<div class="notification-settings-labels">
|
<div class="notification-settings-labels">
|
||||||
<%= image_tag 'icon_small/missing.png', class: 'img-circle' %>
|
<%= image_tag 'icon_small/missing.png', class: 'img-circle ' %>
|
||||||
<%= f.label t('notifications.form.recent_notification') %> <br>
|
<%= f.label t('notifications.form.recent_notification') %> <br>
|
||||||
<span class="assignment"><%= fa_icon 'newspaper-o' %></span>
|
<span class="assignment hidden-sm"><%= fa_icon 'newspaper-o' %></span>
|
||||||
<%= f.label t('notifications.form.assignments') %>
|
<%= f.label t('notifications.form.assignments') %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-2 text-center">
|
<div class="col-md-3 col-sm-3 col-text-center">
|
||||||
<h5><%= t('notifications.title') %></h5>
|
<h5 class="hidden-sm hidden-xs"><%= t('notifications.title') %></h5>
|
||||||
|
<%= f.label t('notifications.form.recent_notification'), class: 'visible-sm visible-xs'%> <br>
|
||||||
<%= check_box_tag :recent_notification, @user.recent_notification %> <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 %>
|
<%= check_box_tag :assignments_notification, @user.assignments_notification %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class AddNotifivationsSettingsToUser < ActiveRecord::Migration
|
class AddNotificationsSettingsToUser < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
add_column :users, :assignments_notification, :boolean, default: true
|
add_column :users, :assignments_notification, :boolean, default: true
|
||||||
add_column :users, :recent_notification, :boolean, default: true
|
add_column :users, :recent_notification, :boolean, default: true
|
Loading…
Add table
Reference in a new issue