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
cc2ed499
Commit
cc2ed499
authored
Oct 08, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error pages 404 and 500 and no content to list page
parent
8b18dbb6
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
51 deletions
+107
-51
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
+2
-1
main.html
app/main.html
+3
-2
main.js
app/main.js
+1
-2
interceptors.js
app/zetalib/interceptors.js
+21
-17
No files found.
app/app.js
View file @
cc2ed499
...
...
@@ -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 @
cc2ed499
...
...
@@ -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 @
cc2ed499
<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 @
cc2ed499
<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 @
cc2ed499
<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 @
cc2ed499
/**
* 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 @
cc2ed499
...
...
@@ -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 @
cc2ed499
...
...
@@ -63,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>
...
...
@@ -101,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 @
cc2ed499
...
...
@@ -71,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>
...
...
@@ -109,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>
...
...
@@ -117,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 @
cc2ed499
...
...
@@ -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/zetalib/interceptors.js
View file @
cc2ed499
...
...
@@ -12,57 +12,61 @@ 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
)
{
if
(
rejection
.
status
===
401
)
{
//$rootScope.loggedInUser = false;
if
(
$location
.
path
()
===
"/login"
)
{
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
)
{
$location
.
path
(
"/404"
);
}
if
(
rejection
.
status
===
500
)
{
$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