Commit a705f5c2 authored by Evren Kutar's avatar Evren Kutar

Merge branch 'bugfix/5239' into develop-merge-5239

parents b29a0bdb 1edbba27
<div ng-app="ulakbus.dashboard" class="dashboard academician-dashboard">
<div class="starter-template">
<!--<user-tasks></user-tasks>-->
<ng-include src="'components/dashboard/user-templates/student.html'" ng-if="$root.current_user.is_student"></ng-include>
<ng-include src="'components/dashboard/user-templates/staff.html'" ng-if="!$root.current_user.is_student"></ng-include>
<ng-include src="'components/dashboard/user-templates/academician.html'" ng-if="$root.current_user.is_staff && $root.current_user.is_academic"></ng-include>
......
......@@ -384,7 +384,7 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
var formitem = scope.form[scope.form.indexOf(k)];
var modelScope = {
"form_params": {
wf: v.wf || scope.wf,
wf: v.wf || scope.wf || scope.form_params.wf,
model: v.model_name || v.schema[0].model_name,
cmd: v.list_cmd || 'select_list',
query: ''
......@@ -568,13 +568,11 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
status: {opened: false},
open: function ($event) {
this.status.opened = true;
scope.model[k] = Moment(scope.model[k], "DD.MM.YYYY").toDate();
},
format: 'dd.MM.yyyy',
onSelect: function () {
var tempDate = angular.copy(scope.model[k]);
tempDate = Date.parse(tempDate, "dd.MM.yyyy");
scope.model[k] = tempDate;
//scope.model[k] = angular.copy(generator.dateformatter(scope.model[k]));
scope.model[k] = angular.copy(generator.dateformatter(scope.model[k]));
}
};
}
......
......@@ -25,7 +25,7 @@ angular.module('ulakbus')
/**
* WSOps operates all websocket interactions
*/
.factory('WSOps', function (WSUri, $q, $log, $rootScope, $timeout, ErrorService, WS, IsOnline) {
.factory('WSOps', function (WSUri, $q, $log, $rootScope, $timeout, $document, ErrorService, WS, IsOnline) {
$rootScope.$on('ws_turn_on', function () {
generate_ws();
});
......@@ -137,6 +137,9 @@ angular.module('ulakbus')
};
// do_action is the dispatcher function for incoming events
var do_action = function (options) {
// remove mask from crud here
togglePageReadyMask(0);
$log.info("togglePageReadyMask off");
var args = [].slice.call(arguments, 0),
initialized = false,
action = 'init';
......@@ -170,6 +173,9 @@ angular.module('ulakbus')
wsOps.callbacks[request.callbackID] = deferred;
websocket.send(angular.toJson(request));
$log.info('SENT:', data);
togglePageReadyMask(1);
$log.info("togglePageReadyMask on");
//
// todo: add success & error promises
return deferred.promise.then(function (response) {
request.response = response;
......@@ -191,5 +197,28 @@ angular.module('ulakbus')
delete websocket;
};
var pageReady;
var mask = angular.element('<div class="body-mask"><div class="loader"></div>' +
'</div>');
mask.css({zIndex: '2010', opacity: '0.6'});
var body = $document.find('body').eq(0);
var togglePageReadyMask = function (st) {
var toggle = [
function () {
if (pageReady === 0) {return;}
$timeout(function () {
mask.remove();
pageReady = 0;
}, 1000);
},
function () {
if (pageReady === 1) {return;}
body.append(mask);
pageReady = 1;
}
];
toggle[st]();
};
return wsOps;
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -463,7 +463,7 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
$templateCache.put("components/dashboard/dashboard.html",
"<div ng-app=\"ulakbus.dashboard\" class=\"dashboard academician-dashboard\">\n" +
" <div class=\"starter-template\">\n" +
" <user-tasks></user-tasks>\n" +
" <!--<user-tasks></user-tasks>-->\n" +
" <ng-include src=\"'components/dashboard/user-templates/student.html'\" ng-if=\"$root.current_user.is_student\"></ng-include>\n" +
" <ng-include src=\"'components/dashboard/user-templates/staff.html'\" ng-if=\"!$root.current_user.is_student\"></ng-include>\n" +
" <ng-include src=\"'components/dashboard/user-templates/academician.html'\" ng-if=\"$root.current_user.is_staff && $root.current_user.is_academic\"></ng-include>\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