Append total of notifications & Fix menu toggle (#2012)
This commit is contained in:
parent
adfd86d7fe
commit
4d60dac78d
|
@ -15,10 +15,9 @@ use feature 'state';
|
||||||
|
|
||||||
extends 'Lemonldap::NG::Common::Conf::AccessLib';
|
extends 'Lemonldap::NG::Common::Conf::AccessLib';
|
||||||
|
|
||||||
our $VERSION = '2.0.6';
|
our $VERSION = '2.0.7';
|
||||||
|
|
||||||
has notifAccess => ( is => 'rw' );
|
has notifAccess => ( is => 'rw' );
|
||||||
|
|
||||||
has notifFormat => ( is => 'rw' );
|
has notifFormat => ( is => 'rw' );
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
|
@ -75,7 +74,6 @@ sub addRoutes {
|
||||||
{ done => { ':notificationId' => 'deleteDoneNotification' } },
|
{ done => { ':notificationId' => 'deleteDoneNotification' } },
|
||||||
['DELETE']
|
['DELETE']
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setNotifAccess {
|
sub setNotifAccess {
|
||||||
|
@ -158,6 +156,7 @@ sub notifications {
|
||||||
my ( $notifs, $res );
|
my ( $notifs, $res );
|
||||||
|
|
||||||
$notifs = $self->notifAccess->$sub();
|
$notifs = $self->notifAccess->$sub();
|
||||||
|
my $total = ( keys %$notifs );
|
||||||
|
|
||||||
# Restrict to wanted values
|
# Restrict to wanted values
|
||||||
if (
|
if (
|
||||||
|
@ -201,6 +200,7 @@ sub notifications {
|
||||||
result => 1,
|
result => 1,
|
||||||
count => $count,
|
count => $count,
|
||||||
values => $res,
|
values => $res,
|
||||||
|
total => $total
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ sub notifications {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $self->sendJSONresponse( $req,
|
return $self->sendJSONresponse( $req,
|
||||||
{ result => 1, count => scalar(@r), values => \@r } );
|
{ result => 1, count => scalar(@r), values => \@r, total => $total } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +289,7 @@ sub newNotification {
|
||||||
$self->logger->debug("Notification Date = $json->{date}");
|
$self->logger->debug("Notification Date = $json->{date}");
|
||||||
|
|
||||||
unless ( $json->{date} =~ /^\d{4}-\d{2}-\d{2}$/ ) {
|
unless ( $json->{date} =~ /^\d{4}-\d{2}-\d{2}$/ ) {
|
||||||
|
$self->logger->error("Malformed date");
|
||||||
return $self->sendError( $req, "Malformed date", 200 );
|
return $self->sendError( $req, "Malformed date", 200 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,8 +313,8 @@ sub newNotification {
|
||||||
delete $json->{xml};
|
delete $json->{xml};
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->logger->error("Notification malformed $@");
|
$self->logger->error("Malformed notification $@");
|
||||||
return $self->sendError( $req, "Notification malformed: $@", 200 );
|
return $self->sendError( $req, "Malformed notification: $@", 200 );
|
||||||
}
|
}
|
||||||
$newNotif = to_json($json);
|
$newNotif = to_json($json);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ llapp.controller 'NotificationsExplorerCtrl', [ '$scope', '$translator', '$locat
|
||||||
$scope.waiting = false
|
$scope.waiting = false
|
||||||
$scope.init()
|
$scope.init()
|
||||||
|
|
||||||
|
# Open node
|
||||||
$scope.stoggle = (scope) ->
|
$scope.stoggle = (scope) ->
|
||||||
node = scope.$modelValue
|
node = scope.$modelValue
|
||||||
if node.nodes.length == 0
|
if node.nodes.length == 0
|
||||||
|
@ -182,8 +183,8 @@ llapp.controller 'NotificationsExplorerCtrl', [ '$scope', '$translator', '$locat
|
||||||
n.level = level + 1
|
n.level = level + 1
|
||||||
n.query = query
|
n.query = query
|
||||||
n.over = over
|
n.over = over
|
||||||
|
|
||||||
node.push n
|
node.push n
|
||||||
|
$scope.total = data.total if value == ''
|
||||||
$scope.waiting = false
|
$scope.waiting = false
|
||||||
, (resp) ->
|
, (resp) ->
|
||||||
$scope.waiting = false
|
$scope.waiting = false
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
overScheme = function(v, level, over) {
|
overScheme = function(v, level, over) {
|
||||||
console.log('overSchema => level', level, 'over', over);
|
console.log('overScheme => level', level, 'over', over);
|
||||||
if (level === 1 && v.length > over) {
|
if (level === 1 && v.length > over) {
|
||||||
return "uid=" + v + "*&groupBy=substr(uid," + (level + over + 1) + ")";
|
return "uid=" + v + "*&groupBy=substr(uid," + (level + over + 1) + ")";
|
||||||
} else {
|
} else {
|
||||||
|
@ -143,8 +143,8 @@
|
||||||
node = scope.$modelValue;
|
node = scope.$modelValue;
|
||||||
if (node.nodes.length === 0) {
|
if (node.nodes.length === 0) {
|
||||||
$scope.updateTree(node.value, node.nodes, node.level, node.over, node.query, node.count);
|
$scope.updateTree(node.value, node.nodes, node.level, node.over, node.query, node.count);
|
||||||
return scope.toggle();
|
|
||||||
}
|
}
|
||||||
|
return scope.toggle();
|
||||||
};
|
};
|
||||||
$scope.notifDate = function(s) {
|
$scope.notifDate = function(s) {
|
||||||
var d;
|
var d;
|
||||||
|
@ -207,6 +207,9 @@
|
||||||
}
|
}
|
||||||
node.push(n);
|
node.push(n);
|
||||||
}
|
}
|
||||||
|
if (value === '') {
|
||||||
|
$scope.total = data.total;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $scope.waiting = false;
|
return $scope.waiting = false;
|
||||||
}, function(resp) {
|
}, function(resp) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"عبارة بيرل ليست صحيحة",
|
"notAValidPerlExpression":"عبارة بيرل ليست صحيحة",
|
||||||
"notification":"تفعيل",
|
"notification":"تفعيل",
|
||||||
"notifications":"إشعار",
|
"notifications":"إشعار",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"إشعارالخادم",
|
"notificationServer":"إشعارالخادم",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Not a valid Perl expression",
|
"notAValidPerlExpression":"Not a valid Perl expression",
|
||||||
"notification":"Activation",
|
"notification":"Activation",
|
||||||
"notifications":"Notifications",
|
"notifications":"Notifications",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"Notification server",
|
"notificationServer":"Notification server",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Not a valid Perl expression",
|
"notAValidPerlExpression":"Not a valid Perl expression",
|
||||||
"notification":"Activation",
|
"notification":"Activation",
|
||||||
"notifications":"Notifications",
|
"notifications":"Notifications",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"Notification server",
|
"notificationServer":"Notification server",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Pas une expression Perl valide",
|
"notAValidPerlExpression":"Pas une expression Perl valide",
|
||||||
"notification":"Activation",
|
"notification":"Activation",
|
||||||
"notifications":"Notifications",
|
"notifications":"Notifications",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Condition par défaut",
|
"notificationDefaultCond":"Condition par défaut",
|
||||||
"notificationServer":"Serveur de notifications",
|
"notificationServer":"Serveur de notifications",
|
||||||
"notificationServerDELETE":"Méthode DELETE",
|
"notificationServerDELETE":"Méthode DELETE",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Non una valida espressione Perl",
|
"notAValidPerlExpression":"Non una valida espressione Perl",
|
||||||
"notification":"Attivazione",
|
"notification":"Attivazione",
|
||||||
"notifications":"Notifiche",
|
"notifications":"Notifiche",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"Server di notifica",
|
"notificationServer":"Server di notifica",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Không phải là một biểu thức Perl hợp lệ",
|
"notAValidPerlExpression":"Không phải là một biểu thức Perl hợp lệ",
|
||||||
"notification":"Kích hoạt",
|
"notification":"Kích hoạt",
|
||||||
"notifications":"Thông báo",
|
"notifications":"Thông báo",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"Máy chủ Thông báo",
|
"notificationServer":"Máy chủ Thông báo",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -491,6 +491,7 @@
|
||||||
"notAValidPerlExpression":"Not a valid Perl expression",
|
"notAValidPerlExpression":"Not a valid Perl expression",
|
||||||
"notification":"激活",
|
"notification":"激活",
|
||||||
"notifications":"Notifications",
|
"notifications":"Notifications",
|
||||||
|
"notification_s":"notification(s)",
|
||||||
"notificationDefaultCond":"Default condition",
|
"notificationDefaultCond":"Default condition",
|
||||||
"notificationServer":"Notification server",
|
"notificationServer":"Notification server",
|
||||||
"notificationServerDELETE":"DELETE method",
|
"notificationServerDELETE":"DELETE method",
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-show="data.length!=0" class="text-center"><p class="badge">{{total}} <span trspan="notification_s"></span></p></div>
|
||||||
<div class="region region-sidebar-first">
|
<div class="region region-sidebar-first">
|
||||||
<section id="block-superfish-1" class="block block-superfish clearfix">
|
<section id="block-superfish-1" class="block block-superfish clearfix">
|
||||||
<div ui-tree data-drag-enabled="false" id="tree-root">
|
<div ui-tree data-drag-enabled="false" id="tree-root">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user