Commit 5884f1b9 authored by Evren Kutar's avatar Evren Kutar

filter collapsable

syntax highlighting for exceptions
listnode and node table fix
remove listnode / node
some css edit
parent b2839048
0.6.1-img-fix-dist
\ No newline at end of file
0.6.2
\ No newline at end of file
......@@ -150,6 +150,12 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
$scope.formgenerated = event.targetScope.formgenerated;
});
// remove function removes node or listnode item from model data
$scope.remove = function (item, type, index) {
$scope[type][item.title].model.splice(index, 1);
$scope[type][item.title].items.splice(index, 1);
}
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
......@@ -285,11 +291,16 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
link: function ($scope) {
$scope.form_params.filters = $scope.form_params.filters || {};
$scope.filterList = {};
$scope.filterCollapsed = {};
$scope.$watch('list_filters', function () {
angular.forEach($scope.list_filters, function (value, key) {
$scope.filterList[value.field] = {values: value.values || [], type: value.type};
$scope.filterCollapsed[value.field] = Object.keys($scope.filterCollapsed).length > 0 ? true : false;
});
});
$scope.collapseFilter = function (field) {
$scope.filterCollapsed[field] = !$scope.filterCollapsed[field];
};
$scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) {
this.status[which] = true;
......@@ -313,52 +324,4 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}
}
};
})
.directive('dateFilter', function () {
return {
templateUrl: 'components/crud/templates/dateFilter.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.filterStartDate;
$scope.filterEndDate;
$scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) {
this.status[which] = true;
};
$scope.format = 'dd.MM.yyyy'
}
}
})
.directive('checkboxFilter', function () {
return {
templateUrl: 'components/crud/templates/dateFilter.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.filterStartDate;
$scope.filterEndDate;
$scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) {
this.status[which] = true;
};
$scope.format = 'dd.MM.yyyy'
}
}
})
.directive('selectFilter', function () {
return {
templateUrl: 'components/crud/templates/dateFilter.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.filterStartDate;
$scope.filterEndDate;
$scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) {
this.status[which] = true;
};
$scope.format = 'dd.MM.yyyy'
}
}
});
\ No newline at end of file
<div>
<h2>Filtrele</h2>
<div style="background: white;">
<h4>Filtrele</h4>
<hr>
<div ng-repeat="filter in list_filters">
<div>
<div class=" clearfix">
<h3>{{filter.verbose_name}}</h3>
<h5 ng-click="collapseFilter(filter.field)">{{filter.verbose_name}}
<i class="fa fa-fw fa-caret-down"></i></h5>
</div>
<div ng-if="filter.type==='check' || !filter.type">
<div ng-if="filter.type==='check' || !filter.type" uib-collapse="filterCollapsed[filter.field]">
<div class="checkbox" ng-repeat="filterItem in filter.values">
<label class="checkbox-inline">
<input type="checkbox" name="filter_group[]" ng-model="filterList[filter.field].model[filterItem.value]"
......@@ -17,7 +19,7 @@
</div>
</div>
<div ng-if="filter.type==='select'">
<div ng-if="filter.type==='select'" uib-collapse="filterCollapsed[filter.field]">
<div class="col-md-12">
<select name="filterSelect" id="filterSelect" class="form-control">
<option ng-repeat="filterItem in filter.values" value="{{filterItem.value}}">
......@@ -27,7 +29,7 @@
</div>
</div>
<div ng-if="filter.type==='date'">
<div ng-if="filter.type==='date'" uib-collapse="filterCollapsed[filter.field]">
<div class="col-md-12">
<label class="control-label" for="startDate">Başlangıç</label>
......
<div class="container">
<h1>{{ schema.title }}</h1>
<h3>{{ schema.title }}</h3>
<div class="buttons-on-top"></div>
......
<div class="starter-template container">
<div ng-repeat="obj in object">
<div class="info-block-header">
<h1>{{model}}</h1>
<h3>{{model}}</h3>
</div>
<div class="table-responsive">
<table class="table">
......
......@@ -5,4 +5,4 @@ angular.module('ulakbus.version', [
'ulakbus.version.version-directive'
])
.value('version', '0.6.1');
.value('version', '0.6.2');
......@@ -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.1');
expect(version).toEqual('0.6.2');
}));
});
});
......@@ -19,6 +19,7 @@
<link rel="stylesheet" href="app.css">
<link href="styles/roboto/roboto.css" rel="stylesheet">
<link href="styles/jquery-ui.min.css" rel="stylesheet">
<link href="styles/monokai-sublime.css" rel="stylesheet">
<link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" type="text/css">
......@@ -95,7 +96,7 @@
<script src="tmp/templates.js"></script>
<script src="app.js"></script>
<script src="app_routes.js"></script>
<!--<script src="shared/scripts/jquery-ui.min.js"></script>-->
<script src="shared/scripts/highlight.pack.js"></script>
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
<script src="zetalib/form_service.js"></script>
......
......@@ -20,6 +20,7 @@
<link rel="stylesheet" href="app.css">
<link href="styles/roboto/roboto.css" rel="stylesheet">
<link href="styles/jquery-ui.min.css" rel="stylesheet">
<link href="styles/monokai-sublime.css" rel="stylesheet">
<link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" type="text/css">
......@@ -103,7 +104,7 @@
<script src="tmp/templates.js"></script>
<script src="app.js"></script>
<script src="app_routes.js"></script>
<!--<script src="shared/scripts/jquery-ui.min.js"></script>-->
<script src="shared/scripts/highlight.pack.js"></script>
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
<script src="zetalib/form_service.js"></script>
......
This diff is collapsed.
......@@ -18,9 +18,9 @@
<!--Hepsini Seç-->
<!--</label>-->
</th>
<th ng-repeat="(key,value) in node.items track by $index" ng-if="key!=='idx' && $index === 0">
<th ng-repeat="(key,value) in node.items[0] track by $index" ng-if="key!=='idx'">
<span ng-if="value.verbose_name">{{ value.verbose_name }}</span>
<span ng-if="!value.verbose_name">{{value[0].key}}</span>
<span ng-if="!value.verbose_name">{{key}}</span>
</th>
<th>İşlem</th>
</tr>
......@@ -37,7 +37,7 @@
<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 ng-click="remove(node)">Sil</button>
<button ng-click="remove(node, 'Node', $index)">Sil</button>
</td>
</tr>
......@@ -48,10 +48,10 @@
<!--</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 }}</td>
<td ng-repeat="(k, v) in listnodemodel track by $index" ng-if="k!=='idx'">{{ v.unicode || v }}</td>
<td>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle</button><br>
<button ng-click="remove(listnodemodel)">Sil</button>
<button ng-click="remove(node, 'ListNode', $index)">Sil</button>
</td>
</tr>
......
/*
Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #23241f;
}
.hljs,
.hljs-tag,
.hljs-subst {
color: #f8f8f2;
}
.hljs-strong,
.hljs-emphasis {
color: #a8a8a2;
}
.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
color: #ae81ff;
}
.hljs-code,
.hljs-title,
.hljs-section,
.hljs-selector-class {
color: #a6e22e;
}
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-attr {
color: #f92672;
}
.hljs-symbol,
.hljs-attribute {
color: #66d9ef;
}
.hljs-params,
.hljs-class .hljs-title {
color: #f8f8f2;
}
.hljs-string,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-variable {
color: #e6db74;
}
.hljs-comment,
.hljs-deletion,
.hljs-meta {
color: #75715e;
}
......@@ -875,6 +875,11 @@ angular.module('formService', ['ui.bootstrap'])
});
if (childmodel.edit) {
listNodeItem.model[childmodel.edit] = childmodel.model;
if (Object.keys(reformattedModel).length > 0) {
listNodeItem.items[childmodel.edit] = reformattedModel;
} else {
listNodeItem.items[childmodel.edit] = angular.copy(childmodel.model);
}
} else {
listNodeItem.model.push(angular.copy(childmodel.model));
if (Object.keys(reformattedModel).length > 0) {
......
......@@ -11,7 +11,7 @@ app.config(['$httpProvider', function ($httpProvider) {
* the interceptor for all requests to check response
* 4xx - 5xx errors will be handled here
*/
$httpProvider.interceptors.push(function ($q, $rootScope, $location, $timeout) {
$httpProvider.interceptors.push(function ($q, $rootScope, $location, $timeout, $log) {
return {
'request': function (config) {
if (config.method === "POST") {
......@@ -54,7 +54,7 @@ app.config(['$httpProvider', function ($httpProvider) {
var errorModal = function () {
if ($rootScope.loginAttempt === 0) {
console.log('not logged in, no alert message triggered');
$log.debug('not logged in, no alert message triggered');
return;
}
var codefield = "";
......@@ -88,6 +88,14 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>' +
'</div>' +
'</div>').modal();
try {
$('pre:not(.hljs)').each(function(i, block) {
hljs.highlightBlock(block);
});
}
catch (e) {
$log.debug('Exception: ', e.message);
}
};
if (rejection.status === -1) {
......@@ -103,7 +111,7 @@ app.config(['$httpProvider', function ($httpProvider) {
if (rejection.status === 401) {
$location.path('/login');
if ($location.path() === "/login") {
console.log("show errors on login form");
$log.debug("show errors on login form");
}
}
if (rejection.status === 403) {
......
This diff is collapsed.
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