Commit cfd8a52b authored by Evren Kutar's avatar Evren Kutar

sort directive template added waiting for backend

parent ce1fb035
<div class="starter-template container"> <div class="starter-template container">
<sort-directive></sort-directive>
<search-directive ng-if="meta['allow_search']===true"></search-directive> <search-directive ng-if="meta['allow_search']===true"></search-directive>
<div class="clearfix"></div> <div class="clearfix"></div>
<!--<h1>{{form_params.model || form_params.wf}}</h1>--> <!--<h1>{{form_params.model || form_params.wf}}</h1>-->
......
...@@ -124,6 +124,56 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -124,6 +124,56 @@ app.directive('logout', function ($http, $location, RESTURL) {
}; };
}) })
/**
*
*/
.directive('sortDirective', function (Generator, $log) {
return {
templateUrl: 'shared/templates/directives/sort.html',
restrict: 'E',
replace: true,
link: function ($scope) {
// titleMap will be list
$scope.titleMap = [{ value: "artan", name: "Artan" }, { value: "azalan", name: "Azalan" }];
$scope.sortForm = [
{key: 'sortbox', htmlClass: "pull-left", type: "select", titleMap: $scope.titleMap},
{type: "submit", title: "Sırala", htmlClass: "pull-left"}];
$scope.sortSchema = {
type: "object",
properties: {
sortbox: {
type: "select",
title: "Sırala"
}
},
required: ['sortbox']
};
$scope.sortModel = {sortbox: ''};
$scope.sortSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
var sortparams = {
url: $scope.wf,
token: $scope.$parent.token,
object_id: $scope.$parent.object_id,
form_params: {
model: $scope.$parent.form_params.model,
cmd: $scope.$parent.reload_cmd,
flow: $scope.$parent.form_params.flow,
param: 'sort',
id: $scope.sortModel.sortbox
}
};
Generator.submit(sortparams);
}
}
}
};
})
/** /**
* collapseMenu directive * collapseMenu directive
......
<form class="form-inline pull-left" id="sort" name="sort" sf-schema="sortSchema" sf-form="sortForm"
sf-model="sortModel"
ng-submit="sortSubmit(sort)"></form>
\ No newline at end of file
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