Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
2440378e
Commit
2440378e
authored
Apr 04, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop2' into develop
parents
18937cec
66fde080
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
21 deletions
+81
-21
directives.js
app/shared/directives.js
+26
-5
header-notification.html
app/shared/templates/directives/header-notification.html
+48
-16
notificationsModalContent.html
app/shared/templates/notificationsModalContent.html
+7
-0
No files found.
app/shared/directives.js
View file @
2440378e
...
...
@@ -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,21 @@ angular.module('ulakbus')
* Group notifications
* @param notifications
*/
$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: []};
...
...
@@ -73,9 +88,15 @@ angular.module('ulakbus')
* @param items
* @todo: do it in detail page of notification
*/
$scope
.
markAsRead
=
function
(
item
,
group
,
index
)
{
WSOps
.
doSend
(
angular
.
toJson
({
data
:
{
view
:
'notify'
,
id
:
item
.
id
}}));
$scope
.
notifications
[
group
].
splice
(
index
,
1
);
$scope
.
markAsRead
=
function
(
event
,
item
,
group
,
index
)
{
//Added event parameter to stop propagate, so that behaviour of outsideClick won't be interrupted.
event
.
stopPropagation
();
WSOps
.
doSend
(
angular
.
toJson
({
data
:
{
view
:
'notify'
,
id
:
item
.
id
}}));
$scope
.
notifications
[
group
].
splice
(
index
,
1
);
$event
.
preventDefault
();
$event
.
stopPropagation
();
return
false
;
};
// if markasread triggered outside the directive
...
...
app/shared/templates/directives/header-notification.html
View file @
2440378e
<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,7 @@
</span>
</div>
<div>{{notify.body}}...</div>
</div>
<span ng-click="markAsRead(notify, 2, $index)" class="pull-right fa fa-times"></span>
</a>
</li>
...
...
@@ -26,23 +28,54 @@
</a>
</li>
</ul>
<!– /.dropdown-messages –>
</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"
>
<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($event,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>
<!-- /.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"
>
<li
ng-repeat=
"notify in notifications[1] | limitTo: '8'"
>
<a>
<div>
<p>
<strong>
{{notify.title}}
</strong>
<span
class=
"pull-right text-muted"
>
{{notify.body}}
</span>
<span
ng-click=
"markAsRead(notify, 1, $index)"
class=
"pull-right fa fa-times"
></span>
<span
ng-click=
"markAsRead(
$event,
notify, 1, $index)"
class=
"pull-right fa fa-times"
></span>
</p>
<!-- todo: progress bar will be used in future developments-->
<!--<div class="progress progress-striped active">-->
...
...
@@ -65,19 +98,19 @@
<!-- /.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"
>
<li
ng-repeat=
"notify in notifications[3] | limitTo: '8'"
>
<a
role=
"button"
>
<div>
<i
class=
"fa fa-comment fa-fw"
></i>
New Comment
<span
class=
"pull-right text-muted small"
>
4 minutes ago
</span>
<span
ng-click=
"markAsRead(notify, 3, $index)"
class=
"pull-right fa fa-times"
></span>
<span
ng-click=
"markAsRead(
$event,
notify, 3, $index)"
class=
"pull-right fa fa-times"
></span>
</div>
</a>
</li>
...
...
@@ -102,4 +135,3 @@
</li>
<!-- /.dropdown -->
</ul>
app/shared/templates/notificationsModalContent.html
0 → 100644
View file @
2440378e
<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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment