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
5949ecfd
Commit
5949ecfd
authored
Oct 14, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'error_pages'
parents
4da02b24
b26306e0
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
174 additions
and
63 deletions
+174
-63
.gitignore
.gitignore
+4
-1
Gruntfile.js
Gruntfile.js
+1
-2
app.css
app/app.css
+30
-0
app.js
app/app.js
+1
-2
app_routes.js
app/app_routes.js
+8
-8
list.html
app/components/crud/templates/list.html
+7
-2
404.html
app/components/error_pages/404.html
+13
-0
500.html
app/components/error_pages/500.html
+13
-0
error_controller.js
app/components/error_pages/error_controller.js
+28
-0
uitemplates.js
app/components/uitemplates/uitemplates.js
+10
-17
index.html
app/index.html
+3
-1
main.html
app/main.html
+4
-2
main.js
app/main.js
+1
-2
directives.js
app/shared/directives.js
+22
-7
menuCollapse.html
app/shared/templates/directives/menuCollapse.html
+5
-0
interceptors.js
app/zetalib/interceptors.js
+24
-19
No files found.
.gitignore
View file @
5949ecfd
...
...
@@ -103,4 +103,7 @@ docs/_build/
# PyBuilder
target/
coverage/
\ No newline at end of file
coverage/
sync
*.rdb
\ No newline at end of file
Gruntfile.js
View file @
5949ecfd
...
...
@@ -298,8 +298,7 @@ module.exports = function (grunt) {
grunt
.
loadNpmTasks
(
'grunt-preprocess'
);
grunt
.
loadNpmTasks
(
'grunt-env'
);
//grunt.registerTask('dev', ['env:dev', 'preprocess:dev', 'html2js:dev', 'connect:server', 'watch:dev']);
grunt
.
registerTask
(
'dev'
,
[
'env:dev'
,
'preprocess:dev'
,
'html2js:dev'
,
'watch:dev'
]);
grunt
.
registerTask
(
'dev'
,
[
'env:dev'
,
'preprocess:dev'
,
'html2js:dev'
,
'connect:server'
,
'watch:dev'
]);
grunt
.
registerTask
(
'test'
,
[
'bower'
,
'karma:continuous'
]);
grunt
.
registerTask
(
'i18n'
,
[
'nggettext_extract'
,
'nggettext_compile'
]);
grunt
.
registerTask
(
'default'
,
[
...
...
app/app.css
View file @
5949ecfd
...
...
@@ -287,6 +287,11 @@ select {
position
:
absolute
;
right
:
0
;
background-color
:
#f5f5f5
;
-webkit-transition
:
all
.2s
;
-moz-transition
:
all
.2s
;
-ms-transition
:
all
.2s
;
-o-transition
:
all
.2s
;
transition
:
all
.2s
;
}
.manager-view-inner
{
...
...
@@ -946,6 +951,31 @@ table.dataTable thead .sorting:after {
/* END OF PERSONNEL INFO */
/* SIDEBAR COLLAPSE */
.sidebar-collapse-button
{
width
:
62px
;
height
:
41px
;
float
:
left
;
padding
:
8px
16px
;
cursor
:
pointer
;
}
.sidebar-collapse-button
:hover
{
background-color
:
#9A1026
;
}
.sidebar-collapse-button
div
{
width
:
30px
;
height
:
2px
;
background-color
:
#fff
;
margin-top
:
5px
;
border-radius
:
5px
;
}
/* END OF SIDEBAR COLLAPSE */
/* Responsive: Portrait tablets and up */
@media
screen
and
(
min-width
:
768px
)
{
...
...
app/app.js
View file @
5949ecfd
...
...
@@ -18,8 +18,7 @@ var app = angular.module(
'formService'
,
'ulakbus.dashboard'
,
'ulakbus.auth'
,
//'ulakbus.staff',
//'ulakbus.student',
'ulakbus.error_pages'
,
'ulakbus.crud'
,
'ulakbus.version'
,
'schemaForm'
,
...
...
app/app_routes.js
View file @
5949ecfd
...
...
@@ -10,14 +10,14 @@ app.config(['$routeProvider', function ($routeProvider) {
templateUrl
:
'components/dashboard/dashboard.html'
,
controller
:
'DashCtrl'
})
.
when
(
'/500'
,
{
templateUrl
:
'components/uitemplates/500.html'
,
controller
:
'500Ctrl'
})
.
when
(
'/404'
,
{
templateUrl
:
'components/uitemplates/404.html'
,
controller
:
'404Ctrl'
})
//
.when('/500', {
//
templateUrl: 'components/uitemplates/500.html',
//
controller: '500Ctrl'
//
})
//
.when('/404', {
//
templateUrl: 'components/uitemplates/404.html',
//
controller: '404Ctrl'
//
})
.
when
(
'/crud/:model/add'
,
{
templateUrl
:
'components/crud/templates/add.html'
,
controller
:
'CRUDAddEditCtrl'
...
...
app/components/crud/templates/list.html
View file @
5949ecfd
<div
class=
"starter-template"
>
<h1>
{{model}}
<a
href=
"#/crud/{{model}}/add"
><button
type=
"button"
class=
"btn btn-primary"
>
Ekle
</button></a></h1>
<div
class=
"tablescroll"
>
<div
class=
"row"
ng-if=
"!nobjects[1]"
>
<div
class=
"col-md-12"
>
<p
class=
"no-content"
>
Listelenecek içerik yok.
</p>
</div>
</div>
<div
class=
"tablescroll"
ng-if=
"nobjects[1]"
>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<tr>
...
...
@@ -41,7 +46,7 @@
<br/>
<hr/>
<div
class=
"btn-group"
>
<div
class=
"btn-group"
ng-if=
"nobjects[1]"
>
<button
type=
"button"
class=
"btn btn-default dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
İşlemler
<span
class=
"caret"
></span>
...
...
app/components/error_pages/404.html
0 → 100644
View file @
5949ecfd
<div
ng-app=
"ulakbus.error_pages"
class=
"error-page"
>
<div
class=
"starter-template"
>
<div
class=
"row"
>
<div
class=
"error-block"
>
<p>
404
</p>
<p>
Dosya Bulunamıyor
</p>
<a
href=
"#/dashboard"
><button
class=
"btn btn-warning"
>
Panel Sayfasına Dön
</button></a>
</div>
</div>
</div>
</div>
\ No newline at end of file
app/components/error_pages/500.html
0 → 100644
View file @
5949ecfd
<div
ng-app=
"ulakbus.error_pages"
class=
"error-page"
>
<div
class=
"starter-template"
>
<div
class=
"row"
>
<div
class=
"error-block"
>
<p>
500
</p>
<p>
Sunucu Hatası
</p>
<a
href=
"#/dashboard"
><button
class=
"btn btn-warning"
>
Panel Sayfasına Dön
</button></a>
</div>
</div>
</div>
</div>
\ No newline at end of file
app/components/error_pages/error_controller.js
0 → 100644
View file @
5949ecfd
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'
;
app
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/500'
,
{
templateUrl
:
'components/error_pages/500.html'
,
controller
:
'500Ctrl'
})
.
when
(
'/404'
,
{
templateUrl
:
'components/error_pages/404.html'
,
controller
:
'404Ctrl'
});
}]);
angular
.
module
(
'ulakbus.error_pages'
,
[
'ngRoute'
])
.
controller
(
'500Ctrl'
,
function
(
$scope
,
$rootScope
,
$location
)
{
})
.
controller
(
'404Ctrl'
,
function
(
$scope
,
$rootScope
,
$location
)
{
});
\ No newline at end of file
app/components/uitemplates/uitemplates.js
View file @
5949ecfd
...
...
@@ -5,24 +5,17 @@
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'
;
//
'use strict';
app
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/500'
,
{
templateUrl
:
'components/uitemplates/500.html'
,
controller
:
'500Ctrl'
})
.
when
(
'/404'
,
{
templateUrl
:
'components/uitemplates/404.html'
,
controller
:
'404Ctrl'
});
}]);
// app.config(['$routeProvider', function ($routeProvider) {
// $routeProvider
// .when('/500', {
// templateUrl: 'components/uitemplates/500.html',
// controller: '500Ctrl'
// });
// }]);
angular
.
module
(
'ulakbus.uitemplates'
,
[
'ngRoute'
])
.
controller
(
'500Ctrl'
,
function
(
$scope
,
$rootScope
,
$location
)
{
})
.
controller
(
'400Ctrl'
,
function
(
$scope
,
$rootScope
,
$location
)
{
});
\ No newline at end of file
// .controller('500Ctrl', function ($scope, $rootScope, $location) {
// });
\ No newline at end of file
app/index.html
View file @
5949ecfd
...
...
@@ -26,6 +26,7 @@
<body>
<nav
class=
"navbar navbar-default navbar-static-top"
role=
"navigation"
style=
"margin-bottom: 0"
ng-if=
"$root.loggedInUser"
>
<collapse-menu></collapse-menu>
<ul
class=
"header-menu"
>
<li><a
href=
""
>
Mesajlar
</a></li>
<li><a
href=
""
>
Görevler
</a></li>
...
...
@@ -62,7 +63,7 @@
</div>
</div>
<script
src=
"bower_components/angular/angular.
min.
js"
></script>
<script
src=
"bower_components/angular/angular.js"
></script>
<script
src=
"bower_components/jquery/dist/jquery.min.js"
></script>
<script
src=
"bower_components/bootstrap/dist/js/bootstrap.min.js"
></script>
<script
src=
"bower_components/angular-route/angular-route.min.js"
></script>
...
...
@@ -100,6 +101,7 @@
<script
src=
"components/dashboard/dashboard_controller.js"
></script>
<script
src=
"components/crud/crud_controller.js"
></script>
<script
src=
"components/uitemplates/uitemplates.js"
></script>
<script
src=
"components/error_pages/error_controller.js"
></script>
<!--<script src="components/student/student_controller.js"></script>-->
<script
src=
"components/version/interpolate-filter.js"
></script>
<script
src=
"components/version/version-directive.js"
></script>
...
...
app/main.html
View file @
5949ecfd
...
...
@@ -33,6 +33,7 @@
<body>
<nav
class=
"navbar navbar-default navbar-static-top"
role=
"navigation"
style=
"margin-bottom: 0"
ng-if=
"$root.loggedInUser"
>
<collapse-menu></collapse-menu>
<ul
class=
"header-menu"
>
<li><a
href=
""
>
Mesajlar
</a></li>
<li><a
href=
""
>
Görevler
</a></li>
...
...
@@ -70,7 +71,7 @@
</div>
<!-- @if NODE_ENV == 'DEVELOPMENT' -->
<script
src=
"bower_components/angular/angular.
min.
js"
></script>
<script
src=
"bower_components/angular/angular.js"
></script>
<script
src=
"bower_components/jquery/dist/jquery.min.js"
></script>
<script
src=
"bower_components/bootstrap/dist/js/bootstrap.min.js"
></script>
<script
src=
"bower_components/angular-route/angular-route.min.js"
></script>
...
...
@@ -108,6 +109,7 @@
<script
src=
"components/dashboard/dashboard_controller.js"
></script>
<script
src=
"components/crud/crud_controller.js"
></script>
<script
src=
"components/uitemplates/uitemplates.js"
></script>
<script
src=
"components/error_pages/error_controller.js"
></script>
<!--<script src="components/student/student_controller.js"></script>-->
<script
src=
"components/version/interpolate-filter.js"
></script>
<script
src=
"components/version/version-directive.js"
></script>
...
...
@@ -116,7 +118,7 @@
<!-- @if NODE_ENV == 'PRODUCTION' -->
<script
src=
"bower_components/jquery.min.js"
></script>
<script
src=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.3.
18
/angular.min.js"
></script>
<script
src=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.3.
20
/angular.min.js"
></script>
<script
src=
"bower_components/components.js"
></script>
<script
src=
"shared/translations.js"
></script>
<script
src=
"templates.js"
></script>
...
...
app/main.js
View file @
5949ecfd
...
...
@@ -18,8 +18,7 @@ var app = angular.module(
'formService'
,
'ulakbus.dashboard'
,
'ulakbus.auth'
,
//'ulakbus.staff',
//'ulakbus.student',
'ulakbus.error_pages'
,
'ulakbus.crud'
,
'ulakbus.version'
,
'schemaForm'
,
...
...
app/shared/directives.js
View file @
5949ecfd
...
...
@@ -24,7 +24,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
/**
* headerNotification directive for header
*/
app
.
directive
(
'headerNotification'
,
function
(
$http
,
$interval
)
{
app
.
directive
(
'headerNotification'
,
function
(
$http
,
$interval
,
RESTURL
)
{
return
{
templateUrl
:
'shared/templates/directives/header-notification.html'
,
restrict
:
'E'
,
...
...
@@ -32,7 +32,7 @@ app.directive('headerNotification', function ($http, $interval) {
link
:
function
(
$scope
)
{
$interval
(
function
()
{
// todo: change url to backend
$http
.
get
(
"http://google.com
"
).
success
(
function
(
data
)
{
$http
.
post
(
RESTURL
+
"crud
"
).
success
(
function
(
data
)
{
$scope
.
notifications
=
data
;
});
},
15000
);
...
...
@@ -40,6 +40,26 @@ app.directive('headerNotification', function ($http, $interval) {
};
});
app
.
directive
(
'collapseMenu'
,
function
()
{
return
{
templateUrl
:
'shared/templates/directives/menuCollapse.html'
,
restrict
:
'E'
,
replace
:
true
,
link
:
function
(
$scope
)
{
$scope
.
collapsed
=
false
;
$scope
.
collapseToggle
=
function
()
{
if
(
$scope
.
collapsed
===
false
)
{
jQuery
(
".manager-view"
).
css
(
"z-index"
,
"9999"
).
css
(
"width"
,
"100%"
);
$scope
.
collapsed
=
true
;
}
else
{
jQuery
(
".manager-view"
).
css
(
"z-index"
,
"0"
).
css
(
"width"
,
"calc(100% - 250px)"
);
$scope
.
collapsed
=
false
;
}
};
}
};
});
app
.
directive
(
'headerSubMenu'
,
function
()
{
return
{
templateUrl
:
'shared/templates/directives/header-sub-menu.html'
,
...
...
@@ -98,11 +118,6 @@ app.directive('sidebar', ['$location', function () {
}
});
// todo: change to $watch to init
//$timeout(function () {
// $('#side-menu').metisMenu();
//}, 2000);
$scope
.
selectedMenu
=
$location
.
path
();
$scope
.
collapseVar
=
0
;
$scope
.
multiCollapseVar
=
0
;
...
...
app/shared/templates/directives/menuCollapse.html
0 → 100644
View file @
5949ecfd
<div
class=
"sidebar-collapse-button"
ng-click=
"collapseToggle()"
>
<div></div>
<div></div>
<div></div>
</div>
\ No newline at end of file
app/zetalib/interceptors.js
View file @
5949ecfd
...
...
@@ -12,57 +12,62 @@ app.config(['$httpProvider', function ($httpProvider) {
*/
$httpProvider
.
interceptors
.
push
(
function
(
$q
,
$rootScope
,
$location
)
{
return
{
'request'
:
function
(
config
)
{
'request'
:
function
(
config
)
{
// todo: delete console logs
if
(
config
.
method
==
"POST"
)
{
if
(
config
.
method
==
=
"POST"
)
{
// to prevent OPTIONS preflight request
config
.
headers
[
"Content-Type"
]
=
"text/plain"
}
else
{
config
.
headers
[
"Content-Type"
]
=
"text/plain"
;
}
return
config
;
},
'response'
:
function
(
response
)
{
//Will only be called for HTTP up to 300
if
(
response
.
data
.
is_login
==
false
)
{
if
(
response
.
data
.
is_login
===
false
)
{
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
;
$location
.
path
(
"/login"
);
}
if
(
response
.
data
.
is_login
==
true
)
{
if
(
response
.
data
.
is_login
===
true
)
{
$rootScope
.
loggedInUser
=
true
;
if
(
$location
.
path
()
===
"/login"
)
{
if
(
$location
.
path
()
===
"/login"
)
{
$location
.
path
(
"/dashboard"
);
}
}
if
(
response
.
data
.
client_cmd
)
{
// if
(response.data.client_cmd) {
//$location.path(response.data.screen);
}
//
}
return
response
;
},
'responseError'
:
function
(
rejection
)
{
// if unauthorized then redirect to login page
if
(
rejection
.
status
===
400
)
{
if
(
rejection
.
status
===
400
)
{
$location
.
reload
();
}
if
(
rejection
.
status
===
401
)
{
//$rootScope.loggedInUser = false;
if
(
$location
.
path
()
===
"/login"
){
if
(
rejection
.
status
===
401
)
{
if
(
$location
.
path
()
===
"/login"
)
{
console
.
log
(
"show errors on login form"
);
}
else
{
}
else
{
$location
.
path
(
'/login'
);
}
}
if
(
rejection
.
status
===
403
)
{
if
(
rejection
.
data
.
is_login
==
true
)
{
if
(
rejection
.
status
===
403
)
{
if
(
rejection
.
data
.
is_login
==
=
true
)
{
$rootScope
.
loggedInUser
=
true
;
console
.
log
(
'user logged in'
);
if
(
$location
.
path
()
===
"/login"
){
if
(
$location
.
path
()
===
"/login"
)
{
$location
.
path
(
"/dashboard"
);
}
}
}
if
(
rejection
.
status
===
404
)
{
console
.
log
(
404
);
$location
.
path
(
"/404"
);
}
// server 500 error returns with -1 on status.
if
(
rejection
.
status
===
-
1
&&
rejection
.
config
.
data
.
model
)
{
$location
.
path
(
"/500"
);
}
return
$q
.
reject
(
rejection
);
}
};
...
...
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