Commit eb48092d authored by Evren Kutar's avatar Evren Kutar

Merge branch 'uitemplates'

parents 76fb3331 cd11a6be
...@@ -10,38 +10,30 @@ app.config(['$routeProvider', function ($routeProvider) { ...@@ -10,38 +10,30 @@ app.config(['$routeProvider', function ($routeProvider) {
templateUrl: 'components/dashboard/dashboard.html', templateUrl: 'components/dashboard/dashboard.html',
controller: 'DashCtrl' controller: 'DashCtrl'
}) })
.when('/:model/add', { .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', templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl' controller: 'CRUDAddEditCtrl'
}) })
.when('/:model/edit/:id', { .when('/crud/:model/edit/:id', {
templateUrl: 'components/crud/templates/add.html', templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl' controller: 'CRUDAddEditCtrl'
}) })
.when('/:model', { .when('/crud/:model', {
templateUrl: 'components/crud/templates/list.html', templateUrl: 'components/crud/templates/list.html',
controller: 'CRUDListCtrl' controller: 'CRUDListCtrl'
}) })
.when('/:model/:id', { .when('/crud/:model/:id', {
templateUrl: 'components/crud/templates/show.html', templateUrl: 'components/crud/templates/show.html',
controller: 'CRUDShowCtrl' controller: 'CRUDShowCtrl'
}) })
.when('/staff/add', {
templateUrl: 'components/staff/templates/add.html',
controller: 'StaffAddEditCtrl'
})
.when('/staff/edit/:id', {
templateUrl: 'components/staff/templates/edit.html',
controller: 'StaffAddEditCtrl'
})
.when('/staffs', {
templateUrl: 'components/staff/templates/list.html',
controller: 'StaffListCtrl'
})
.when('/staff/:id', {
templateUrl: 'components/staff/templates/show.html',
controller: 'StaffShowCtrl'
})
.otherwise({redirectTo: '/dashboard'}); .otherwise({redirectTo: '/dashboard'});
}]) }])
.run(function ($rootScope) { .run(function ($rootScope) {
......
...@@ -38,7 +38,8 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt ...@@ -38,7 +38,8 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
if (form.$valid) { if (form.$valid) {
Generator.submit($scope) Generator.submit($scope)
.success(function(data){ .success(function(data){
$location.path($scope.form_params.model).search(data); debugger;
$location.path('/crud/'+$scope.form_params.model).search(data);
}) })
.error(function(data){ .error(function(data){
$scope.message = data.title; $scope.message = data.title;
......
<div class="starter-template"> <div class="starter-template">
<h1>{{model}} <a href="#/{{model}}/add"><button type="button" class="btn btn-primary">Ekle</button></a></h1> <h1>{{model}} <a href="#/crud/{{model}}/add"><button type="button" class="btn btn-primary">Ekle</button></a></h1>
<div class="tablescroll"> <div class="tablescroll">
<table class="table table-bordered" style="background-color:#fff;"> <table class="table table-bordered" style="background-color:#fff;">
<thead> <thead>
...@@ -24,15 +24,15 @@ ...@@ -24,15 +24,15 @@
</td> </td>
<th scope="row" style="text-align:center">{{$index}}</th> <th scope="row" style="text-align:center">{{$index}}</th>
<td ng-repeat="k in object" ng-if="nobjects[0]=='-1' && $index>0"> <td ng-repeat="k in object" ng-if="nobjects[0]=='-1' && $index>0">
<a ng-href="#/{{model}}/{{object[0]}}">{{object[1]}}</a> <a ng-href="#/crud/{{model}}/{{object[0]}}">{{object[1]}}</a>
</td> </td>
<td ng-repeat="(key,value) in object" ng-if="nobjects[0]!='-1' && $index>0"> <td ng-repeat="(key,value) in object" ng-if="nobjects[0]!='-1' && $index>0">
<a ng-href="#/{{model}}/{{object[0]}}" ng-if="$index==1">{{value}}</a> <a ng-href="#/crud/{{model}}/{{object[0]}}" ng-if="$index==1">{{value}}</a>
<span ng-if="$index!=1">{{value}}</span> <span ng-if="$index!=1">{{value}}</span>
</td> </td>
<td> <td>
<a ng-href="#/{{model}}/edit/{{object[0]}}">Edit</a><br> <a ng-href="#/crud/{{model}}/edit/{{object[0]}}">Edit</a><br>
</td> </td>
</tr> </tr>
</tbody> </tbody>
......
<div ng-app="ulakbus.uitemplates" class="dashboard">
<div class="starter-template">
<div class="row">
<div>
404.html
</div>
</div>
</div>
</div>
\ No newline at end of file
<div ng-app="ulakbus.uitemplates" class="dashboard">
<div class="starter-template">
<div class="row">
<div>500.html</div>
</div>
</div>
</div>
\ No newline at end of file
/**
* 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/uitemplates/500.html',
controller: '500Ctrl'
})
.when('/404', {
templateUrl: 'components/uitemplates/404.html',
controller: '404Ctrl'
});
}]);
angular.module('ulakbus.uitemplates', ['ngRoute'])
.controller('500Ctrl', function ($scope, $rootScope, $location) {
})
.controller('400Ctrl', function ($scope, $rootScope, $location) {
});
\ No newline at end of file
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
<script src="components/auth/auth_service.js"></script> <script src="components/auth/auth_service.js"></script>
<script src="components/dashboard/dashboard_controller.js"></script> <script src="components/dashboard/dashboard_controller.js"></script>
<script src="components/crud/crud_controller.js"></script> <script src="components/crud/crud_controller.js"></script>
<script src="components/staff/staff_controller.js"></script> <script src="components/uitemplates/uitemplates.js"></script>
<script src="components/student/student_controller.js"></script> <!--<script src="components/student/student_controller.js"></script>-->
<script src="components/version/interpolate-filter.js"></script> <script src="components/version/interpolate-filter.js"></script>
<script src="components/version/version-directive.js"></script> <script src="components/version/version-directive.js"></script>
<script src="components/version/version.js"></script> <script src="components/version/version.js"></script>
......
...@@ -28,7 +28,7 @@ var app = angular.module( ...@@ -28,7 +28,7 @@ var app = angular.module(
'templates-prod', 'templates-prod',
// @endif // @endif
// @if NODE_ENV='DEVELOPMENT' // @if NODE_ENV='DEVELOPMENT'
//'templates-dev', 'ulakbus.uitemplates',
// @endif // @endif
]). ]).
/** /**
......
...@@ -70,7 +70,7 @@ app.directive('sidebar', ['$location', function () { ...@@ -70,7 +70,7 @@ app.directive('sidebar', ['$location', function () {
// at start define breadcrumblinks for breadcrumb // at start define breadcrumblinks for breadcrumb
angular.forEach(data.app_models, function (value, key) { angular.forEach(data.app_models, function (value, key) {
angular.forEach(value[1], function (v, k) { angular.forEach(value[1], function (v, k) {
if (v[1] == $location.path().split('/')[1]) { if (v[1] == $location.path().split('/')[2]) {
$rootScope.breadcrumblinks = [value[0], v[0]]; $rootScope.breadcrumblinks = [value[0], v[0]];
$scope.menuItems = [$scope.allMenuItems[key]]; $scope.menuItems = [$scope.allMenuItems[key]];
} else { } else {
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
<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> {{ item[0] }}<span
class="fa arrow"></span></a> class="fa arrow"></span></a>
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li ng-repeat="(k, v) in item[1]"><a href="#/{{v[1]}}" ng-click="breadcrumb([item[0], v[0]])">{{v[0]}}</a></li> <li ng-repeat="(k, v) in item[1]"><a href="#/crud/{{v[1]}}"
ng-click="breadcrumb([item[0], v[0]])">{{v[0]}}</a></li>
</ul> </ul>
<!-- /.nav-second-level --> <!-- /.nav-second-level -->
</li> </li>
......
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