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
2f3145b0
Commit
2f3145b0
authored
Nov 06, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menu group by item.kategori
parent
6ba9dd32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
directives.js
app/shared/directives.js
+15
-0
sidebar.html
app/shared/templates/directives/sidebar.html
+17
-6
No files found.
app/shared/directives.js
View file @
2f3145b0
...
...
@@ -183,6 +183,21 @@ app.directive('sidebar', ['$location', function () {
.
success
(
function
(
data
)
{
$scope
.
allMenuItems
=
angular
.
copy
(
data
);
function
reGroupMenuItems
(
items
)
{
var
newItems
=
{};
angular
.
forEach
(
items
,
function
(
value
,
key
)
{
newItems
[
value
.
kategori
]
=
newItems
[
value
.
kategori
]
||
[];
newItems
[
value
.
kategori
].
push
(
value
);
});
return
newItems
;
}
angular
.
forEach
(
$scope
.
allMenuItems
,
function
(
value
,
key
)
{
$scope
.
allMenuItems
[
key
]
=
reGroupMenuItems
(
value
);
});
console
.
log
(
$scope
.
allMenuItems
);
// broadcast for authorized menu items, consume in dashboard
$rootScope
.
$broadcast
(
"authz"
,
data
);
...
...
app/shared/templates/directives/sidebar.html
View file @
2f3145b0
...
...
@@ -23,12 +23,23 @@
<span
class=
"fa arrow"
ng-class=
"{hidden: $root.collapsed}"
></span>
</a>
<ul
class=
"nav nav-second-level"
ng-class=
"{hidden: $root.collapsed}"
>
<li
ng-repeat=
"v in item"
>
<a
ng-if=
"key == 'other'"
ng-href=
"#{{v.url}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
<a
ng-if=
"key == 'ogrenci' || key == 'personel'"
ng-href=
"#{{v.url}}/list?{{v.param}}={{$root.selectedUser.key}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
<li
ng-repeat=
"(key2, item2) in item"
>
<!--<a ng-if="key == 'other'" ng-href="#{{v.url}}"-->
<!--ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>-->
<!--<a ng-if="key == 'ogrenci' || key == 'personel'"-->
<!--ng-href="#{{v.url}}/list?{{v.param}}={{$root.selectedUser.key}}"-->
<!--ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>-->
<a
href=
"#"
>
{{key2}}
<span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-third-level collapse in"
aria-expanded=
"true"
>
<li
ng-repeat=
"(k,v) in item2"
>
<a
ng-if=
"key == 'other'"
ng-href=
"#{{v.url}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
<a
ng-if=
"key == 'ogrenci' || key == 'personel'"
ng-href=
"#{{v.url}}/list?{{v.param}}={{$root.selectedUser.key}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
</li>
</ul>
<!-- /.nav-third-level -->
</li>
</ul>
<!-- /.nav-second-level -->
...
...
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