Commit 562f8061 authored by Evren Kutar's avatar Evren Kutar

Merge branch 'Feature/issue50'

parents dbdcc682 c7aeefcf
...@@ -1636,6 +1636,6 @@ table.dataTable thead .sorting:after { ...@@ -1636,6 +1636,6 @@ table.dataTable thead .sorting:after {
} }
/* end page transitions */ /* end page transitions */
.movetobottom { .move-to-bottom, .move-to-top {
margin-right: 10px !important; margin-right: 10px !important;
} }
\ No newline at end of file
...@@ -25,7 +25,7 @@ var app = angular.module( ...@@ -25,7 +25,7 @@ var app = angular.module(
'ulakbus.version', 'ulakbus.version',
//'schemaForm', //'schemaForm',
'gettext', 'gettext',
'ulakbus.uitemplates', 'ulakbus.uitemplates'
]). ]).
/** /**
* RESTURL is the url of rest api to talk * RESTURL is the url of rest api to talk
...@@ -33,7 +33,7 @@ var app = angular.module( ...@@ -33,7 +33,7 @@ var app = angular.module(
*/ */
constant("RESTURL", (function () { constant("RESTURL", (function () {
// todo: below backendurl definition is for development purpose and will be deleted // todo: below backendurl definition is for development purpose and will be deleted
var backendurl = location.href.indexOf('nightly') ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/"; var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/";
if (document.cookie.indexOf("backendurl") > -1) { if (document.cookie.indexOf("backendurl") > -1) {
var cookiearray = document.cookie.split(';'); var cookiearray = document.cookie.split(';');
angular.forEach(cookiearray, function (item) { angular.forEach(cookiearray, function (item) {
......
...@@ -72,8 +72,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -72,8 +72,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}); });
angular.forEach(value.fields, function (v, k) { angular.forEach(value.fields, function (v, k) {
if (value.actions.length > 0 && linkIndexes.fields){ if (value.actions.length > 0 && linkIndexes.fields){
scope.objects[key].fields[k] = {type: linkIndexes.fields.indexOf(k) > -1 ? 'link' : 'str', content: v, cmd: linkIndexes.cmd}; scope.objects[key].fields[k] = {
} else { type: linkIndexes.fields.indexOf(k) > -1 ? 'link' : 'str',
content: v,
cmd: linkIndexes.cmd,
mode: linkIndexes.mode
};
}
else {
scope.objects[key].fields[k] = {type: 'str', content: v}; scope.objects[key].fields[k] = {type: 'str', content: v};
} }
}); });
...@@ -128,7 +134,31 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -128,7 +134,31 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
$scope.reload_cmd = data; $scope.reload_cmd = data;
$scope.reload({}); $scope.reload({});
}); });
if ($routeParams.cmd === 'show') {
// we use form generator for generic forms. this makes form's scope to confuse on the path to generate form
// object by its name. to manage to locate the form to controllers scope we use a directive called form locator
// a bit dirty way to find form working on but solves our problem
$scope.$on('formLocator', function (event) {
$scope.formgenerated = event.targetScope.formgenerated;
});
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
Generator.submit($scope);
}
};
$scope.do_action = function (key, cmd, mode) {
Generator.doItemAction($scope, key, cmd, mode || 'normal');
};
$scope.getNumber = function (num) {
return new Array(num);
};
//
$scope.showCmd = function () {
CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd); CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd);
// todo: refactor createListObjects func // todo: refactor createListObjects func
var createListObjects = function () { var createListObjects = function () {
...@@ -155,9 +185,8 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -155,9 +185,8 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}); });
} }
createListObjects(); createListObjects();
} };
$scope.listFormCmd = function () {
if ($routeParams.cmd === 'form' || $routeParams.cmd === 'list') {
// function to set scope objects // function to set scope objects
var setpageobjects = function (data) { var setpageobjects = function (data) {
CrudUtility.listPageItems($scope, data); CrudUtility.listPageItems($scope, data);
...@@ -179,39 +208,25 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -179,39 +208,25 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd); CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd);
Generator.get_wf($scope); Generator.get_wf($scope);
} }
// we use form generator for generic forms. this makes form's scope to confuse on the path to generate form
// object by its name. to manage to locate the form to controllers scope we use a directive called form locator
// a bit dirty way to find form working on but solves our problem
$scope.$on('formLocator', function (event) {
$scope.formgenerated = event.targetScope.formgenerated;
});
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
Generator.submit($scope);
}
};
$scope.do_action = function (key, cmd) {
Generator.doItemAction($scope, key, cmd);
}; };
$scope.reloadCmd = function () {
$scope.getNumber = function (num) {
return new Array(num);
};
}
if ($routeParams.cmd === 'reload') {
$scope.reload({}); $scope.reload({});
} };
$scope.resetCmd = function () {
if ($routeParams.cmd === 'reset') {
delete $scope.token; delete $scope.token;
$scope.cmd = 'reset'; $scope.cmd = 'reset';
Generator.get_wf($scope); Generator.get_wf($scope);
} };
var executeCmd = {
show: $scope.showCmd,
list: $scope.listFormCmd,
form: $scope.listFormCmd,
reload: $scope.reloadCmd,
reset: $scope.resetCmd
};
return executeCmd[$routeParams.cmd]();
}) })
......
<crud-show-directive ng-if="object"></crud-show-directive> <crud-show-directive ng-if="object"></crud-show-directive>
<crud-form-directive ng-if="forms"></crud-form-directive> <crud-form-directive ng-if="forms"></crud-form-directive>
<hr class="col-md-12">
<crud-list-directive ng-if="objects"></crud-list-directive> <crud-list-directive ng-if="objects"></crud-list-directive>
\ No newline at end of file
<div class="container"> <div class="container">
<h1>{{ schema.title }}</h1> <h1>{{ schema.title }}</h1>
<div class="buttons-on-top"></div>
<form id="formgenerated" name="formgenerated" sf-schema="schema" sf-form="form" sf-model="model" <form id="formgenerated" name="formgenerated" sf-schema="schema" sf-form="form" sf-model="model"
ng-submit="onSubmit(formgenerated)" form-locator></form> ng-submit="onSubmit(formgenerated)" form-locator></form>
...@@ -34,4 +36,5 @@ ...@@ -34,4 +36,5 @@
</div> </div>
<div class="buttons-on-bottom"></div> <div class="buttons-on-bottom"></div>
</div> </div>
\ No newline at end of file
<div class="starter-template container"> <div class="starter-template container">
<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>-->
<div class="row" ng-if="!objects[1]"> <div class="row" ng-if="!objects[1]">
<div class="col-md-12"> <div class="col-md-12">
<p class="no-content">Listelenecek içerik yok.</p> <p class="no-content">Listelenecek içerik yok.</p>
...@@ -34,13 +34,14 @@ ...@@ -34,13 +34,14 @@
<td ng-repeat="field in object.fields track by $index"> <td ng-repeat="field in object.fields track by $index">
<a ng-href="javascript:void(0)" <a ng-href="javascript:void(0)"
ng-if="field.type==='link'" ng-if="field.type==='link'"
ng-click="do_action(object.key, field.cmd)">{{field.content}}</a> ng-click="do_action(object.key, field.cmd, field.mode)">{{field.content}}</a>
<span ng-if="field.type==='str'">{{field.content}}</span> <span ng-if="field.type==='str'">{{field.content}}</span>
</td> </td>
<td> <td>
<button class="btn btn-primary" style="margin-right: 5px;" ng-repeat="action in object.actions" <button class="btn btn-primary" style="margin-right: 5px;" ng-repeat="action in object.actions"
ng-if="action.show_as==='button'" ng-click="do_action(object.key, action.cmd)">{{action ng-if="action.show_as==='button'"
ng-click="do_action(object.key, action.cmd, action.mode)">{{action
.name}} .name}}
</button> </button>
<br> <br>
......
...@@ -29,7 +29,7 @@ var app = angular.module( ...@@ -29,7 +29,7 @@ var app = angular.module(
'templates-prod', 'templates-prod',
// @endif // @endif
// @if NODE_ENV='DEVELOPMENT' // @if NODE_ENV='DEVELOPMENT'
'ulakbus.uitemplates', 'ulakbus.uitemplates'
// @endif // @endif
]). ]).
/** /**
...@@ -38,7 +38,7 @@ var app = angular.module( ...@@ -38,7 +38,7 @@ var app = angular.module(
*/ */
constant("RESTURL", (function () { constant("RESTURL", (function () {
// todo: below backendurl definition is for development purpose and will be deleted // todo: below backendurl definition is for development purpose and will be deleted
var backendurl = location.href.indexOf('nightly') ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/"; var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/";
if (document.cookie.indexOf("backendurl") > -1) { if (document.cookie.indexOf("backendurl") > -1) {
var cookiearray = document.cookie.split(';'); var cookiearray = document.cookie.split(';');
angular.forEach(cookiearray, function (item) { angular.forEach(cookiearray, function (item) {
......
...@@ -139,7 +139,6 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -139,7 +139,6 @@ app.directive('logout', function ($http, $location, RESTURL) {
controller: function ($scope, $rootScope) { controller: function ($scope, $rootScope) {
$rootScope.collapsed = false; $rootScope.collapsed = false;
$rootScope.sidebarPinned = $cookies.get('sidebarPinned') || 0; $rootScope.sidebarPinned = $cookies.get('sidebarPinned') || 0;
var cookieSidebar = {1:0,0:1};
$scope.collapseToggle = function () { $scope.collapseToggle = function () {
if ($window.innerWidth > '768') { if ($window.innerWidth > '768') {
...@@ -148,15 +147,14 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -148,15 +147,14 @@ app.directive('logout', function ($http, $location, RESTURL) {
jQuery(".manager-view").css("width", "calc(100% - 62px)"); jQuery(".manager-view").css("width", "calc(100% - 62px)");
$rootScope.collapsed = true; $rootScope.collapsed = true;
$rootScope.sidebarPinned = 0; $rootScope.sidebarPinned = 0;
$cookies.put('sidebarPinned', cookieSidebar[$cookies.get('sidebarPinned')]); $cookies.put('sidebarPinned', 0);
} else { } else {
jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400); jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400);
jQuery(".sidebar").css("width", "250px"); jQuery(".sidebar").css("width", "250px");
jQuery(".manager-view").css("width", "calc(100% - 250px)"); jQuery(".manager-view").css("width", "calc(100% - 250px)");
$rootScope.collapsed = false; $rootScope.collapsed = false;
$rootScope.sidebarPinned = 1; $rootScope.sidebarPinned = 1;
$cookies.put('sidebarPinned', cookieSidebar[$cookies.get('sidebarPinned')]); $cookies.put('sidebarPinned', 1);
} }
} }
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* The `formService` module provides generic services for auto generated forms. * The `formService` module provides generic services for auto generated forms.
* *
*/ */
angular.module('formService', []) angular.module('formService', ['ui.bootstrap'])
/** /**
* @name Generator * @name Generator
...@@ -98,6 +98,16 @@ angular.module('formService', []) ...@@ -98,6 +98,16 @@ angular.module('formService', [])
* @returns {*} * @returns {*}
*/ */
generator.prepareFormItems = function (scope) { generator.prepareFormItems = function (scope) {
// todo: remove after backend fix
angular.forEach(scope.form, function (value, key) {
if (value.type === 'select') {
scope.schema.properties[value.key].type = 'select';
scope.schema.properties[value.key].titleMap = value.titleMap;
scope.form[key] = value.key;
}
});
angular.forEach(scope.schema.properties, function (v, k) { angular.forEach(scope.schema.properties, function (v, k) {
// generically change _id fields model value // generically change _id fields model value
...@@ -122,10 +132,11 @@ angular.module('formService', []) ...@@ -122,10 +132,11 @@ angular.module('formService', [])
if (v.type === 'submit' || v.type === 'button') { if (v.type === 'submit' || v.type === 'button') {
var buttonPositions = {bottom: 'move-to-bottom', top: 'move-to-top', none: ''};
scope.form[scope.form.indexOf(k)] = { scope.form[scope.form.indexOf(k)] = {
type: v.type, type: v.type,
title: v.title, title: v.title,
style: "btn-primary movetobottom hide", style: "btn-primary hide " + (buttonPositions[v.position] || "move-to-bottom"),
onClick: function () { onClick: function () {
delete scope.form_params.cmd; delete scope.form_params.cmd;
delete scope.form_params.flow; delete scope.form_params.flow;
...@@ -143,15 +154,18 @@ angular.module('formService', []) ...@@ -143,15 +154,18 @@ angular.module('formService', [])
} }
} }
}; };
// replace buttons according to their position values
$timeout(function () { $timeout(function () {
var buttons = angular.element(document.querySelector('.movetobottom')); var buttonsToBottom = angular.element(document.querySelector('.move-to-bottom'));
angular.element(document.querySelector('.buttons-on-bottom')).append(buttons); angular.element(document.querySelector('.buttons-on-bottom')).append(buttonsToBottom);
buttons.removeClass('hide'); var buttonsToTop = angular.element(document.querySelector('.move-to-top'));
angular.element(document.querySelector('.buttons-on-bottom')).append(buttonsToTop);
buttonsToBottom.removeClass('hide');
buttonsToTop.removeClass('hide');
}); });
} }
// check if type is date and if type date found change it to string // check if type is date and if type date found change it to string
if (v.type === 'date') { if (v.type === 'date') {
v.type = 'string'; v.type = 'string';
scope.model[k] = generator.dateformatter(scope.model[k]); scope.model[k] = generator.dateformatter(scope.model[k]);
...@@ -177,13 +191,12 @@ angular.module('formService', []) ...@@ -177,13 +191,12 @@ angular.module('formService', [])
if (v.type === 'text_general') { if (v.type === 'text_general') {
v.type = 'string'; v.type = 'string';
v["x-schema-form"] = { v["x-schema-form"] = {
"type": "textarea", "type": "textarea"
//"placeholder": "" //"placeholder": ""
} }
} }
// if type is model use foreignKey.html template to show them // if type is model use foreignKey.html template to show them
if (v.type === 'model') { if (v.type === 'model') {
var formitem = scope.form[scope.form.indexOf(k)]; var formitem = scope.form[scope.form.indexOf(k)];
...@@ -206,7 +219,15 @@ angular.module('formService', []) ...@@ -206,7 +219,15 @@ angular.module('formService', [])
"name": item.value "name": item.value
}); });
} }
// get selected item from titleMap using model value
if (item.key === scope.model[k]) {formitem.selected_item = {value: item.key, name: item.value};}
}); });
// after rendering change input value to model value
scope.$watch(document.querySelector('input[name='+ v.model_name+']'),
function(){
angular.element(document.querySelector('input[name='+ v.model_name+']')).val(formitem.selected_item.name);
}
);
}), }),
onSelect: function (item) { onSelect: function (item) {
scope.model[k] = item.value; scope.model[k] = item.value;
...@@ -286,13 +307,24 @@ angular.module('formService', []) ...@@ -286,13 +307,24 @@ angular.module('formService', [])
return newdatearray.join('.'); return newdatearray.join('.');
} }
}; };
generator.doItemAction = function ($scope, key, cmd) { generator.doItemAction = function ($scope, key, cmd, mode) {
// mode could be in ['normal', 'modal', 'new'] . the default mode is 'normal' and it loads data on same
// tab without modal. 'modal' will use modal to manipulate data and do all actions in that modal. 'new'
// will be open new page with response data
var _do = {
normal: function(){
$log.debug('normal mode starts');
$scope.form_params.cmd = cmd; $scope.form_params.cmd = cmd;
$scope.form_params.object_id = key; $scope.form_params.object_id = key;
$scope.form_params.param = $scope.param; $scope.form_params.param = $scope.param;
$scope.form_params.id = $scope.param_id; $scope.form_params.id = $scope.param_id;
$scope.form_params.token = $scope.token; $scope.form_params.token = $scope.token;
generator.get_wf($scope); return generator.get_wf($scope);
},
modal: function(){$log.debug('modal mode is not not ready');},
new: function(){$log.debug('new mode is not not ready');}
};
return _do[mode]();
}; };
generator.get_form = function (scope) { generator.get_form = function (scope) {
...@@ -377,6 +409,7 @@ angular.module('formService', []) ...@@ -377,6 +409,7 @@ angular.module('formService', [])
/** /**
* pathDecider is used to redirect related path by looking up the data in response * pathDecider is used to redirect related path by looking up the data in response
* @param client_cmd
* @param $scope * @param $scope
* @param data * @param data
*/ */
...@@ -388,7 +421,8 @@ angular.module('formService', []) ...@@ -388,7 +421,8 @@ angular.module('formService', [])
* redirectTo function redirects to related controller and path with given data * redirectTo function redirects to related controller and path with given data
* before redirect setPageData must be called and pageData need to be defined * before redirect setPageData must be called and pageData need to be defined
* otherwise redirected path will call api for its data * otherwise redirected path will call api for its data
* @param scope, page * @param scope
* @param page
*/ */
function redirectTo(scope, page) { function redirectTo(scope, page) {
var pathUrl = '/' + scope.form_params.wf; var pathUrl = '/' + scope.form_params.wf;
......
...@@ -6,15 +6,19 @@ ...@@ -6,15 +6,19 @@
* (GPLv3). See LICENSE.txt for details. * (GPLv3). See LICENSE.txt for details.
*/ */
'use strict';
describe('form service module', function () { describe('form service module', function () {
beforeEach(module('ulakbus')); beforeEach(module('ulakbus'));
beforeEach(module('formService')); beforeEach(module('formService'));
var location; var location;
beforeEach(inject(function($location) { beforeEach(inject(function($location, $injector) {
location = $location; location = $location;
// Set up the mock http service responses
$httpBackend = $injector.get('$httpBackend');
// backend definition common for all tests
authRequestHandler = $httpBackend.when('GET', /\.[0-9a-z]+$/i)
.respond({userId: 'userX'}, {'A-Token': 'xxx'});
})); }));
describe('form service', function () { describe('form service', function () {
...@@ -23,7 +27,7 @@ describe('form service module', function () { ...@@ -23,7 +27,7 @@ describe('form service module', function () {
function (Generator) { function (Generator) {
expect(Generator.group).not.toBe(null); expect(Generator.group).not.toBe(null);
var generated_url = Generator.makeUrl({url: 'test', form_params: {}}); var generated_url = Generator.makeUrl({url: 'test', form_params: {}});
expect(generated_url).toEqual("//nightly.api.ulakbus.net/test/"); expect(generated_url).toEqual("//api.ulakbus.net/test/");
}]) }])
); );
...@@ -175,7 +179,7 @@ describe('form service module', function () { ...@@ -175,7 +179,7 @@ describe('form service module', function () {
it('should get list', it('should get list',
inject(function (Generator, $httpBackend, RESTURL) { inject(function (Generator, $httpBackend, RESTURL) {
$httpBackend.expectGET(RESTURL.url + 'test/personel') $httpBackend.expectPOST(RESTURL.url + 'test/personel', {cmd: 'list', model: "personel", object_id: "5821bc25a90aa1"})
.respond(200, { .respond(200, {
items: { items: {
"client_cmd": "list_objects", "client_cmd": "list_objects",
...@@ -317,10 +321,12 @@ describe('form service module', function () { ...@@ -317,10 +321,12 @@ describe('form service module', function () {
object_id: 'xxx11', object_id: 'xxx11',
wf:'testModel'}; wf:'testModel'};
scope.url = 'test';
Generator.get_wf(scope); Generator.get_wf(scope);
$httpBackend.flush(); $httpBackend.flush();
expect(location.path()).toEqual('/testModel/testModel/add'); expect(location.path()).toEqual('/testModel/testModel/do/f');
}) })
); );
......
This diff is collapsed.
...@@ -1649,7 +1649,7 @@ table.dataTable thead .sorting:after { ...@@ -1649,7 +1649,7 @@ table.dataTable thead .sorting:after {
} }
/* end page transitions */ /* end page transitions */
.movetobottom { .move-to-bottom, .move-to-top {
margin-right: 10px !important; margin-right: 10px !important;
} }
......
...@@ -24,7 +24,6 @@ angular.module("components/crud/templates/crud.html", []).run(["$templateCache", ...@@ -24,7 +24,6 @@ angular.module("components/crud/templates/crud.html", []).run(["$templateCache",
$templateCache.put("components/crud/templates/crud.html", $templateCache.put("components/crud/templates/crud.html",
"<crud-show-directive ng-if=\"object\"></crud-show-directive>\n" + "<crud-show-directive ng-if=\"object\"></crud-show-directive>\n" +
"<crud-form-directive ng-if=\"forms\"></crud-form-directive>\n" + "<crud-form-directive ng-if=\"forms\"></crud-form-directive>\n" +
"<hr class=\"col-md-12\">\n" +
"<crud-list-directive ng-if=\"objects\"></crud-list-directive>"); "<crud-list-directive ng-if=\"objects\"></crud-list-directive>");
}]); }]);
...@@ -33,6 +32,8 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache", ...@@ -33,6 +32,8 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
"<div class=\"container\">\n" + "<div class=\"container\">\n" +
" <h1>{{ schema.title }}</h1>\n" + " <h1>{{ schema.title }}</h1>\n" +
"\n" + "\n" +
" <div class=\"buttons-on-top\"></div>\n" +
"\n" +
" <form id=\"formgenerated\" name=\"formgenerated\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\"\n" + " <form id=\"formgenerated\" name=\"formgenerated\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\"\n" +
" ng-submit=\"onSubmit(formgenerated)\" form-locator></form>\n" + " ng-submit=\"onSubmit(formgenerated)\" form-locator></form>\n" +
"\n" + "\n" +
...@@ -66,6 +67,7 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache", ...@@ -66,6 +67,7 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
" </div>\n" + " </div>\n" +
"\n" + "\n" +
" <div class=\"buttons-on-bottom\"></div>\n" + " <div class=\"buttons-on-bottom\"></div>\n" +
"\n" +
"</div>"); "</div>");
}]); }]);
...@@ -74,7 +76,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache", ...@@ -74,7 +76,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
"<div class=\"starter-template container\">\n" + "<div class=\"starter-template container\">\n" +
" <search-directive ng-if=\"meta['allow_search']===true\"></search-directive>\n" + " <search-directive ng-if=\"meta['allow_search']===true\"></search-directive>\n" +
" <div class=\"clearfix\"></div>\n" + " <div class=\"clearfix\"></div>\n" +
" <h1>{{form_params.model || form_params.wf}}</h1>\n" + " <!--<h1>{{form_params.model || form_params.wf}}</h1>-->\n" +
" <div class=\"row\" ng-if=\"!objects[1]\">\n" + " <div class=\"row\" ng-if=\"!objects[1]\">\n" +
" <div class=\"col-md-12\">\n" + " <div class=\"col-md-12\">\n" +
" <p class=\"no-content\">Listelenecek içerik yok.</p>\n" + " <p class=\"no-content\">Listelenecek içerik yok.</p>\n" +
...@@ -107,13 +109,14 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache", ...@@ -107,13 +109,14 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" <td ng-repeat=\"field in object.fields track by $index\">\n" + " <td ng-repeat=\"field in object.fields track by $index\">\n" +
" <a ng-href=\"javascript:void(0)\"\n" + " <a ng-href=\"javascript:void(0)\"\n" +
" ng-if=\"field.type==='link'\"\n" + " ng-if=\"field.type==='link'\"\n" +
" ng-click=\"do_action(object.key, field.cmd)\">{{field.content}}</a>\n" + " ng-click=\"do_action(object.key, field.cmd, field.mode)\">{{field.content}}</a>\n" +
" <span ng-if=\"field.type==='str'\">{{field.content}}</span>\n" + " <span ng-if=\"field.type==='str'\">{{field.content}}</span>\n" +
" </td>\n" + " </td>\n" +
"\n" + "\n" +
" <td>\n" + " <td>\n" +
" <button class=\"btn btn-primary\" style=\"margin-right: 5px;\" ng-repeat=\"action in object.actions\"\n" + " <button class=\"btn btn-primary\" style=\"margin-right: 5px;\" ng-repeat=\"action in object.actions\"\n" +
" ng-if=\"action.show_as==='button'\" ng-click=\"do_action(object.key, action.cmd)\">{{action\n" + " ng-if=\"action.show_as==='button'\"\n" +
" ng-click=\"do_action(object.key, action.cmd, action.mode)\">{{action\n" +
" .name}}\n" + " .name}}\n" +
" </button>\n" + " </button>\n" +
" <br>\n" + " <br>\n" +
...@@ -1455,7 +1458,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu ...@@ -1455,7 +1458,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" sf-changed=\"form\"\n" + " sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" + " class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" + " schema-validate=\"form\"\n" +
" name=\"{{form.model_name}}\"/>\n" + " name=\"{{form.model_name}}\" value=\"{{form.selected_item}}\"/>\n" +
" </div>\n" + " </div>\n" +
"\n" + "\n" +
" <!--<select ng-model=\"$$value$$\"-->\n" + " <!--<select ng-model=\"$$value$$\"-->\n" +
......
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