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')
* 1: tasks, 2: messages, 3: announcements, 4: recents
* - 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 {
templateUrl: 'shared/templates/directives/header-notification.html',
restrict: 'E',
......@@ -51,6 +51,55 @@ angular.module('ulakbus')
* Group 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.notifications = {1: [], 2: [], 3: [], 4: []};
......
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<!--<li class="dropdown" >
<a class="dropdown-toggle" data-toggle="dropdown">
<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
......@@ -8,6 +8,7 @@
<ul class="dropdown-menu dropdown-messages" ng-show="notifications[2].length > 0">
<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">
......@@ -15,6 +16,38 @@
</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>
<span ng-click="markAsRead(notify, 2, $index)" class="pull-right fa fa-times"></span>
</a>
</li>
......@@ -29,13 +62,13 @@
<!-- /.dropdown-messages -->
</li>
<!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
<li uib-dropdown auto-close="outsideClick">
<a uib-dropdown-toggle>
<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
class="fa fa-caret-down"></i>
</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'">
<a>
<div>
......@@ -65,13 +98,13 @@
<!-- /.dropdown-tasks -->
</li>
<!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
<li uib-dropdown auto-close="outsideClick">
<a uib-dropdown-toggle>
<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
class="fa fa-caret-down"></i>
</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'">
<a role="button">
<div>
......@@ -102,4 +135,3 @@
</li>
<!-- /.dropdown -->
</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