mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
improved numerous notifications display
This commit is contained in:
parent
7926d7a04a
commit
9bfaaaccd9
@ -1,5 +1,9 @@
|
|||||||
# Changelog Fab Manager
|
# Changelog Fab Manager
|
||||||
|
|
||||||
|
## next release
|
||||||
|
- Mask new notifications alerts when more than 3
|
||||||
|
- Fix a bug: display more than 15 unread notifications (number on the bell icon & full list)
|
||||||
|
|
||||||
## v2.4.8 2016 December 15
|
## v2.4.8 2016 December 15
|
||||||
|
|
||||||
- Added asterisks on mandatory fields in member's form
|
- Added asterisks on mandatory fields in member's form
|
||||||
|
@ -260,7 +260,9 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco
|
|||||||
getNotifications = ->
|
getNotifications = ->
|
||||||
$rootScope.toCheckNotifications = true
|
$rootScope.toCheckNotifications = true
|
||||||
unless $rootScope.checkNotificationsIsInit or !$rootScope.currentUser
|
unless $rootScope.checkNotificationsIsInit or !$rootScope.currentUser
|
||||||
$scope.notifications = Notification.query {is_read: false}
|
setTimeout ->
|
||||||
|
$scope.notifications = Notification.query {is_read: false}
|
||||||
|
, 2000
|
||||||
$scope.$watch 'notifications', (newValue, oldValue) ->
|
$scope.$watch 'notifications', (newValue, oldValue) ->
|
||||||
diff = []
|
diff = []
|
||||||
angular.forEach newValue, (value) ->
|
angular.forEach newValue, (value) ->
|
||||||
@ -273,6 +275,9 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco
|
|||||||
unless find
|
unless find
|
||||||
diff.push(value)
|
diff.push(value)
|
||||||
|
|
||||||
|
remain = 3
|
||||||
|
if diff.length >= remain
|
||||||
|
diff.splice(remain, (diff.length - remain), {message: {description: _t('and_NUMBER_other_notifications', {NUMBER: diff.length - remain})}})
|
||||||
|
|
||||||
angular.forEach diff, (notification, key) ->
|
angular.forEach diff, (notification, key) ->
|
||||||
growl.info(notification.message.description)
|
growl.info(notification.message.description)
|
||||||
|
@ -4,7 +4,11 @@ class API::NotificationsController < API::ApiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
if params[:is_read]
|
if params[:is_read]
|
||||||
@notifications = current_user.notifications.where(is_read: params[:is_read] == 'true').page(params[:page]).per(15).order('created_at DESC')
|
if params[:is_read] == 'true'
|
||||||
|
@notifications = current_user.notifications.where(is_read: true).page(params[:page]).per(15).order('created_at DESC')
|
||||||
|
else
|
||||||
|
@notifications = current_user.notifications.where(is_read: false).order('created_at DESC')
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@notifications = current_user.notifications.order('created_at DESC')
|
@notifications = current_user.notifications.order('created_at DESC')
|
||||||
end
|
end
|
||||||
|
@ -103,6 +103,9 @@ en:
|
|||||||
# Fab-manager's version
|
# Fab-manager's version
|
||||||
version: "Version:"
|
version: "Version:"
|
||||||
|
|
||||||
|
# Notifications
|
||||||
|
and_NUMBER_other_notifications: "and {{NUMBER}} other notifications..." # angular interpolation
|
||||||
|
|
||||||
about:
|
about:
|
||||||
# about page
|
# about page
|
||||||
read_the_fablab_policy: "Read the FabLab policy"
|
read_the_fablab_policy: "Read the FabLab policy"
|
||||||
|
@ -102,6 +102,10 @@ fr:
|
|||||||
|
|
||||||
# Fab-manager's version
|
# Fab-manager's version
|
||||||
version: "Version :"
|
version: "Version :"
|
||||||
|
|
||||||
|
# Notifications
|
||||||
|
and_NUMBER_other_notifications: "et {{NUMBER}} autres notifications ..." # angular interpolation
|
||||||
|
|
||||||
about:
|
about:
|
||||||
# page à propos
|
# page à propos
|
||||||
read_the_fablab_policy: "Consulter les règles d'utilisation du Fab Lab"
|
read_the_fablab_policy: "Consulter les règles d'utilisation du Fab Lab"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user