Commit 8c75cff2 authored by bahadircyildiz's avatar bahadircyildiz

FIX rref #5246, fixes GH-94. Notification modal implemented and notification...

FIX rref #5246, fixes GH-94. Notification modal implemented and notification submenu closing problem temporarily solved
parent d7aeee26
...@@ -37,7 +37,7 @@ angular.module('ulakbus') ...@@ -37,7 +37,7 @@ angular.module('ulakbus')
* 1: tasks, 2: messages, 3: announcements, 4: recents * 1: tasks, 2: messages, 3: announcements, 4: recents
* - Notifications can be disabled in /dev/settings page * - Notifications can be disabled in /dev/settings page
*/ */
.directive('headerNotification', function (WSOps, $rootScope, $cookies, $interval, RESTURL) { .directive('headerNotification', function (WSOps, $rootScope, $cookies, $interval, RESTURL, $uibModal) {
return { return {
templateUrl: 'shared/templates/directives/header-notification.html', templateUrl: 'shared/templates/directives/header-notification.html',
restrict: 'E', restrict: 'E',
...@@ -51,6 +51,55 @@ angular.module('ulakbus') ...@@ -51,6 +51,55 @@ angular.module('ulakbus')
* Group notifications * Group notifications
* @param notifications * @param notifications
*/ */
$scope.testmessage = function(){
$scope.notifications[1].push({
title: "Kemange mage kako",
body: "Sugarke Mage kako"
});
$scope.notifications[1].push({
title: "Yandan gel mage kako",
body: "Candan gel Mage kako"
});
$scope.notifications[2].push({
title: "Kemange mage kako",
body: "Sugarke Mage kako"
});
$scope.notifications[2].push({
title: "Yandan gel mage kako",
body: "Candan gel Mage kako"
});
$scope.notifications[3].push({
title: "Kemange mage kako",
body: "Sugarke Mage kako"
});
$scope.notifications[3].push({
title: "Yandan gel mage kako",
body: "Candan gel Mage kako"
});
}
$scope.testmessage();
$scope.ddEventHandler = function(){
$event.preventDefault();
$event.stopPropagation();
return false;
}
$scope.popModal = function(item){
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'shared/templates/notificationsModalContent.html',
controller: function($scope){
$scope.notification = item;
$scope.cancel = function() {
modalInstance.dismiss('cancel');
};
},
size: 'lg'
});
}
$scope.groupNotifications = function (notifications) { $scope.groupNotifications = function (notifications) {
// $scope.notifications = {1: [], 2: [], 3: [], 4: []}; // $scope.notifications = {1: [], 2: [], 3: [], 4: []};
...@@ -626,4 +675,4 @@ angular.module('ulakbus') ...@@ -626,4 +675,4 @@ angular.module('ulakbus')
}); });
} }
} }
}); });
\ No newline at end of file
<ul class="nav navbar-top-links navbar-right"> <ul class="nav navbar-top-links navbar-right">
<li class="dropdown"> <!--<li class="dropdown" >
<a class="dropdown-toggle" data-toggle="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown">
<div class="badge" ng-show="notifications[2].length > 0">{{notifications[2].length}}</div> <div class="badge" ng-show="notifications[2].length > 0">{{notifications[2].length}}</div>
<i class="fa fa-envelope fa-fw" tooltip-placement="bottom" uib-tooltip="Mesajlar"></i> <i <i class="fa fa-envelope fa-fw" tooltip-placement="bottom" uib-tooltip="Mesajlar"></i> <i
...@@ -8,13 +8,46 @@ ...@@ -8,13 +8,46 @@
<ul class="dropdown-menu dropdown-messages" ng-show="notifications[2].length > 0"> <ul class="dropdown-menu dropdown-messages" ng-show="notifications[2].length > 0">
<li ng-repeat="notify in notifications[2] | limitTo: '8'"> <li ng-repeat="notify in notifications[2] | limitTo: '8'">
<a> <a>
<div> <div ng-click="popModal(notify)">
<strong>{{notify.title}}</strong> <div>
<span class="pull-right text-muted"> <strong>{{notify.title}}</strong>
<em>22 Ekim 2015</em> <span class="pull-right text-muted">
</span> <em>22 Ekim 2015</em>
</span>
</div>
<div>{{notify.body}}...</div>
</div>
<span ng-click="markAsRead(notify, 2, $index)" class="pull-right fa fa-times"></span>
</a>
</li>
<li class="divider"></li>
<li>
<a class="text-center">
<strong>Read All Messages</strong>
<i class="fa fa-angle-right"></i>
</a>
</li>
</ul>
&lt;!&ndash; /.dropdown-messages &ndash;&gt;
</li>-->
<li uib-dropdown auto-close="outsideClick">
<a uib-dropdown-toggle>
<div class="badge" ng-show="notifications[2].length > 0">{{notifications[2].length}}</div>
<i class="fa fa-envelope fa-fw" tooltip-placement="bottom" uib-tooltip="Mesajlar"></i> <i
class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-messages" uib-dropdown-menu ng-show="notifications[2].length > 0" ng-click="ddEventHandler()">
<li ng-repeat="notify in notifications[2] | limitTo: '8'">
<a>
<div ng-click="popModal(notify)">
<div>
<strong>{{notify.title}}</strong>
<span class="pull-right text-muted">
<em>22 Ekim 2015</em>
</span>
</div>
<div>{{notify.body}}...</div>
</div> </div>
<div>{{notify.body}}...</div>
<span ng-click="markAsRead(notify, 2, $index)" class="pull-right fa fa-times"></span> <span ng-click="markAsRead(notify, 2, $index)" class="pull-right fa fa-times"></span>
</a> </a>
</li> </li>
...@@ -29,13 +62,13 @@ ...@@ -29,13 +62,13 @@
<!-- /.dropdown-messages --> <!-- /.dropdown-messages -->
</li> </li>
<!-- /.dropdown --> <!-- /.dropdown -->
<li class="dropdown"> <li uib-dropdown auto-close="outsideClick">
<a class="dropdown-toggle" data-toggle="dropdown"> <a uib-dropdown-toggle>
<div class="badge" ng-if="notifications[1].length > 0">{{notifications[1].length}}</div> <div class="badge" ng-if="notifications[1].length > 0">{{notifications[1].length}}</div>
<i class="fa fa-tasks fa-fw" tooltip-placement="bottom" uib-tooltip="Görevler"></i> <i <i class="fa fa-tasks fa-fw" tooltip-placement="bottom" uib-tooltip="Görevler"></i> <i
class="fa fa-caret-down"></i> class="fa fa-caret-down"></i>
</a> </a>
<ul class="dropdown-menu dropdown-tasks" ng-if="notifications[1].length > 0"> <ul class="dropdown-tasks" uib-dropdown-menu ng-if="notifications[1].length > 0" ng-click="ddEventHandler()">
<li ng-repeat="notify in notifications[1] | limitTo: '8'"> <li ng-repeat="notify in notifications[1] | limitTo: '8'">
<a> <a>
<div> <div>
...@@ -65,13 +98,13 @@ ...@@ -65,13 +98,13 @@
<!-- /.dropdown-tasks --> <!-- /.dropdown-tasks -->
</li> </li>
<!-- /.dropdown --> <!-- /.dropdown -->
<li class="dropdown"> <li uib-dropdown auto-close="outsideClick">
<a class="dropdown-toggle" data-toggle="dropdown"> <a uib-dropdown-toggle>
<div class="badge" ng-if="notifications[3].length > 0">{{notifications[3].length}}</div> <div class="badge" ng-if="notifications[3].length > 0">{{notifications[3].length}}</div>
<i class="fa fa-bell fa-fw" tooltip-placement="bottom" uib-tooltip="Duyurular"></i> <i <i class="fa fa-bell fa-fw" tooltip-placement="bottom" uib-tooltip="Duyurular"></i> <i
class="fa fa-caret-down"></i> class="fa fa-caret-down"></i>
</a> </a>
<ul class="dropdown-menu dropdown-alerts" ng-if="notifications[3].length > 0"> <ul class="dropdown-alerts" uib-dropdown-menu ng-if="notifications[3].length > 0" ng-click="ddEventHandler()">
<li ng-repeat="notify in notifications[3] | limitTo: '8'"> <li ng-repeat="notify in notifications[3] | limitTo: '8'">
<a role="button"> <a role="button">
<div> <div>
...@@ -102,4 +135,3 @@ ...@@ -102,4 +135,3 @@
</li> </li>
<!-- /.dropdown --> <!-- /.dropdown -->
</ul> </ul>
<div class="modal-body">
<h3>{{notification.title}}</h3>
{{notification.body}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" ng-click="cancel()">İptal</button>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment