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

Merge branch 'Feature/#143/Formsets'

parents 3dc0b101 e4ab66b6
......@@ -32,6 +32,7 @@ var app = angular.module(
*/
constant("RESTURL", (function () {
return {url: "http://" + window.location.hostname + ":9001/"};
//return {url: "http://api.ulakbus.net/"};
})()).
/**
* USER_ROLES and AUTH_EVENTS are constant for auth functions
......
......@@ -10,19 +10,19 @@ app.config(['$routeProvider', function ($routeProvider) {
templateUrl: 'components/dashboard/dashboard.html',
controller: 'DashCtrl'
})
.when('/crud/:model/add', {
.when('/:model/add', {
templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl'
})
.when('/crud/:model/edit/:id', {
.when('/:model/edit/:id', {
templateUrl: 'components/crud/templates/add.html',
controller: 'CRUDAddEditCtrl'
})
.when('/crud/:model', {
.when('/:model', {
templateUrl: 'components/crud/templates/list.html',
controller: 'CRUDListCtrl'
})
.when('/crud/:model/:id', {
.when('/:model/:id', {
templateUrl: 'components/crud/templates/show.html',
controller: 'CRUDShowCtrl'
})
......
......@@ -33,8 +33,6 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
debugger;
if (form.$valid) {
Generator.submit($scope)
.success(function(data){
......
......@@ -3,7 +3,12 @@
<table class="table table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th colspan="2">#</th>
<th colspan="2">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
Hepsini Seç
</label>
</th>
<th ng-repeat="(key,value) in objects[0].data">{{ key }}</th>
<th>action</th>
</tr>
......@@ -18,10 +23,27 @@
<th scope="row" style="text-align:center">1</th>
<td ng-repeat="(key,value) in object.data">{{value}}</td>
<td>
<a ng-href="#/crud/{{model}}/edit/{{object.key}}">Edit</a><br>
<a ng-href="#/crud/{{model}}/{{object.key}}">Show</a>
<a ng-href="#/{{model}}/edit/{{object.key}}">Edit</a><br>
<a ng-href="#/{{model}}/{{object.key}}">Show</a>
</td>
</tr>
</tbody>
</table>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
İşlemler <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="">İşlem 1</a></li>
<li><a href="">İşlem 2</a></li>
<li><a href="">İşlem 3</a></li>
<li role="separator" class="divider"></li>
<li><a href="">İşlem 4</a></li>
</ul>
</div>
<hr>
</div>
\ No newline at end of file
......@@ -64,6 +64,7 @@
<script src="bower_components/angular/angular.min.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>
<script src="bower_components/angular-cookies/angular-cookies.min.js"></script>
<script src="bower_components/angular-resource/angular-resource.min.js"></script>
......
......@@ -45,19 +45,23 @@ app.directive('headerSubMenu', function () {
// todo: double make it but single not solve this!
angular.element($('#submitbutton')).triggerHandler('click');
angular.element($('#submitbutton')).triggerHandler('click');
//$scope.$broadcast('schemaFormValidate');
//$scope.onSubmit(angular.element($('#submitbutton')).scope().formgenerated);
}
}
}
});
// todo: unused delete
app.directive('headerSubMenuButtons', function () {
app.directive('headerBreadcrumb', function ($location) {
return {
templateUrl: 'shared/templates/directives/header-sub-menu-buttons.html',
templateUrl: 'shared/templates/directives/header-breadcrumb.html',
restrict: 'E',
replace: true
replace: true,
link: function($scope){
$scope.$watch('$routeUpdate', function(){
// todo: create actual links
//debugger;
$scope.links = $location.path().split('/');
});
}
}
});
......
<h1>{{ schema.title }}</h1>
<form id="formgenerated" name="formgenerated" sf-schema="schema" sf-form="form" sf-model="model"></form>
<div ng-repeat="node in listnodes">
<div ng-repeat="node in Node">
<h3>{{ node.title }}
<span ng-if="node.lengthModels < 1">
<a href="javascript:void(0);" modal-for-nodes="{{node.title}},Node">
<i class="fa fa-plus-circle fa-fw"></i>
</a>
</span>
</h3>
<ng-include src="'shared/templates/nodeTable.html'" ng-if="node.lengthModels > 0"></ng-include>
<hr>
</div>
<div ng-repeat="node in ListNode">
<h3>{{ node.title }}
<span>
<a href="javascript:void(0);" add-modal-for-list-node={{node.title}}>
<a href="javascript:void(0);" modal-for-nodes="{{node.title}},ListNode">
<i class="fa fa-plus-circle fa-fw"></i>
</a>
</span>
</h3>
<table class="table table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th colspan="2">#</th>
<th ng-repeat="(key,value) in node.fields">{{ value.title }}</th>
<th>action</th>
</tr>
</thead>
<tbody>
<tr>
<td width="60">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
</label>
</td>
<th scope="row" style="text-align:center">1</th>
<td ng-repeat="(key,value) in node.models">{{ value.value }}</td>
<td>
<a ng-href="#/crud/{{model}}/edit/{{object.key}}">Edit</a><br>
<a ng-href="#/crud/{{model}}/{{object.key}}">Show</a>
<a ng-href="#/crud/{{model}}/{{object.key}}">Delete</a>
</td>
</tr>
</tbody>
</table>
<ng-include src="'shared/templates/nodeTable.html'" ng-if="node.lengthModels > 0"></ng-include>
<hr>
</div>
<button id="submitbutton" type="button" class="btn btn-primary" ng-click="onSubmit(formgenerated)">Kaydet</button>
<button type="button" class="btn btn-warning">Düzenle</button> <!-- todo: make it conditional -->
<button type="button" class="btn btn-danger">İptal</button> <!-- todo: turn back to previous page -->
\ No newline at end of file
<!-- <button type="button" class="btn btn-warning">Düzenle</button> todo: make it conditional -->
<!-- <button type="button" class="btn btn-danger">İptal</button> todo: turn back to previous page -->
\ No newline at end of file
<ul class="breadcrumb">
<li ng-repeat="link in links" ng-class="{'active':$last}">
<a href="#" ng-if="!$last">{{link}}</a>
<span ng-if="$last">{{link}}</span>
</li>
</ul>
\ No newline at end of file
......@@ -194,13 +194,12 @@
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
<li><a href="#"><i class="fa fa-user fa-fw"></i> Profil</a>
</li>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Ayarlar</a>
</li>
<li><a href="http://www.strapui.com/"><i class="fa fa-eye fa-fw"></i> Premium Angular Themes</a></li>
<li class="divider"></li>
<li><a ui-sref="login" href="javascript:void(0);" logout><i class="fa fa-sign-out fa-fw"></i> Logout</a>
<li><a ui-sref="login" href="javascript:void(0);" logout><i class="fa fa-sign-out fa-fw"></i> Çıkış</a>
</li>
</ul>
<!-- /.dropdown-user -->
......
<button type="button" class="btn btn-primary" ng-click="onSubmit(formgenerated)">Kaydet</button>
<button type="button" class="btn btn-warning">Düzenle</button>
<button type="button" class="btn btn-danger">İptal</button>
\ No newline at end of file
<div class="manager-view-header container-fluid">
<ul class="breadcrumb">
<li><a href="#">Personeller</a></li>
<li><a href="#">Liste</a></li>
<li class="active">Tablo</li>
</ul>
<!--<header-sub-menu-buttons></header-sub-menu-buttons>-->
<header-breadcrumb></header-breadcrumb>
<div id="header-buttons">
<button type="button" class="btn btn-primary" ng-click="triggerSubmit()">Kaydet</button>
<button type="button" class="btn btn-warning">Düzenle</button>
<button type="button" class="btn btn-danger">İptal</button>
<!--<button type="button" class="btn btn-warning">Düzenle</button>-->
<!--<button type="button" class="btn btn-danger">İptal</button>-->
</div>
</div>
\ No newline at end of file
......@@ -13,10 +13,10 @@
class="fa arrow"></span></a>
<ul class="nav nav-second-level" collapse="collapseVar!={{key}}">
<li ui-sref-active="active">
<a href="#/crud/{{item}}">List</a>
<a href="#/{{item}}">List</a>
</li>
<li ui-sref-active="active">
<a href="#/crud/{{item}}/add">Add</a>
<a href="#/{{item}}/add">Add</a>
</li>
</ul>
<!-- /.nav-second-level -->
......
......@@ -19,7 +19,7 @@
<div class="help-block" sf-message="form.description"></div>
</div>
<div class="col-md-4">
<a href="javascript:void(0);" add-modal>
<a href="javascript:void(0);" add-modal-for-linked-model>
<i class="fa fa-plus-circle fa-fw"></i>
</a>
</div>
......
<table class="table table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th colspan="2">#</th>
<th ng-repeat="(key,value) in node.fields">{{ value.title }}</th>
<th>action</th>
</tr>
</thead>
<tbody>
<tr>
<td width="60">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
</label>
</td>
<th scope="row" style="text-align:center">1</th>
<td ng-repeat="(key,value) in node.models">{{ value.value }}</td>
<td>
<a ng-href="#/crud/{{model}}/edit/{{object.key}}">Edit</a><br>
<a ng-href="#/crud/{{model}}/{{object.key}}">Show</a>
<a ng-href="#/crud/{{model}}/{{object.key}}">Delete</a>
</td>
</tr>
</tbody>
</table>
\ No newline at end of file
This diff is collapsed.
......@@ -31,8 +31,9 @@ app.config(['$httpProvider', function ($httpProvider) {
$location.path("/dashboard");
}
}
if(response.data.screen) {
$location.path(response.data.screen);
if(response.data.client_cmd) {
//$location.path(response.data.screen);
console.log(response.data.client_cmd);
}
return response;
},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -72,6 +72,7 @@
<!-- @if NODE_ENV == 'DEVELOPMENT' -->
<script src="bower_components/angular/angular.min.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>
<script src="bower_components/angular-cookies/angular-cookies.min.js"></script>
<script src="bower_components/angular-resource/angular-resource.min.js"></script>
......
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