Commit 4a792e56 authored by Evren Kutar's avatar Evren Kutar

reload same page on click to sidebar menu

new error links
parent 5878d490
'use strict'; 'use strict';
app.config(['$routeProvider', function ($routeProvider) { app.config(['$routeProvider', function ($routeProvider, $route) {
$routeProvider $routeProvider
.when('/login', { .when('/login', {
templateUrl: 'components/auth/login.html', templateUrl: 'components/auth/login.html',
...@@ -10,25 +10,29 @@ app.config(['$routeProvider', function ($routeProvider) { ...@@ -10,25 +10,29 @@ app.config(['$routeProvider', function ($routeProvider) {
templateUrl: 'components/dashboard/dashboard.html', templateUrl: 'components/dashboard/dashboard.html',
controller: 'DashCtrl' controller: 'DashCtrl'
}) })
.when('/crud/:model/add', { .when('/crud/:model/:id', {
templateUrl: 'components/crud/templates/add.html', templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl' controller: 'CRUDAddEditCtrl',
}) reloadOnSearch: true
.when('/crud/:model/edit/:id', {
templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl'
}) })
//.when('/crud/:model/edit/:id', {
// templateUrl: 'components/crud/templates/add.html',
// controller: 'CRUDAddEditCtrl'
//})
.when('/crud/:model', { .when('/crud/:model', {
templateUrl: 'components/crud/templates/list.html', templateUrl: 'components/crud/templates/list.html',
controller: 'CRUDListCtrl' controller: 'CRUDListCtrl',
reloadOnSearch: true
}) })
.when('/crud/:model/:param/:id', { .when('/crud/:model/:param/:id', {
templateUrl: 'components/crud/templates/show.html', templateUrl: 'components/crud/templates/show.html',
controller: 'CRUDShowCtrl' controller: 'CRUDShowCtrl',
reloadOnSearch: true
}) })
.when('/:model/:id/', { .when('/:model/', {
templateUrl: 'components/wf/templates/add.html', templateUrl: 'components/wf/templates/add.html',
controller: 'WFAddEditCtrl' controller: 'WFAddEditCtrl',
reloadOnSearch: true
}) })
.otherwise({redirectTo: '/dashboard'}); .otherwise({redirectTo: '/dashboard'});
}]) }])
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
app.config(['$routeProvider', function ($routeProvider) { app.config(['$routeProvider', function ($routeProvider) {
$routeProvider $routeProvider
.when('/500', { .when('/error/500', {
templateUrl: 'components/error_pages/500.html', templateUrl: 'components/error_pages/500.html',
controller: '500Ctrl' controller: '500Ctrl'
}) })
.when('/404', { .when('/error/404', {
templateUrl: 'components/error_pages/404.html', templateUrl: 'components/error_pages/404.html',
controller: '404Ctrl' controller: '404Ctrl'
}); });
......
...@@ -149,7 +149,7 @@ app.directive('sidebar', ['$location', function () { ...@@ -149,7 +149,7 @@ app.directive('sidebar', ['$location', function () {
restrict: 'E', restrict: 'E',
replace: true, replace: true,
scope: {}, scope: {},
controller: function ($scope, $rootScope, $cookies, $http, RESTURL, $location, $timeout) { controller: function ($scope, $rootScope, $cookies, $route, $http, RESTURL, $location, $timeout) {
var sidebarmenu = $('#side-menu'); var sidebarmenu = $('#side-menu');
sidebarmenu.metisMenu(); sidebarmenu.metisMenu();
$http.get(RESTURL.url + 'menu/') $http.get(RESTURL.url + 'menu/')
...@@ -218,7 +218,10 @@ app.directive('sidebar', ['$location', function () { ...@@ -218,7 +218,10 @@ app.directive('sidebar', ['$location', function () {
}; };
// breadcrumb function changes breadcrumb items and itemlist must be list // breadcrumb function changes breadcrumb items and itemlist must be list
$scope.breadcrumb = function (itemlist) { $scope.breadcrumb = function (itemlist, $event) {
//if ($event.target.href==location.href) {
// $route.reload();
//}
$rootScope.breadcrumblinks = itemlist; $rootScope.breadcrumblinks = itemlist;
// showSaveButton is used for to show or not to show save button on top of the page // showSaveButton is used for to show or not to show save button on top of the page
// todo: remove button // todo: remove button
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
</a> </a>
<ul class="nav nav-second-level" ng-class="{hidden: $root.collapsed}"> <ul class="nav nav-second-level" ng-class="{hidden: $root.collapsed}">
<li ng-repeat="v in item"> <li ng-repeat="v in item">
<a ng-href="#{{v.url}}/{{v.param}}/{{$root.selectedUser.key}}" <a ng-href="#{{v.url}}{{$root.selectedUser.key}}"
ng-click="breadcrumb([key, v.text])">{{v.text}}</a> ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>
</li> </li>
</ul> </ul>
<!-- /.nav-second-level --> <!-- /.nav-second-level -->
......
...@@ -61,7 +61,7 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -61,7 +61,7 @@ app.config(['$httpProvider', function ($httpProvider) {
} }
if (rejection.status === 404) { if (rejection.status === 404) {
console.log(404); console.log(404);
$location.path("/404"); $location.path("/error/404");
} }
// server 500 error returns with -1 on status. // server 500 error returns with -1 on status.
//if (rejection.status === -1 && rejection.config.data.model) { //if (rejection.status === -1 && rejection.config.data.model) {
...@@ -84,8 +84,8 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -84,8 +84,8 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>').modal() '</div>').modal();
$location.path("/500"); $location.path("/error/500");
} }
return $q.reject(rejection); return $q.reject(rejection);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment