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
505aee42
Commit
505aee42
authored
Oct 25, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search for user
selected user to header
parent
70bf9c58
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
104 additions
and
54 deletions
+104
-54
app.js
app/app.js
+2
-0
dashboard.html
app/components/dashboard/dashboard.html
+5
-8
dashboard_controller.js
app/components/dashboard/dashboard_controller.js
+17
-13
main.js
app/main.js
+2
-0
directives.js
app/shared/directives.js
+65
-21
theme.js
app/shared/scripts/theme.js
+5
-5
header-sub-menu.html
app/shared/templates/directives/header-sub-menu.html
+1
-0
selected-user.html
app/shared/templates/directives/selected-user.html
+1
-0
sidebar.html
app/shared/templates/directives/sidebar.html
+4
-4
interceptors.js
app/zetalib/interceptors.js
+1
-2
bower.json
bower.json
+1
-1
No files found.
app/app.js
View file @
505aee42
...
...
@@ -44,7 +44,9 @@ var app = angular.module(
var
urlfromqstr
=
location
.
href
.
split
(
'?'
)[
1
].
split
(
'='
)[
1
];
backendurl
=
decodeURIComponent
(
urlfromqstr
.
replace
(
/
\+
/g
,
" "
));
document
.
cookie
=
"backendurl="
+
backendurl
;
window
.
location
.
href
=
window
.
location
.
href
.
split
(
'?'
)[
0
];
}
return
{
url
:
backendurl
};
})()).
/**
...
...
app/components/dashboard/dashboard.html
View file @
505aee42
...
...
@@ -24,10 +24,8 @@
<div
class=
"dashboard-student-search"
>
<center>
<h3>
ÖĞRENCİ
</h3>
<input
type=
"text"
placeholder=
"Öğrenci ara"
ng-model=
"student_kw"
ng-keyup=
"search('Ogrenci')"
><span
class=
"fa fa-search"
ng-click=
"search('Ogrenci')"
></span>
<input
type=
"text"
placeholder=
"Öğrenci ara"
ng-model=
"student_kw"
ng-keyup=
"search('ogrenci')"
>
<span
class=
"fa fa-search"
ng-click=
"search('ogrenci')"
></span>
</center>
<div
class=
"dashboard-search-results"
>
<ul
ng-if=
"students.length > 0"
>
...
...
@@ -42,14 +40,13 @@
<div
class=
"dashboard-personnel-search"
>
<center>
<h3>
PERSONEL
</h3>
<input
type=
"text"
placeholder=
"Personel ara"
ng-model=
"staff_kw"
ng-keyup=
"search('Personel')"
><span
class=
"fa fa-search"
ng-click=
"search('Personel')"
></span>
<input
type=
"text"
placeholder=
"Personel ara"
ng-model=
"staff_kw"
ng-keyup=
"search('personel')"
>
<span
class=
"fa fa-search"
ng-click=
"search('personel')"
></span>
</center>
<div
class=
"dashboard-search-results"
>
<ul
ng-if=
"staffs.length > 0"
>
<li
ng-repeat=
"staff in staffs"
>
<a
href=
"javascript:void(0)"
ng-click=
"select(staff)"
>
{{staff}}
</a>
<a
href=
"javascript:void(0)"
ng-click=
"select(staff)"
>
{{staff
[0]
}}
</a>
</li>
</ul>
</div>
...
...
app/components/dashboard/dashboard_controller.js
View file @
505aee42
...
...
@@ -22,29 +22,33 @@ angular.module('ulakbus.dashboard', ['ngRoute'])
$scope
.
search
=
function
(
where
)
{
$timeout
(
function
()
{
if
(
where
===
'Personel'
)
{
// if input length greater than 3 search for the value
if
(
$scope
.
staff_kw
.
length
>
3
)
{
$scope
.
staffs
=
$scope
.
getItems
(
where
,
$scope
.
staff_kw
);
if
(
where
===
'personel'
)
{
// if input length greater than 2 search for the value
if
(
$scope
.
staff_kw
.
length
>
2
)
{
$scope
.
getItems
(
where
,
$scope
.
staff_kw
).
success
(
function
(
data
)
{
$scope
.
staffs
=
data
.
results
;
});
}
}
if
(
where
===
'Ogrenci'
)
{
if
(
$scope
.
student_kw
.
length
>
3
)
{
$scope
.
students
=
$scope
.
getItems
(
where
,
$scope
.
student_kw
);
if
(
where
===
'ogrenci'
)
{
if
(
$scope
.
student_kw
.
length
>
2
)
{
$scope
.
getItems
(
where
,
$scope
.
student_kw
).
success
(
function
(
data
)
{
$scope
.
students
=
data
.
results
;
})
}
}
});
};
$scope
.
getItems
=
function
(
where
,
params
)
{
$http
.
post
(
RESTURL
.
url
+
where
,
{
"query"
:
params
})
.
success
(
function
(
data
)
{
return
data
;
});
$scope
.
getItems
=
function
(
where
,
what
)
{
return
$http
.
get
(
RESTURL
.
url
+
'ara/'
+
where
+
'/'
+
what
);
//
.success(function (data) {
// return data.results
;
//
});
};
$scope
.
select
=
function
(
who
)
{
$rootScope
.
who
=
who
;
$rootScope
.
selectedUser
=
{
name
:
who
[
0
],
tcno
:
who
[
1
],
key
:
who
[
2
]}
;
// todo: get 'who's related transactions and manipulate sidebar menu
};
...
...
app/main.js
View file @
505aee42
...
...
@@ -49,7 +49,9 @@ var app = angular.module(
var
urlfromqstr
=
location
.
href
.
split
(
'?'
)[
1
].
split
(
'='
)[
1
];
backendurl
=
decodeURIComponent
(
urlfromqstr
.
replace
(
/
\+
/g
,
" "
));
document
.
cookie
=
"backendurl="
+
backendurl
;
window
.
location
.
href
=
window
.
location
.
href
.
split
(
'?'
)[
0
];
}
return
{
url
:
backendurl
};
})()).
/**
...
...
app/shared/directives.js
View file @
505aee42
...
...
@@ -47,28 +47,37 @@ app.directive('headerNotification', function ($http, $interval, RESTURL) {
* toggle collapses sidebar menu when clicked menu button
*/
app
.
directive
(
'collapseMenu'
,
function
()
{
app
.
directive
(
'collapseMenu'
,
function
(
$timeout
)
{
return
{
templateUrl
:
'shared/templates/directives/menuCollapse.html'
,
restrict
:
'E'
,
replace
:
true
,
link
:
function
(
$scope
)
{
$scope
.
collapsed
=
false
;
scope
:
{},
controller
:
function
(
$scope
,
$rootScope
)
{
$rootScope
.
collapsed
=
false
;
$rootScope
.
sidebarPinned
=
false
;
$scope
.
collapseToggle
=
function
()
{
if
(
$
s
cope
.
collapsed
===
false
)
{
if
(
$
rootS
cope
.
collapsed
===
false
)
{
jQuery
(
"span.menu-text"
).
css
(
"display"
,
"none"
);
jQuery
(
".sidebar"
).
css
(
"width"
,
"62px"
);
jQuery
(
".manager-view"
).
css
(
"
z-index"
,
"9999"
).
css
(
"
width"
,
"calc(100% - 62px)"
);
jQuery
(
".manager-view"
).
css
(
"width"
,
"calc(100% - 62px)"
);
jQuery
(
".sidebar footer"
).
css
(
"display"
,
"none"
);
$scope
.
collapsed
=
true
;
$rootScope
.
collapsed
=
true
;
$rootScope
.
sidebarPinned
=
false
;
}
else
{
jQuery
(
"span.menu-text"
).
fadeIn
(
400
);
jQuery
(
".sidebar"
).
css
(
"
z-index"
,
"0"
).
css
(
"
width"
,
"250px"
);
jQuery
(
".sidebar"
).
css
(
"width"
,
"250px"
);
jQuery
(
".manager-view"
).
css
(
"width"
,
"calc(100% - 250px)"
);
jQuery
(
".sidebar footer"
).
fadeIn
(
400
);
$scope
.
collapsed
=
false
;
$rootScope
.
collapsed
=
false
;
$rootScope
.
sidebarPinned
=
true
;
}
};
$timeout
(
function
(){
$scope
.
collapseToggle
();
});
}
};
});
...
...
@@ -107,6 +116,18 @@ app.directive('headerBreadcrumb', function () {
};
});
/**
* selected user directive
*/
app
.
directive
(
'selectedUser'
,
function
()
{
return
{
templateUrl
:
'shared/templates/directives/selected-user.html'
,
restrict
:
'E'
,
replace
:
true
};
});
/**
* sidebar directive
* changes breadcrumb when an item selected
...
...
@@ -120,22 +141,45 @@ app.directive('sidebar', ['$location', function () {
replace
:
true
,
scope
:
{},
controller
:
function
(
$scope
,
$rootScope
,
$http
,
RESTURL
,
$location
,
$timeout
)
{
$http
.
post
(
RESTURL
.
url
+
'crud/'
).
success
(
function
(
data
)
{
$scope
.
allMenuItems
=
angular
.
copy
(
data
.
app_models
);
$scope
.
menuItems
=
[];
// angular.copy($scope.allMenuItems);
$http
.
get
(
RESTURL
.
url
+
'menu/'
).
success
(
function
(
data
)
{
//$scope.allMenuItems = angular.copy(data.generic);
$scope
.
menuItems
=
data
;
// $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
])
{
$rootScope
.
breadcrumblinks
=
[
value
[
0
],
v
[
0
]];
$scope
.
menuItems
=
[
$scope
.
allMenuItems
[
key
]];
}
else
{
$rootScope
.
breadcrumblinks
=
[
'Panel'
];
}
});
});
//angular.forEach(data.app_models, function (value, key) {
// angular.forEach(value[1], function (v, k) {
// if (v[1] === $location.path().split('/')[2]) {
// $rootScope.breadcrumblinks = [value[0], v[0]];
// $scope.menuItems = [$scope.allMenuItems[key]];
// } else {
// $rootScope.breadcrumblinks = ['Panel'];
// }
// });
//});
$timeout
(
function
(){
$
(
'#side-menu'
).
metisMenu
()});
});
$scope
.
openSidebar
=
function
()
{
if
(
$rootScope
.
sidebarPinned
===
false
)
{
jQuery
(
"span.menu-text"
).
fadeIn
(
400
);
jQuery
(
".sidebar"
).
css
(
"width"
,
"250px"
);
jQuery
(
".manager-view"
).
css
(
"width"
,
"calc(100% - 250px)"
);
jQuery
(
".sidebar footer"
).
fadeIn
(
400
);
$rootScope
.
collapsed
=
false
;
}
};
$scope
.
closeSidebar
=
function
()
{
if
(
$rootScope
.
sidebarPinned
===
false
)
{
jQuery
(
"span.menu-text"
).
css
(
"display"
,
"none"
);
jQuery
(
".sidebar"
).
css
(
"width"
,
"62px"
);
jQuery
(
".manager-view"
).
css
(
"width"
,
"calc(100% - 62px)"
);
jQuery
(
".sidebar footer"
).
css
(
"display"
,
"none"
);
$rootScope
.
collapsed
=
true
;
}
};
$rootScope
.
$watch
(
function
(
$rootScope
)
{
return
$rootScope
.
section
;
},
function
(
newindex
,
oldindex
)
{
if
(
newindex
>
-
1
)
{
...
...
app/shared/scripts/theme.js
View file @
505aee42
...
...
@@ -5,11 +5,11 @@
* (GPLv3). See LICENSE.txt for details.
*/
$
(
function
()
{
$
(
'#side-menu'
).
metisMenu
();
});
//
$(function() {
//
//
$('#side-menu').metisMenu();
//
//
});
//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
...
...
app/shared/templates/directives/header-sub-menu.html
View file @
505aee42
...
...
@@ -3,6 +3,7 @@
<header-breadcrumb></header-breadcrumb>
<loaderdiv><div></div></loaderdiv>
<!--<div class="loader">Loading...</div>-->
<selected-user
class=
"pull-right"
></selected-user>
</div>
<!--<div id="header-buttons" ng-class="{hidden: $root.showSaveButton != true}">-->
<!--<button type="button" class="btn btn-primary" ng-click="triggerSubmit()">Kaydet</button>-->
...
...
app/shared/templates/directives/selected-user.html
0 → 100644
View file @
505aee42
<p
ng-if=
"$root.selectedUser.name"
>
Kullanıcı: {{$root.selectedUser.name}}
</p>
\ No newline at end of file
app/shared/templates/directives/sidebar.html
View file @
505aee42
<div
class=
"navbar-default sidebar"
role=
"navigation"
>
<div
class=
"navbar-default sidebar"
role=
"navigation"
ng-mouseenter=
"openSidebar()"
ng-mouseleave=
"closeSidebar()"
>
<div
class=
"brand"
>
<a
href=
""
class=
"logo"
><img
src=
"/img/brand-logo.png"
/></a>
</div>
...
...
@@ -12,11 +12,11 @@
</li>
<li
ng-repeat=
"(key, item) in menuItems"
ng-class=
"{active: collapseVar == $index+1}"
>
{{dropDown}}
<a
href=
""
ng-click=
"check($index+1)"
><i
class=
"fa fa-wrench fa-fw"
></i>
{{
item[0]
}}
<span
<a
href=
""
ng-click=
"check($index+1)"
><i
class=
"fa fa-wrench fa-fw"
></i>
{{
key
}}
<span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<li
ng-repeat=
"
(k, v) in item[1]"
><a
href=
"#/crud
/{{v[1]}}"
ng-click=
"breadcrumb([
item[0]
, v[0]])"
>
{{v[0]}}
</a></li>
<li
ng-repeat=
"
v in item"
><a
ng-href=
"#
/{{v[1]}}"
ng-click=
"breadcrumb([
key
, v[0]])"
>
{{v[0]}}
</a></li>
</ul>
<!-- /.nav-second-level -->
</li>
...
...
app/zetalib/interceptors.js
View file @
505aee42
...
...
@@ -67,8 +67,6 @@ app.config(['$httpProvider', function ($httpProvider) {
// server 500 error returns with -1 on status.
//if (rejection.status === -1 && rejection.config.data.model) {
if
(
rejection
.
status
===
500
)
{
// todo: redirect to 500
//$location.path("/500");
$
(
'<div class="modal">'
+
'<div class="modal-dialog" style="width:1024px;" role="document">'
+
'<div class="modal-content">'
+
...
...
@@ -88,6 +86,7 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>'
+
'</div>'
+
'</div>'
).
modal
()
$location
.
path
(
"/500"
);
}
return
$q
.
reject
(
rejection
);
}
...
...
bower.json
View file @
505aee42
...
...
@@ -16,7 +16,7 @@
"angular-bootstrap"
:
"0.13.1"
,
"font-awesome"
:
"4.3.0"
,
"angular-schema-form"
:
"0.8.3"
,
"angular-loading-bar"
:
"~0.
7
.0"
,
"angular-loading-bar"
:
"~0.
8
.0"
,
"angular-ui-router"
:
"~0.2.15"
,
"angular-toggle-switch"
:
"~1.2.1"
,
"metisMenu"
:
"~1.1.3"
,
...
...
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