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
11f317c5
Commit
11f317c5
authored
Oct 06, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'notifications_enhancement'
parents
1c4b461b
a1ea6c2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
45 deletions
+53
-45
directives.js
app/shared/directives.js
+33
-25
header-notification.html
app/shared/templates/directives/header-notification.html
+20
-20
No files found.
app/shared/directives.js
View file @
11f317c5
...
...
@@ -14,23 +14,30 @@ app.directive('logout', function ($http, $location, RESTURL) {
$element
.
on
(
'click'
,
function
()
{
$http
.
post
(
RESTURL
.
url
+
'logout'
,
{}).
then
(
function
()
{
$rootScope
.
loggedInUser
=
false
;
console
.
log
(
$rootScope
.
loggedInUser
);
$location
.
path
(
"/login"
);
});
});
}
}
}
;
});
/**
* headerNotification directive for header
*/
app
.
directive
(
'headerNotification'
,
function
()
{
app
.
directive
(
'headerNotification'
,
function
(
$http
,
$interval
)
{
return
{
templateUrl
:
'shared/templates/directives/header-notification.html'
,
restrict
:
'E'
,
replace
:
true
}
replace
:
true
,
link
:
function
(
$scope
)
{
$interval
(
function
()
{
// todo: change url to backend
$http
.
get
(
"http://google.com"
).
success
(
function
(
data
)
{
$scope
.
notifications
=
data
;
});
},
15000
);
}
};
});
app
.
directive
(
'headerSubMenu'
,
function
()
{
...
...
@@ -44,9 +51,9 @@ app.directive('headerSubMenu', function () {
// todo: double make it but single not solve this!
angular
.
element
(
$
(
'#submitbutton'
)).
triggerHandler
(
'click'
);
angular
.
element
(
$
(
'#submitbutton'
)).
triggerHandler
(
'click'
);
}
}
;
}
}
}
;
});
app
.
directive
(
'headerBreadcrumb'
,
function
()
{
...
...
@@ -54,7 +61,7 @@ app.directive('headerBreadcrumb', function () {
templateUrl
:
'shared/templates/directives/header-breadcrumb.html'
,
restrict
:
'E'
,
replace
:
true
}
}
;
});
app
.
directive
(
'sidebar'
,
[
'$location'
,
function
()
{
...
...
@@ -65,12 +72,12 @@ app.directive('sidebar', ['$location', function () {
scope
:
{},
controller
:
function
(
$scope
,
$rootScope
,
$http
,
RESTURL
,
$location
,
$timeout
)
{
$http
.
post
(
RESTURL
.
url
+
'crud/'
).
success
(
function
(
data
)
{
$scope
.
allMenuItems
=
data
.
app_models
;
$scope
.
allMenuItems
=
angular
.
copy
(
data
.
app_models
)
;
$scope
.
menuItems
=
[];
// angular.copy($scope.allMenuItems);
// at start define breadcrumblinks for breadcrumb
angular
.
forEach
(
data
.
app_models
,
function
(
value
,
key
)
{
angular
.
forEach
(
value
[
1
],
function
(
v
,
k
)
{
if
(
v
[
1
]
==
$location
.
path
().
split
(
'/'
)[
2
])
{
if
(
v
[
1
]
==
=
$location
.
path
().
split
(
'/'
)[
2
])
{
$rootScope
.
breadcrumblinks
=
[
value
[
0
],
v
[
0
]];
$scope
.
menuItems
=
[
$scope
.
allMenuItems
[
key
]];
}
else
{
...
...
@@ -80,17 +87,16 @@ app.directive('sidebar', ['$location', function () {
});
});
$rootScope
.
$watch
(
function
(
$rootScope
)
{
return
$rootScope
.
section
},
function
(
newindex
,
oldindex
)
{
if
(
newindex
>
-
1
)
{
$rootScope
.
$watch
(
function
(
$rootScope
)
{
return
$rootScope
.
section
;
},
function
(
newindex
,
oldindex
)
{
if
(
newindex
>
-
1
)
{
$scope
.
menuItems
=
[
$scope
.
allMenuItems
[
newindex
]];
$scope
.
collapseVar
=
1
;
$timeout
(
function
()
{
$
(
'#side-menu'
).
metisMenu
();
});
}
}
);
});
// todo: change to $watch to init
//$timeout(function () {
...
...
@@ -103,10 +109,11 @@ app.directive('sidebar', ['$location', function () {
$scope
.
check
=
function
(
x
)
{
if
(
x
==
$scope
.
collapseVar
)
if
(
x
==
=
$scope
.
collapseVar
)
{
$scope
.
collapseVar
=
0
;
else
}
else
{
$scope
.
collapseVar
=
x
;
}
};
...
...
@@ -119,14 +126,15 @@ app.directive('sidebar', ['$location', function () {
$scope
.
multiCheck
=
function
(
y
)
{
if
(
y
==
$scope
.
multiCollapseVar
)
if
(
y
==
=
$scope
.
multiCollapseVar
)
{
$scope
.
multiCollapseVar
=
0
;
else
}
else
{
$scope
.
multiCollapseVar
=
y
;
}
};
}
}
}
;
}]);
app
.
directive
(
'stats'
,
function
()
{
...
...
@@ -145,7 +153,7 @@ app.directive('stats', function () {
'goto'
:
'@'
}
}
}
;
});
app
.
directive
(
'notifications'
,
function
()
{
...
...
@@ -153,7 +161,7 @@ app.directive('notifications', function () {
templateUrl
:
'shared/templates/directives/notifications.html'
,
restrict
:
'E'
,
replace
:
true
,
}
}
;
});
app
.
directive
(
'sidebarSearch'
,
function
()
{
...
...
@@ -165,7 +173,7 @@ app.directive('sidebarSearch', function () {
controller
:
function
(
$scope
)
{
$scope
.
selectedMenu
=
'home'
;
}
}
}
;
});
app
.
directive
(
'timeline'
,
function
()
{
...
...
@@ -173,7 +181,7 @@ app.directive('timeline', function () {
templateUrl
:
'shared/templates/directives/timeline.html'
,
restrict
:
'E'
,
replace
:
true
,
}
}
;
});
app
.
directive
(
'chat'
,
function
()
{
...
...
@@ -181,5 +189,5 @@ app.directive('chat', function () {
templateUrl
:
'shared/templates/directives/chat.html'
,
restrict
:
'E'
,
replace
:
true
,
}
}
;
});
\ No newline at end of file
app/shared/templates/directives/header-notification.html
View file @
11f317c5
...
...
@@ -3,26 +3,26 @@
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-envelope fa-fw"
></i>
<i
class=
"fa fa-caret-down"
></i>
</a>
<
!--<ul class="dropdown-menu dropdown-messages">--
>
<
!--<li>--
>
<
!--<a href="#">--
>
<
!--<div>--
>
<
!--<strong>John Smith</strong>--
>
<
!--<span class="pull-right text-muted">--
>
<
!--<em>Yesterday</em>--
>
<
!--</span>--
>
<
!--</div>--
>
<
!--<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>--
>
<
!--</a>--
>
<
!--</li>--
>
<
!--<li class="divider"></li>--
>
<
!--<li>--
>
<
!--<a class="text-center" href="#">--
>
<
!--<strong>Read All Messages</strong>--
>
<
!--<i class="fa fa-angle-right"></i>--
>
<
!--</a>--
>
<
!--</li>--
>
<
!--</ul>--
>
<
ul
class=
"dropdown-menu dropdown-messages"
>
<
li
>
<
a
href=
"#"
>
<
div
>
<
strong>
John Smith
</strong
>
<
span
class=
"pull-right text-muted"
>
<
em>
Yesterday
</em
>
<
/span
>
<
/div
>
<
div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...
</div
>
<
/a
>
<
/li
>
<
li
class=
"divider"
></li
>
<
li
>
<
a
class=
"text-center"
href=
"#"
>
<
strong>
Read All Messages
</strong
>
<
i
class=
"fa fa-angle-right"
></i
>
<
/a
>
<
/li
>
<
/ul
>
<!-- /.dropdown-messages -->
</li>
<!-- /.dropdown -->
...
...
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