Commit c247db93 authored by Evren Kutar's avatar Evren Kutar

generate dist

parent 299442f6
......@@ -82,7 +82,7 @@ module.exports = function (grunt) {
{expand: true, cwd: 'app/styles/images/', src: '*', dest: 'dist/css/images/', flatten: true},
{expand: true, cwd: 'app/bower_components/bootstrap/dist/fonts/', src: '*', dest: 'dist/fonts/', flatten: true, filter: 'isFile'},
{expand: true, cwd: 'app/bower_components/jquery/dist/', src: 'jquery.min.js', dest: 'dist/bower_components/', flatten: true, filter: 'isFile'},
{expand: true, cwd: 'app/bower_components/angular/', src: 'angular.min.js', dest: 'dist/bower_components/', flatten: true, filter: 'isFile'}
{expand: true, cwd: 'app/bower_components/angular/', src: 'angular.js', dest: 'dist/bower_components/', flatten: true, filter: 'isFile'}
]
},
local_prod: {
......@@ -124,6 +124,7 @@ module.exports = function (grunt) {
"app/zetalib/interceptors.js",
"app/zetalib/general.js",
"app/zetalib/form_service.js",
"app/zetalib/form_constraints.js",
"app/zetalib/error_service.js",
"app/zetalib/action_service.js",
"app/zetalib/socket.js",
......@@ -132,6 +133,7 @@ module.exports = function (grunt) {
"app/components/auth/auth_service.js",
"app/components/dashboard/dashboard_controller.js",
"app/components/crud/crud_controller.js",
"app/components/crud/crud_widgets.js",
"app/components/debug/debug_controller.js",
"app/components/devSettings/devSettings_controller.js",
"app/components/error_pages/error_controller.js",
......
......@@ -14,6 +14,7 @@ angular.module('ulakbus.crud')
* simply add an item to listnode searching related ulakbus model
* needs that keys in listnode schema:
* quick_add: true
* quick_add_view: <viewname>
* quick_add_model: <modelname>
* quick_add_field: to which field the data found will be added
* thanks u.u
......
......@@ -144,7 +144,7 @@
<!-- @if NODE_ENV == 'PRODUCTION' -->
<script src="bower_components/jquery.min.js"></script>
<script src="bower_components/jquery-ui.min.js"></script>
<script src="bower_components/angular.min.js"></script>
<script src="bower_components/angular.js"></script>
<script src="bower_components/components.js"></script>
<script src="shared/translations.js"></script>
<script src="templates.js"></script>
......
......@@ -68,7 +68,7 @@ angular.module('ulakbus')
$scope.groupNotifications = function (notifications) {
// $scope.notifications = {1: [], 2: [], 3: [], 4: []};
$scope.notifications = {1: [], 2: [], 3: [], 4: []};
angular.forEach(notifications, function (value, key) {
$scope.notifications[value.type].push(value);
......@@ -336,7 +336,7 @@ angular.module('ulakbus')
var newItems = {};
angular.forEach(items, function (value, key) {
newItems[value.kategori] = newItems[value.kategori] || [];
value['baseCategory'] = baseCategory;
// value['baseCategory'] = baseCategory;
newItems[value.kategori].push(value);
});
return newItems;
......
......@@ -26,7 +26,9 @@
class="form-control {{form.fieldHtmlClass}}"
schema-validate="form"
ng-options="item as item.name for item in form.filteredItems"
name="filterItems" multiple>
name="filterItems"
size=30 style="height: 60%;"
multiple>
</select>
</div>
......@@ -45,7 +47,9 @@
class="form-control {{form.fieldHtmlClass}}"
schema-validate="form"
ng-options="item as item.name for item in form.selectedFilteredItems"
name="selectedItems" multiple>
name="selectedItems"
size=30 style="height: 60%;"
multiple>
</select>
</div>
</div>
......
......@@ -7,7 +7,7 @@
* @author Evren Kutar
*/
angular.module('ulakbus')
.factory('FormConstraints', function ($q, $timeout) {
.factory('FormConstraints', function ($q, $log, $timeout) {
// Generic functions
/**
* gets expression and returns reject/resolve promise
......@@ -52,7 +52,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.lt = function (value, ref_val) {
fo_co.lt = function (value, ref_val, input_name) {
return cond(value > ref_val);
};
/**
......@@ -62,7 +62,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.lt_date = function (value, ref_val) {
fo_co.lt_date = function (value, ref_val, input_name) {
return cond(value > ref_val);
};
/**
......@@ -72,7 +72,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.ltm = function (value, ref_vals) {
fo_co.ltm = function (value, ref_vals, input_name) {
return cond_multiple(value, ref_vals, 'lt');
};
/**
......@@ -82,7 +82,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.gt = function (value, ref_val) {
fo_co.gt = function (value, ref_val, input_name) {
return cond(value < ref_val);
};
/**
......@@ -92,7 +92,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.gt_date = function (value, ref_val) {
fo_co.gt_date = function (value, ref_val, input_name) {
return cond(value < ref_val);
};
/**
......@@ -102,7 +102,7 @@ angular.module('ulakbus')
* @param type {String}
* @returns {Promise}
*/
fo_co.gtm = function (value, ref_vals) {
fo_co.gtm = function (value, ref_vals, input_name) {
return cond_multiple(value, ref_vals, 'gt');
};
/**
......@@ -111,15 +111,27 @@ angular.module('ulakbus')
* @param fields {Array} they must be schemaform schema property items
* @param type {String}
*/
fo_co.disable_fields = function (value, fields) {
$timeout(function () {
if (value.length > 0) {
// todo: test and make it work
fields.style = 'hidden';
fo_co.selectbox_fields = function (value, fields, input_name) {
// use disableErrorState to disable hidden field validations
var form_items = angular.element(document.querySelectorAll('bootstrap-decorator'));
angular.forEach(form_items, function (v, k) {
angular.element(v).removeClass('hide');
var checkpoint;
try{
if (angular.isDefined(v.querySelector('input')) && v.querySelector('input') !== null ) {
checkpoint = v.querySelector('input').name
} else {
fields.style = 'show';
checkpoint = v.querySelector('select').name;
}
if (checkpoint !== input_name[0] && checkpoint !== fields[value][0]) {
angular.element(v).addClass('hide');
$log.debug(checkpoint, fields[value], angular.isDefined(fields[checkpoint]));
}
})
} catch(e){
$log.error(e.message);
}
});
};
return fo_co;
});
\ No newline at end of file
......@@ -248,16 +248,16 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
validationMessage: {'form_cons': cons.val_msg},
$validators: {
form_cons: function (value) {
return FormConstraints[cons.cons](value, cons.val);
return FormConstraints[cons.cons](value, cons.val, v);
}
}
};
} else {
v.key = v.key;
v.validationMessage = angular.extend({'form_cons': cons.val_msg}, v.validationMessage);
v.$asyncValidators = angular.extend({
v.$validators = angular.extend({
form_cons: function (value) {
return FormConstraints[cons.cons](value, cons.val)
return FormConstraints[cons.cons](value, cons.val, v.key);
}
}, v.$asyncValidators);
}
......@@ -827,14 +827,15 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
// todo: delete after constraints done
scope.forms = scope.forms || {};
scope.forms.constraints = {
"erkek_kardes_sayisi": {
"cons": "ltm",
"val": ["kiz_kardes_sayisi"],
"val_msg": "Erkek kardes sayisi kiz kardes sayisindan az olamaz."
}
};
// scope.forms = scope.forms || {};
// scope.forms.constraints = {
// "cinsiyet": {
// "cons": "selectbox_fields",
// "val":
// {'1': ["kiz_kardes_sayisi"], '2': ["erkek_kardes_sayisi"]},
// "val_msg": "Erkek kardes sayisi kiz kardes sayisindan az olamaz."
// }
// };
angular.forEach(scope.schema.properties, function (v, k) {
// generically change _id fields model value
if ('form_params' in scope) {
......
......@@ -203,7 +203,6 @@ angular.module('ulakbus')
wsOps.loggedOut = true;
websocket.close();
$log.info("CLOSED");
delete websocket;
};
/**
* below elements used by togglePageReadyMask function
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -74,7 +74,7 @@
<script src="bower_components/jquery.min.js"></script>
<script src="bower_components/jquery-ui.min.js"></script>
<script src="bower_components/angular.min.js"></script>
<script src="bower_components/angular.js"></script>
<script src="bower_components/components.js"></script>
<script src="shared/translations.js"></script>
<script src="templates.js"></script>
......
......@@ -2871,7 +2871,9 @@ angular.module("shared/templates/multiselect.html", []).run(["$templateCache", f
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" ng-options=\"item as item.name for item in form.filteredItems\"\n" +
" name=\"filterItems\" multiple>\n" +
" name=\"filterItems\"\n" +
" size=30 style=\"height: 60%;\"\n" +
" multiple>\n" +
" </select>\n" +
" </div>\n" +
"\n" +
......@@ -2890,7 +2892,9 @@ angular.module("shared/templates/multiselect.html", []).run(["$templateCache", f
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" ng-options=\"item as item.name for item in form.selectedFilteredItems\"\n" +
" name=\"selectedItems\" multiple>\n" +
" name=\"selectedItems\"\n" +
" size=30 style=\"height: 60%;\"\n" +
" multiple>\n" +
" </select>\n" +
" </div>\n" +
" </div>\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