Commit 5ab352e5 authored by Evren Kutar's avatar Evren Kutar

resolves #69

parent f14492e8
......@@ -86,7 +86,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.searchForm = [{key: 'searchbox', htmlClass: "pull-left"}, {type: "submit", title: "Ara", style:"btn-info", htmlClass: "pull-left"}];
$scope.searchForm = [{key: 'searchbox', htmlClass: "pull-left"}, {
type: "submit",
title: "Ara",
style: "btn-info",
htmlClass: "pull-left"
}];
$scope.searchSchema = {
type: "object",
properties: {
......@@ -138,7 +143,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
link: function ($scope) {
// titleMap will be list
$scope.titleMap = [{ value: "artan", name: "Artan" }, { value: "azalan", name: "Azalan" }];
$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"}];
......@@ -283,7 +288,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
$scope.$on('selectedUserTrigger', function ($event, data) {
var postToApi = {model: 'Personel', cmd: 'show', id: data[1]};
//postToApi[data[0]]=data[1];
$http.get(RESTURL.url + 'ara/personel/'+ data[1]).success(
$http.get(RESTURL.url + 'ara/personel/' + data[1]).success(
function (data) {
}
);
......@@ -519,6 +524,31 @@ app.directive('logout', function ($http, $location, RESTURL) {
$scope.selectedMenu = 'home';
}
};
})
.directive("fileread", function ($timeout) {
return {
scope: {
fileread: "="
},
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
var reader = new FileReader();
reader.onload = function (loadEvent) {
scope.$apply(function () {
scope.fileread = loadEvent.target.result;
});
$timeout(function () {
scope.$parent.model[changeEvent.target.name] = {
file_name: changeEvent.target.files[0].name,
file_content: scope.$parent.model[changeEvent.target.name]
}
});
}
reader.readAsDataURL(changeEvent.target.files[0]);
});
}
}
});
//app.directive('timeline', function () {
......
<div class="form-group {{form.htmlClass}} schema-form-select col-md-12"
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}">
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">
{{form.title}}
</label>
<div class="form-group input-group">
<input type="file"
ng-model="$$value$$"
fileread="$$value$$"
placeholder="dosya/imaj seçiniz"
ng-model-options="form.ngModelOptions"
ng-disabled="form.readonly"
sf-changed="form"
class="form-control {{form.fieldHtmlClass}}"
schema-validate="form"
name="{{form.name}}"/>
</div>
<div class="help-block" sf-message="form.description"></div>
</div>
\ No newline at end of file
<div class="tablescroll">
<table class="table table-bordered" style="background-color:#fff;">
<table class="table table-bordered" style="background-color:#fff;">
<thead>
<tr ng-if="node.schema.formType=='Node'">
<!--<th colspan="2">-->
......@@ -36,25 +36,33 @@
<!--<th scope="row" style="text-align:center">1</th>-->
<td ng-repeat="value in node.model track by $index">{{ value }}</td>
<td>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit">Düzenle</button><br>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit">Düzenle</button>
<br>
<button ng-click="remove(node, 'Node', $index)">Sil</button>
</td>
</tr>
<tr ng-repeat="listnodemodel in node.items track by $index" ng-if="node.schema.formType=='ListNode'">
<tr ng-repeat="listnodemodel in node.items track by $index" ng-init="outerIndex=$index" ng-if="node.schema.formType=='ListNode'">
<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">{{$index+1}}</th>
<td ng-repeat="(k, v) in listnodemodel track by $index" ng-if="k!=='idx'">{{ v.unicode || v }}</td>
<td ng-repeat="(k, v) in listnodemodel track by $index" ng-init="innerIndex=$index" ng-if="k!=='idx'">
<span ng-if="!node.schema.inline_edit || node.schema.inline_edit.indexOf(k) < 0">{{ v.unicode || v }}</span>
<input type="node.schema.formType" ng-if="node.schema.inline_edit.indexOf(k) > -1"
ng-model="node.model[outerIndex][k]"
ng-change="nodeModelChange(this)">
</td>
<td>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle</button><br>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle
</button>
<br>
<button ng-click="remove(node, 'ListNode', $index)">Sil</button>
</td>
</tr>
</tbody>
</table>
</table>
</div>
\ No newline at end of file
......@@ -206,6 +206,18 @@ angular.module('formService', ['ui.bootstrap'])
}
}
if (v.type === 'file') {
scope.form[scope.form.indexOf(k)] = {
type: "template",
title: v.title,
templateUrl: "shared/templates/filefield.html",
name: k,
key: k,
titleMap: v.titleMap
};
v.type = 'string';
}
if (v.type === 'select') {
scope.form[scope.form.indexOf(k)] = {
type: "template",
......@@ -217,7 +229,6 @@ angular.module('formService', ['ui.bootstrap'])
};
}
if (v.type === 'submit' || v.type === 'button') {
var buttonPositions = scope.modalElements ? scope.modalElements.buttonPositions : {
bottom: 'move-to-bottom',
......@@ -528,7 +539,6 @@ angular.module('formService', ['ui.bootstrap'])
}
if ((v.type === 'ListNode' || v.type === 'Node') && v.widget !== 'filter_interface') {
//if (v.type === 'ListNode' || v.type === 'Node') {
scope[v.type] = scope[v.type] || {};
......@@ -542,10 +552,15 @@ angular.module('formService', ['ui.bootstrap'])
title: v.title,
type: "object",
formType: v.type,
model_name: k
model_name: k,
inline_edit: scope.inline_edit
},
url: scope.url,
wf: scope.wf
wf: scope.wf,
nodeModelChange: function (item) {
debugger;
}
});
if (v.type === 'ListNode') {
......
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