Commit 820fe3f4 authored by Evren Kutar's avatar Evren Kutar

version tag 0.6.1

resolves #58
resolves #54
parent 8becd820
0.6.0
\ No newline at end of file
0.6.1
\ No newline at end of file
......@@ -45,13 +45,13 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
id: scope.param_id || routeParams.param_id,
wf: routeParams.wf,
object_id: routeParams.key,
filters: []
filters: {}
};
if (scope.param_id) {
scope.form_params.filters.push({field: scope.param, values: [scope.param_id], type: 'check'});
scope.form_params.filters[scope.param] = {values: [scope.param_id], type: 'check'};
// do not use selected user, get and broadcast data of user in param_id
$rootScope.$broadcast('selectedUserTrigger', [scope.param, scope.param_id]);
//$rootScope.$broadcast('selectedUserTrigger', [scope.param, scope.param_id]);
}
scope.model = scope.form_params.model;
......@@ -277,26 +277,40 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}
})
.directive('crudFilters', function() {
.directive('crudFilters', function(Generator) {
return {
templateUrl: 'components/crud/templates/filter.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.filters = {};
angular.forEach($scope.listFilters, function (value, key) {
$scope.filters[value.field] = {field: value.field, values: [], type: value.type};
//if (value.type === 'date') {
// $scope.form_params.filters.push({field: value.field, values: [$scope.filterStartDate, $scope.filterEndDate], type: value.type});
//}
$scope.form_params.filters = $scope.form_params.filters || {};
$scope.filterList = {};
$scope.$watch('list_filters', function () {
angular.forEach($scope.list_filters, function (value, key) {
$scope.filterList[value.field] = {values: value.values || [], type: value.type};
});
});
$scope.filterStartDate;
$scope.filterEndDate;
$scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) {
this.status[which] = true;
};
$scope.format = 'dd.MM.yyyy'
$scope.format = 'dd.MM.yyyy';
$scope.filterSubmit = function () {
angular.forEach($scope.filterList, function (value, key) {
if (value.model) {
if (value.type === 'date') {
var dateValues = [null, null];
angular.forEach(value.model, function (v, k) {
dateValues[k] = Generator.dateformatter(v);
});
$scope.form_params.filters[key] = {values: dateValues, type: value.type};
} else {
$scope.form_params.filters[key] = {values: Object.keys(value.model), type: value.type || 'check'};
}
}
});
Generator.get_wf($scope);
}
}
};
})
......
......@@ -10,7 +10,8 @@
<div ng-if="filter.type==='check' || !filter.type">
<div class="checkbox" ng-repeat="filterItem in filter.values">
<label class="checkbox-inline">
<input type="checkbox" name="filter_group[]" value="{{filterItem.value}}"/>
<input type="checkbox" name="filter_group[]" ng-model="filterList[filter.field].model[filterItem.value]"
value="{{filterItem.value}}"/>
{{filterItem.name}}
</label>
</div>
......@@ -36,7 +37,8 @@
<i class="fa fa-calendar"></i>
</button>
</span>
<input type="text" name="startDate" class="form-control" ng-model="filterStartDate"
<input type="text" name="startDate" class="form-control"
ng-model="filterList[filter.field].model[0]"
uib-datepicker-popup="{{format}}"
is-open="status.startOpened"
close-text="Kapat"
......@@ -53,7 +55,8 @@
<i class="fa fa-calendar"></i>
</button>
</span>
<input type="text" name="endDate" class="form-control" ng-model="filterEndDate"
<input type="text" name="endDate" class="form-control"
ng-model="filterList[filter.field].model[1]"
uib-datepicker-popup="{{format}}"
is-open="status.endOpened"
close-text="Kapat"
......
......@@ -5,4 +5,4 @@ angular.module('ulakbus.version', [
'ulakbus.version.version-directive'
])
.value('version', '0.6.0');
.value('version', '0.6.1');
......@@ -5,7 +5,7 @@ describe('ulakbus.version module', function() {
describe('version service', function() {
it('should return current version', inject(function(version) {
expect(version).toEqual('0.6.0');
expect(version).toEqual('0.6.1');
}));
});
});
......@@ -66,6 +66,8 @@
</div>
</div>
<alert-box></alert-box>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-i18n/angular-locale_tr.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
......
......@@ -73,6 +73,8 @@
</div>
</div>
<alert-box></alert-box>
<!-- @if NODE_ENV == 'DEVELOPMENT' -->
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-i18n/angular-locale_tr.js"></script>
......
......@@ -473,6 +473,27 @@ app.directive('logout', function ($http, $location, RESTURL) {
};
})
/**
* alert directive
*/
.directive('alertBox', function ($timeout) {
return {
templateUrl: 'shared/templates/directives/alert.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.$on('alertBox', function ($event, data) {
$timeout(function () {
delete $scope.alerts;
}, 5000);
$scope.alerts = [data];
});
}
};
})
/**
* search directive in sidebar
*/
......
<div ng-repeat="alert in alerts" style="position: fixed; top:70px; right:20px; z-index: 999;">
<div class="alert" ng-class="{'info':'alert-info', 'error': 'alert-danger', 'warning': 'alert-warning'}[alert.type]">
<b>
{{alert.title}}
</b>
<p>{{alert.msg}}</p>
</div>
</div>
\ No newline at end of file
......@@ -15,69 +15,3 @@
</div>
</div>
</div>
\ No newline at end of file
<!--<div class="row">-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-primary">-->
<!--<div class="panel-heading">-->
<!--Primary Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-green">-->
<!--<div class="panel-heading">-->
<!--Success Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-yellow">-->
<!--<div class="panel-heading">-->
<!--Warning Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--<div class="row">-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-red">-->
<!--<div class="panel-heading">-->
<!--Danger Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--</div>-->
\ No newline at end of file
......@@ -18,7 +18,10 @@
<!--Hepsini Seç-->
<!--</label>-->
</th>
<th ng-repeat="(key,value) in node.items track by $index" ng-if="key!=='idx' && $index === 0">{{ value.verbose_name }}</th>
<th ng-repeat="(key,value) in node.items track by $index" ng-if="key!=='idx' && $index === 0">
<span ng-if="value.verbose_name">{{ value.verbose_name }}</span>
<span ng-if="!value.verbose_name">{{value[0].key}}</span>
</th>
<th>İşlem</th>
</tr>
</thead>
......
......@@ -866,14 +866,21 @@ angular.module('formService', ['ui.bootstrap'])
//}
}
});
} else {
reformattedModel[key] = {
"key": key,
"unicode": value
};
}
});
if (childmodel.edit) {
listNodeItem.model[childmodel.edit] = childmodel.model;
} else {
listNodeItem.model.push(angular.copy(childmodel.model));
if (reformattedModel !== {}) {
if (Object.keys(reformattedModel).length > 0) {
listNodeItem.items.push(reformattedModel);
} else {
listNodeItem.items.push(angular.copy(childmodel.model));
}
}
listNodeItem.lengthModels += 1;
......
......@@ -94,7 +94,7 @@ app.config(['$httpProvider', function ($httpProvider) {
rejection.status = 'Sunucu hatası'
rejection.data = {title: "", description : 'Sunucu bağlantısında bir hata oluştu.' +
'Lütfen yetkili personelle iletişime geçiniz.'};
errorModal();
$rootScope.$broadcast('alertBox', {title: rejection.status, msg: rejection.data.description, type: 'error'});
}
if (rejection.status === 400) {
......
This diff is collapsed.
......@@ -59,6 +59,8 @@
</div>
</div>
<alert-box></alert-box>
<script src="bower_components/jquery.min.js"></script>
<script src="bower_components/jquery-ui.min.js"></script>
......
This diff is collapsed.
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