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';
app.config(['$routeProvider', function ($routeProvider) {
app.config(['$routeProvider', function ($routeProvider, $route) {
$routeProvider
.when('/login', {
templateUrl: 'components/auth/login.html',
......@@ -10,25 +10,29 @@ app.config(['$routeProvider', function ($routeProvider) {
templateUrl: 'components/dashboard/dashboard.html',
controller: 'DashCtrl'
})
.when('/crud/:model/add', {
.when('/crud/:model/:id', {
templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl'
})
.when('/crud/:model/edit/:id', {
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', {
templateUrl: 'components/crud/templates/list.html',
controller: 'CRUDListCtrl'
controller: 'CRUDListCtrl',
reloadOnSearch: true
})
.when('/crud/:model/:param/:id', {
templateUrl: 'components/crud/templates/show.html',
controller: 'CRUDShowCtrl'
controller: 'CRUDShowCtrl',
reloadOnSearch: true
})
.when('/:model/:id/', {
.when('/:model/', {
templateUrl: 'components/wf/templates/add.html',
controller: 'WFAddEditCtrl'
controller: 'WFAddEditCtrl',
reloadOnSearch: true
})
.otherwise({redirectTo: '/dashboard'});
}])
......
......@@ -9,11 +9,11 @@
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/500', {
.when('/error/500', {
templateUrl: 'components/error_pages/500.html',
controller: '500Ctrl'
})
.when('/404', {
.when('/error/404', {
templateUrl: 'components/error_pages/404.html',
controller: '404Ctrl'
});
......
......@@ -149,7 +149,7 @@ app.directive('sidebar', ['$location', function () {
restrict: 'E',
replace: true,
scope: {},
controller: function ($scope, $rootScope, $cookies, $http, RESTURL, $location, $timeout) {
controller: function ($scope, $rootScope, $cookies, $route, $http, RESTURL, $location, $timeout) {
var sidebarmenu = $('#side-menu');
sidebarmenu.metisMenu();
$http.get(RESTURL.url + 'menu/')
......@@ -218,7 +218,10 @@ app.directive('sidebar', ['$location', function () {
};
// 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;
// showSaveButton is used for to show or not to show save button on top of the page
// todo: remove button
......
......@@ -24,8 +24,8 @@
</a>
<ul class="nav nav-second-level" ng-class="{hidden: $root.collapsed}">
<li ng-repeat="v in item">
<a ng-href="#{{v.url}}/{{v.param}}/{{$root.selectedUser.key}}"
ng-click="breadcrumb([key, v.text])">{{v.text}}</a>
<a ng-href="#{{v.url}}{{$root.selectedUser.key}}"
ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>
</li>
</ul>
<!-- /.nav-second-level -->
......
......@@ -61,7 +61,7 @@ app.config(['$httpProvider', function ($httpProvider) {
}
if (rejection.status === 404) {
console.log(404);
$location.path("/404");
$location.path("/error/404");
}
// server 500 error returns with -1 on status.
//if (rejection.status === -1 && rejection.config.data.model) {
......@@ -84,8 +84,8 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>' +
'</div>' +
'</div>' +
'</div>').modal()
$location.path("/500");
'</div>').modal();
$location.path("/error/500");
}
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