r3014 - in branches/ng-jtimer/src/main: resources webapp/css webapp/js webapp/partials
Author: obruce Date: 2014-07-11 10:01:54 +0200 (Fri, 11 Jul 2014) New Revision: 3014 Url: http://forge.chorem.org/projects/jtimer/repository/revisions/3014 Log: version avec onglet encore ?\195?\160 travailler Added: branches/ng-jtimer/src/main/webapp/partials/loading_timer.gif branches/ng-jtimer/src/main/webapp/partials/optionModal.html branches/ng-jtimer/src/main/webapp/partials/task.html branches/ng-jtimer/src/main/webapp/partials/timesModal.html Modified: branches/ng-jtimer/src/main/resources/jtimer-default.properties branches/ng-jtimer/src/main/webapp/css/app.css branches/ng-jtimer/src/main/webapp/js/controllers.js branches/ng-jtimer/src/main/webapp/js/entities.js branches/ng-jtimer/src/main/webapp/partials/alertModal.html branches/ng-jtimer/src/main/webapp/partials/tasks.html branches/ng-jtimer/src/main/webapp/partials/timeModal.html Modified: branches/ng-jtimer/src/main/resources/jtimer-default.properties =================================================================== --- branches/ng-jtimer/src/main/resources/jtimer-default.properties 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/resources/jtimer-default.properties 2014-07-11 08:01:54 UTC (rev 3014) @@ -102,6 +102,15 @@ jtimer.storage.select.alarm.fortask= SELECT * \ FROM taskalarm \ WHERE removed = 0 AND modificationDate > ? AND taskId = ? +jtimer.storage.select.report.week.timedtasks=SELECT TA.* , sum(TI.duration) AS totalduration \ + FROM task TA, tasktime TI \ + WHERE TA.taskId = TI.taskid \ + AND TA.creationDate > ? \ + AND TA.creationDate < ? \ + AND TA.removed = 0 \ + GROUP BY TA.taskId \ + ORDER BY TA.creationDate DESC, WEEK(TA.creationDate) + ### #DELETE jtimer.storage.delete.time.withid=DELETE FROM tasktime WHERE uuid = ? Modified: branches/ng-jtimer/src/main/webapp/css/app.css =================================================================== --- branches/ng-jtimer/src/main/webapp/css/app.css 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/css/app.css 2014-07-11 08:01:54 UTC (rev 3014) @@ -14,6 +14,7 @@ background:black; color:graytext; } + div#alerts{ position:absolute; bottom:20px; @@ -21,6 +22,16 @@ width:100%; z-index: 1000; } +div#descriptionTaskTab{ + position:absolute; + bottom:20px; + left:0; + width:100%; + z-index: 70; + + background:#BDBDBD; +} + .alert { margin-bottom: 0; } @@ -36,21 +47,21 @@ background:black; color:graytext; } -#footer>.left, #header>.left { +#footer>.left, #header>.left{ text-align: left; position: absolute; left: 0px; top: 0px; z-index: 10; } -#footer>.center, #header>.center { +#footer>.center, #header>.center{ width: 100%; height: 100%; text-align: center; display: block; z-index: 5; } -#footer>.right, #header>.right { +#footer>.right, #header>.right{ text-align: right; position: absolute; right: 0px; @@ -58,6 +69,32 @@ z-index: 10; } +div#modalheader{ + top:10px; + display : block; + left:10px; + width:100%; +} + +#modalheader>.left { + display : inline-block; + text-align: left; + left: 0px; +} + + #modalheader>.right { + text-align: left; + display : inline-block; + + right: 0px; + +} + +.modalDesc{ + top: 20 px; + bottom : 10px; +} + .menu-show { display: block; left: -170px @@ -74,9 +111,7 @@ position:fixed; } } -* html body{ - overflow:hidden; -} + * html div#content{ height:100%; overflow:auto; @@ -119,16 +154,16 @@ .spacer.level9 {padding-left: 90px;} .th.name { - + width: 30em; } .th.today, .td.today, .th.global, .td.global { - width: 4em; + width: 5em; border-right: 1px #0088cc solid; } -.td.today, .td.global { - text-align: right; +.td.today, .td.global{ + text-align: center; } .th.tags { @@ -238,11 +273,94 @@ } .selected-row { - background-color: #5ca9cf; + background-color: #BCD1E5; + + -moz-transition-property: background-color; + -webkit-transition-property: background-color; + -o-transition-property: background-color; + -ms-transition-property: background-color; + transition-property: background-color; + + + -moz-transition-duration:3s; + -webkit-transition-duration:3s; + -o-transition-duration:3s; + -ms-transition-duration:3s; + transition-duration:3s; + } +.no-alarm { + background-color: none; + + -moz-transition-property: background-color; + -webkit-transition-property: background-color; + -o-transition-property: background-color; + -ms-transition-property: background-color; + transition-property: background-color; + + + -moz-transition-duration:3s; + -webkit-transition-duration:3s; + -o-transition-duration:3s; + -ms-transition-duration:3s; + transition-duration:3s; +} + +.alarmOk{ + background-color: #99FF99; + + -moz-transition-property: background-color; + -webkit-transition-property: background-color; + -o-transition-property: background-color; + -ms-transition-property: background-color; + transition-property: background-color; + + + -moz-transition-duration:3s; + -webkit-transition-duration:3s; + -o-transition-duration:3s; + -ms-transition-duration:3s; + transition-duration:3s; +} + +.alarmInter{ + background-color: #FFCC66; + + -moz-transition-property: background-color; + -webkit-transition-property: background-color; + -o-transition-property: background-color; + -ms-transition-property: background-color; + transition-property: background-color; + + + -moz-transition-duration:3s; + -webkit-transition-duration:3s; + -o-transition-duration:3s; + -ms-transition-duration:3s; + transition-duration:3s; +} + +.alarmDanger{ + background-color: #FF0000; + + -moz-transition-property: background-color; + -webkit-transition-property: background-color; + -o-transition-property: background-color; + -ms-transition-property: background-color; + transition-property: background-color; + + + -moz-transition-duration:3s; + -webkit-transition-duration:3s; + -o-transition-duration:3s; + -ms-transition-duration:3s; + transition-duration:3s; +} + + .tr:hover { - background-color: #7ecbef; + background-color: #E8E8E8; } .online { @@ -275,9 +393,27 @@ } .color_red{ - color : red; + color : #FA5858; } .color_green{ color : green; +} + +.paded{ + padding-left: 10px; +} + +.divYScrolable { + overflow-y:scroll; + height:200px; + width:250px; +} + +.rowYScrolable:hover { + background-color: #E8E8E8; +} + +.borderedbottom{ + border-bottom : 1px solid #E8E8E8; } \ No newline at end of file Modified: branches/ng-jtimer/src/main/webapp/js/controllers.js =================================================================== --- branches/ng-jtimer/src/main/webapp/js/controllers.js 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/js/controllers.js 2014-07-11 08:01:54 UTC (rev 3014) @@ -12,6 +12,9 @@ $scope.taskAccess = $scope.todo.lastTaskAccess; $scope.timeAccess = $scope.todo.lastTimeAccess; + // + $scope.currentTaskAlarmState="no-alarm"; + //interval de conec var interval = 30000; //TODO: obruce 05-05-14 decider d'un intervalle interessant // periode de delais = 3 periode +1msec @@ -144,19 +147,19 @@ /** * Methode qui se lance toutes les minutes pour verifier les alamres des taches */ - var checkAlarms = function() { - $timeout(function() { + var checkAlarms = function(delay) { + $interval(function() { if ($scope.currentTask) { checkRecurseParent($scope.currentTask); } - checkAlarms(); - }, 60000); + checkAlarms(0); + }, 60000-delay); }; - checkAlarms(); + /** * * @param :task la tache @@ -183,12 +186,30 @@ alarm.remainingHour -=1; } + + var limit = alarm.limitHour*60 + alarm.limitMin; + var remaining = alarm.remainingHour*60 + alarm.remainingMin; + + res = ((limit-remaining)/limit)*100; + + if(res < 50 ){ + $scope.currentTaskAlarmState="alarmOk"; + }else if(res < 80){ + $scope.currentTaskAlarmState="alarmInter"; + }else{ + $scope.currentTaskAlarmState="alarmDanger"; + } + + if(alarm.remainingHour == 0 && alarm.remainingMin == 0){ //console.log("Alarme lancée " +alarm.name +" de type "+ alarm.type + " par " + task.name ); if(alarm.type=="Total_Time"){ alarms.splice(index,1); } - alert('Alarme déclenchée: '+alarm.name + '\nVotre alarme va être désactivée.'); + $window.alert('Alarme déclenchée: '+alarm.name + '\nVotre alarme va être désactivée.'); + + $scope.currentTaskAlarmState="no-alarm"; + } index+=1; }); @@ -209,6 +230,8 @@ updateTasksFromServ(); updateTimesFromServer(); }, interval); + + }; timer(); @@ -221,7 +244,7 @@ serverTaskAccess.query({date : 0}, function (response) { angular.forEach(response, function (item) { - console.log(response); + //console.log(response); if((!(item.taskId in $scope.data.tasks)) && item.removed == 0){ console.log( "Un element non present " + item.name + item.modificationDate); @@ -320,6 +343,8 @@ save(); } + + getAlarmsFromServerWithTask(newTask); } }); }); @@ -340,7 +365,7 @@ angular.forEach(response, function (item) { - var editedTime = getObjectInArrayWithId($scope.data.times[item.taskId],item.timeId); + var editedTime = getTimeInArrayWithId($scope.data.times[item.taskId],item.timeId); if(editedTime){ if(item.removed == 0){ @@ -417,7 +442,18 @@ return res; } + //Recuperer un element dans un array avec son id + var getAlarmInArrayWithId= function(array, id){ + var res; + angular.forEach(array, function(alarm){ + if(alarm.alarmId == id){ + res = time; + } + }); + return res; + } + //Recuperer un element dans un array avec son id var suppressObjectInArrayWithId= function(array, timeid,taskid){ var res=0; @@ -803,66 +839,6 @@ save(); }; - /** Methode qui va tenter d'envoyer la tâche vers le serveur */ - $scope.alarmPopup = function(node){ - - var modalInstance = $modal.open({ - templateUrl: 'partials/alertModal.html', - controller: AlertModalInstanceCtrl, - resolve: { - task : function(){ - return node.task; - }, - totaltime : function(){ - var res=0; - - - var recChildren = function(noeud){ - angular.forEach($scope.data.times[noeud.task.taskId], function(t){ - res+=t.time; - }); - - if(noeud.children){ - angular.forEach(noeud.children, function(child){ - recChildren(child); - }); - } - - } - recChildren(node); - - console.log(res); - return res; - }, - todaytime : function(){ - var res=0; - - var recChildren = function(noeud){ - angular.forEach($scope.data.times[noeud.task.taskId], function(t){ - if(t.isToday()){ - res+=t.time; - } - }); - - if(noeud.children){ - angular.forEach(noeud.children, function(child){ - recChildren(child); - }); - } - - } - recChildren(node); - - console.log(res); - return res; - } - } - }); - - modalInstance.result.then(function (item) { - }); - } - /** * Active/desactive le comptage de temps pour une tache * @param {type} task @@ -892,7 +868,10 @@ $scope.currentTask = task; $scope.currentTaskDate = now; + checkAlarms(0); + } else { + $interval.cancel(checkAlarms); $scope.currentTask = null; $scope.currentTaskDate = null; @@ -918,6 +897,9 @@ $scope.webSocketClientOnline = status; } }); + $scope.showWebsocketAlert= function(){ + $scope.webSocketClientOnline = "nada"; + } /** Idleness*/ @@ -977,14 +959,133 @@ $scope.webSocketClientIdle = false; }; - $scope.popup = function (node){ + $scope.optionPopup = function (node, isRoot){ //Task identifier var id = node.task.taskId; var data; var modalInstance = $modal.open({ + templateUrl: 'partials/optionModal.html', + controller: OptionModalCtrl, + resolve: { + taskTimes : function () { + return angular.copy($scope.data); + }, + indent : function () { + return id; + }, + selectTask : function () { + return node.task; + }, + totaltime : function(){ + var res=0; + + + var recChildren = function(noeud){ + angular.forEach($scope.data.times[noeud.task.taskId], function(t){ + res+=t.time; + }); + + if(noeud.children){ + angular.forEach(noeud.children, function(child){ + recChildren(child); + }); + } + + } + recChildren(node); + + return res; + }, + todaytime : function(){ + var res=0; + + var recChildren = function(noeud){ + angular.forEach($scope.data.times[noeud.task.taskId], function(t){ + if(t.isToday()){ + res+=t.time; + } + }); + + if(noeud.children){ + angular.forEach(noeud.children, function(child){ + recChildren(child); + }); + } + + } + recChildren(node); + + return res; + }, + disabled : function(){ + return isRoot; + }, + todo : function(){ + return $scope.todo; + } + } + + }); + + modalInstance.result.then(function (item) { + + if(item.index != -1){ + if(item.action=='Modification'){ + //On met la valeur à jour + + $scope.data.times[id][item.index].changeCreationDate(item.creationDate); + $scope.data.times[id][item.index].changeDuration(item.time); + + //init + if(!$scope.todo.stockedEditedTimes[id]){$scope.todo.stockedEditedTimes[id]=[]; } + + //On ajoute dans la tdList + $scope.todo.stockedEditedTimes[id].push($scope.data.times[id][item.index]); + + save(); + } + + if(item.action=='Ajout'){ + //init + + if(!$scope.data.times[id]){$scope.data.times[id]= [];}; + if(!$scope.todo.stockedNewTimes[id]){$scope.todo.stockedNewTimes[id] = []}; + + //on cree le temps + var res = new TaskTime(node.task,undefined,item.creationDate,item.time); + $scope.data.times[id].push(res); + $scope.todo.stockedNewTimes[id].push(res); + save(); + } + + if(item.action == 'Suppression'){ + // init de l'objet + if(!$scope.todo.stockedDeletedTimes[id]){ + $scope.todo.stockedDeletedTimes[id] = [] + }; + //on pousse l'objet à supprimer + $scope.todo.stockedDeletedTimes[id].push($scope.data.times[id][item.index].timeId); + + $scope.data.times[id].splice(item.index,1); + if($scope.data.times[id]==[]){ + delete $scope.data.times[id]; + } + save(); + } + data = $scope.data.times; + } + }); + } + + $scope.popupTime = function (node){ + //Task identifier + var id = node.task.taskId; + var data; + + var modalInstance = $modal.open({ templateUrl: 'partials/timeModal.html', - controller: ModalInstanceCtrl, + controller: TimeModalCtrl, resolve: { taskTimes : function () { return angular.copy($scope.data); @@ -1086,9 +1187,44 @@ +/** + * Controller de pour la modal d'option de tache. + * + * @param $scope + * @param $modalInstance + */ +function OptionModalCtrl($scope, $modalInstance, serverAlarmAccess, taskTimes, indent, selectTask , totaltime, todaytime, disabled,todo) { + $scope.taskTimes = taskTimes; + $scope.indent = indent; + $scope.task = selectTask; + $scope.totaltime = totaltime; + $scope.todaytime = todaytime; + $scope.disabled = disabled; + $scope.todo=todo; + $scope.obj={}; + $scope.close = function() { + todo.stockedEditedTasks.push($scope.task); + + $modalInstance.close($scope.obj); + }; +} + + /** + * Controller de pour la modal d'option de tache. + * + * @param $scope + * @param $modalInstance + */ +function TaskModalCtrl($scope) { + + + +} + +/** * Controller de pour la modal d'inactivite. * * @param $scope @@ -1100,10 +1236,11 @@ }; } -function AlertModalInstanceCtrl($scope, $modalInstance, serverAlarmAccess, task, totaltime, todaytime){ +function AlertModalInstanceCtrl($scope,serverAlarmAccess){ + task = $scope.task; + totaltime = $scope.totaltime; + todaytime = $scope.todaytime; - console.log(totaltime +" " +todaytime) - $scope.alarm={name : "" , type : "Type"}; var msToHour=function(ms){ @@ -1180,11 +1317,35 @@ if($scope.alarm.name== "" || $scope.alarm.type=="Type" ){ }else{ + var min=$scope.alarm.min; + var hour=$scope.alarm.hour; if($scope.alarm.type=="Total_Time"){ - minusPreviousTime(totaltime, $scope.alarm.hour, $scope.alarm.min); + var prevHour = parseInt(msToHour(totaltime)); + var prevMin = parseInt(msToMin(totaltime)); + + hour-=prevHour; + + if(min - prevMin<0){ + min = 59 +(min-prevMin); + hour -=1; + }else{ + min =min - prevMin; + } + console.log("hm " +hour +" " +min); }else{ - minusPreviousTime(todaytime, $scope.alarm.hour, $scope.alarm.min); + var prevHour = parseInt(msToHour(todaytime)); + var prevMin = parseInt(msToMin(todaytime)); + + hour-=prevHour; + + if(min - prevMin<0){ + min = 59 +(min-prevMin); + hour -=1; + }else{ + min =min - prevMin; + } + console.log("hm " +hour +" " +min); } if($scope.alarm.hour > 0 || $scope.alarm.min> 0 ){ @@ -1193,7 +1354,9 @@ $scope.alarm.name, $scope.alarm.type, $scope.alarm.hour, - $scope.alarm.min); + $scope.alarm.min, + hour, + min); $scope.alarms.push(al); @@ -1214,21 +1377,10 @@ } } - var minusPreviousTime= function(previousTime, hour, min){ - var prevHour = msToHour(previousTime); - var prevMin = msToMin(previousTime); - hour-=prevHour; - if(min - prevMin<0){ - min = 59 +(min-prevMin); - hour -=1; - } - } - - $scope.close = function() { $modalInstance.close(); @@ -1358,14 +1510,13 @@ }; } -function ModalInstanceCtrl($scope, $modalInstance, taskTimes,indent) { +function TimeModalCtrl($scope) { // Les temps de la tache - $scope.times = taskTimes.times[indent]; + $scope.times = $scope.taskTimes.times[$scope.indent]; $scope.dateobj={aTime : new Date(), date : new Date(),}; //L'objet retourner - $scope.obj={}; $scope.obj.creationDate=new Date().getTime(); $scope.obj.time=0; $scope.obj.index = -1; @@ -1384,7 +1535,8 @@ //Pour l'affichage $scope.getStartTime = function(item){return moment(item.creationDate).format("DD-MM-YYYY H:mm:ss");} - $scope.getStopTime = function(item){return item.time;} + $scope.getStopTime = function(item){return moment(item.creationDate + item.time).format("DD-MM-YYYY H:mm:ss");} + $scope.getDuration = function(item){return item.time;} $scope.getStartObjTime = function(){return moment($scope.obj.creationDate).format("DD-MM-YYYY H:mm:ss");} $scope.getStopObjTime = function(){return moment($scope.obj.creationDate + $scope.obj.time).format("DD-MM-YYYY H:mm:ss");} @@ -1415,6 +1567,92 @@ }; + +function TimesModalCtrl($scope) { + + $scope.dateobj={date : new Date(), today : new Date()}; + + $scope.selectedItem=null; + + //TODO if different de new date .startPeriod .endPeriod + + //Le pas des heures et minutes + $scope.hstep = 1; + $scope.mstep = 1; + + + //L'objet retourner + $scope.obj.creationDate=new Date().getTime(); + $scope.obj.time=0; + $scope.obj.index = -1; + $scope.obj.action = ''; + + //Pour l'affichage + $scope.getStartTime = function(item){return moment(item.creationDate).format("H:mm:ss");} + $scope.getStopTime = function(item){return moment(item.creationDate + item.time).format("H:mm:ss");} + $scope.getDuration = function(item){return item.time;} + + //selectionne un element dans le dropdown + $scope.select = function(item, ind){ + + //On intialise l'objet a envoyer + $scope.obj.index = ind; + $scope.obj.creationDate=item.creationDate; + $scope.obj.time=item.time; + + $scope.selectedItem = item; + + $scope.dateobj.startPeriod = item.creationDate; + $scope.dateobj.endPeriod = item.creationDate + item.time; + }; + + + $scope.removeTime = function(ind, item){ + if(!$scope.todo.stockedDeletedTimes[item.taskId]){ + $scope.todo.stockedDeletedTimes[item.taskId] = [] + }; + //on pousse l'objet à supprimer + $scope.todo.stockedDeletedTimes[item.taskId].push(item); + + cpt=0; + angular.forEach($scope.taskTimes.times[$scope.indent], function(time){ + if(time.timeId == item.timeId){ + $scope.taskTimes.times[$scope.indent].splice(cpt,1); + } + cpt++; + }); + $scope.changeDate(); + + }; + + $scope.changeDate= function(){ + $scope.selectedItem = null; + + var endday = angular.copy($scope.dateobj.date); + var startday = angular.copy($scope.dateobj.date); + + endday.setHours(23,59,59,999); + startday.setHours(0,0,0,0); + + console.log($scope.dateobj.end ); + + $scope.times=[]; + + // Les temps de la tache + angular.forEach($scope.taskTimes.times[$scope.indent],function(time){ + if(time.creationDate> startday.getTime() && + time.creationDate< endday.getTime()){ + $scope.times.push(time); + console.log("pusssh"); + } + }); + }; + $scope.changeDate(); + +}; + + + function DatePickerCtrl($scope){ $scope.dateMaxPicker= new Date(); @@ -1432,11 +1670,41 @@ $scope.dateobj.aTime = uneDate; }; -} +}; +function alarmProgressBarCtrl($scope){ + $scope.dynamicProgressBar = function(alarm){ + var res = 0; + var limit = alarm.limitHour*60 + alarm.limitMin; + var remaining = alarm.remainingHour*60 + alarm.remainingMin; + res = ((limit-remaining)/limit)*100; + + return res; + }; + +}; + +function TimePickerOptionModalCtrl($scope){ + + //Activated button radio + $scope.radioModel = 'Left'; + + //Le pas des heures et minutes + $scope.hstep = 1; + $scope.mstep = 1; + + /* + * Méthode déclancher quand l'heure change dans le timepicker + * Change l'objet du controller principal + */ + $scope.changeModel = function(){ + + } +}; + function RadioTimeCtrl($scope){ //Activated button radio Modified: branches/ng-jtimer/src/main/webapp/js/entities.js =================================================================== --- branches/ng-jtimer/src/main/webapp/js/entities.js 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/js/entities.js 2014-07-11 08:01:54 UTC (rev 3014) @@ -528,7 +528,7 @@ * @param {Task} task la tache liee * @returns {TaskAlarm} */ -var TaskAlarm = function (task,id, name, type, limitHour,limitMin, repeatF) { +var TaskAlarm = function (task,id, name, type, limitHour,limitMin, remainingHour, remainingMin,repeatF) { this.taskId = task && task.taskId; if(id == undefined){ @@ -544,8 +544,8 @@ this.limitHour = limitHour; this.limitMin = limitMin; - this.remainingHour = limitHour; - this.remainingMin = limitMin; + this.remainingHour = remainingHour; + this.remainingMin = remainingMin; this.modificationDate = Date.now(); Modified: branches/ng-jtimer/src/main/webapp/partials/alertModal.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/alertModal.html 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/partials/alertModal.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -1,7 +1,4 @@ -<h3>Les alarmes pour {{name}} :</h3> -<hr/> - <table class='table'> <thead> <tr> @@ -42,12 +39,12 @@ <i class="glyphicon glyphicon-check color_green" ng-show="alarm.name!=''"> </i></td> <td> <div class="btn-group" dropdown is-open="status.isopen"> - <button type="button" class="btn btn-primary dropdown-toggle"> + <button type="button" class="btn btn-default btn-sm dropdown-toggle"> {{alarm.type}} <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> - <li ng-click="dropdownType1()">Total_Day_Time</li> - <li ng-click="dropdownType2()">Total_Time</li> + <li ng-click="dropdownType1()">Total day time</li> + <li ng-click="dropdownType2()">Total task time</li> </ul> </div> <i class="glyphicon glyphicon-edit color_red" ng-show="alarm.type=='Type'"> </i> @@ -74,8 +71,9 @@ </table> - +<!-- <div class="modal-footer"> - <!--<button class="btn btn-primary" ng-click="cancel()">Cancel</button>--> - <button class="btn btn-primary" ng-click="close()">Close</button> + <button class="btn btn-default btn-sm" ng-click="cancel()">Cancel</button> + <button class="btn btn-default btn-sm" ng-click="close()">Close</button> </div> +--> \ No newline at end of file Added: branches/ng-jtimer/src/main/webapp/partials/loading_timer.gif =================================================================== (Binary files differ) Property changes on: branches/ng-jtimer/src/main/webapp/partials/loading_timer.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/ng-jtimer/src/main/webapp/partials/optionModal.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/optionModal.html (rev 0) +++ branches/ng-jtimer/src/main/webapp/partials/optionModal.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -0,0 +1,29 @@ +<tabset justified="true"> + <!--tasks--> + <tab heading="Task"> + <div ng-controller="TaskModalCtrl" ng-include="'./partials/task.html'"></div> + </tab> + + <!--Times--> + <tab disabled="disabled"> + <tab-heading > + <i class="glyphicon glyphicon-time"></i> Times + </tab-heading> + <div ng-controller="TimesModalCtrl" ><div ng-include="'./partials/timesModal.html'"></div></div> + </tab> + + <!-- alarm--> + <tab> + <tab-heading> + <i class="glyphicon glyphicon-bell"></i> Alarm + </tab-heading> + <div ng-controller="AlertModalInstanceCtrl" ng-include="'./partials/alertModal.html'"></div> + </tab> + + + +</tabset> + +<div class="modal-footer"> + <button class="btn btn-primary" ng-click="close()">Fermer</button> +</div> \ No newline at end of file Added: branches/ng-jtimer/src/main/webapp/partials/task.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/task.html (rev 0) +++ branches/ng-jtimer/src/main/webapp/partials/task.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -0,0 +1,28 @@ +<div id="modalheader"> + <div class="left"> + <h4>Task : {{task.name}}</h4> + Change name : <input type=text ng-model="task.name"> + </div> + + <div class="right"> + <h5>Time :</h5> + <b>Total time :</b>{{totaltime|time}} <br/> + <b>Today Time :</b>{{todaytime|time}} + <div ng-if="task.tags.length == 0"> + <h5>Tags :</h5> + <span class="label label-info" ng-repeat="tag in task.tags"> + {{tag}} + </span> + </div> + </div> + + +</div> + +<div class="modalDesc"> + <h4>Descritpion:</h4> + <div class="paded" > + + <textarea name="textarea" rows="5" cols="30" ng-model="task.description"></textarea> + </div> +</div> \ No newline at end of file Modified: branches/ng-jtimer/src/main/webapp/partials/tasks.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/tasks.html 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/partials/tasks.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -10,7 +10,7 @@ <!--Header partie droite --> <span class="right"> - <a class="glyphicon glyphicon-cog" ng-click="reportPopup()">Rapport </a> + <a class="glyphicon glyphicon-cog" ng-click="reportPopup()">Report </a> <a class="glyphicon glyphicon-plus-sign" ng-click="showMenu = !showMenu"></a> <ul class="dropdown-menu" ng-class="{'menu-show': showMenu}"> @@ -26,12 +26,18 @@ <!-- Websocket information --> <div id="alerts"> - <div class="alert alert-warning" ng-if="!webSocketClientOnline"> - <span class="icon-warning-sign"></span> Impossible de contacter le client local pour la gestion de l'inactivité. - <a target="_blank">Télécharger le client local</a>. + <div class="alert alert-warning" ng-if="!webSocketClientOnline"> + <span class="icon-warning-sign"></span> + Warning: the local client for idleness is not reachable. + <a target="_blank">Download the local client</a>. + + <i class="right glyphicon glyphicon-remove" ng-click="showWebsocketAlert()"></i> </div> </div> + + + <!-- Footer --> <div id="footer"> <span class="left">{{currentDate()}}</span> @@ -45,6 +51,7 @@ <div> <div class='table'> <div class='tr'> + <div class='th name' ng-show="showName">Name</div> <div class='th today' ng-show="showToday">Today</div> <div class='th global' ng-show="showGlobal">Total</div> @@ -56,7 +63,8 @@ wt-tree-repeat="tree | filter:query | orderBy:'task.name'" wt-force-open="query || forceExpanded"> - <div class="tr" ng-class="{'current-row' : ($node.task === currentTask), 'selected-row' : ($node.task === selectedTask)}" + <div class="tr" ng-class="{ 'selected-row' : ($node.task === selectedTask)}" + ng-click="setSelectedTask($node.task)" ng-keydown="keyPressed($event)"><!--ng-dblclick="timeTask($node.task)"--> @@ -64,10 +72,17 @@ <span class="spacer level{{$level}}"></span> <!--Task state icon--> - <i class="glyphicon glyphicon-ban-circle" ng-show="$state=='empty'"></i> - <i class="glyphicon glyphicon-plus-sign" ng-click="$toggleState()" ng-show="$state=='close'"></i> - <i class="glyphicon glyphicon-minus-sign" ng-click="$toggleState()" ng-show="$state=='open'"></i> + <span> + <i class="glyphicon glyphicon-ban-circle" ng-show="$state=='empty'"></i> + <i class="glyphicon glyphicon-plus-sign" ng-click="$toggleState()" ng-show="$state=='close'"></i> + <i class="glyphicon glyphicon-minus-sign" ng-click="$toggleState()" ng-show="$state=='open'"></i> + <img ng-class="{'no-alarm' : (currentTaskAlarmState =='no-alarm'), + 'alarmOk': (currentTaskAlarmState =='alarmOk'), + 'alarmInter' : (currentTaskAlarmState =='alarmInter'), + 'alarmDanger': (currentTaskAlarmState =='alarmDanger')}" src="partials/loading_timer.gif" height="20" width="20" ng-show="currentTask == $node.task"> + </span> + <!--Project name visible and editable --> <form ng-submit="saveTask($node)" ng-show="$node.edit == 'name'" ng-blur="$node.edit == ''"> <input ng-model="$node.task.name" ng-blur="$node.edit == ''" > @@ -87,13 +102,9 @@ <i class="glyphicon glyphicon-minus"></i> </a> - <a class="btn btn-default btn-xs" ng-click="popup($node)" - ng-show="!$node.task.isRoot() "> + <a class="btn btn-default btn-xs" ng-click="optionPopup($node, $node.task.isRoot())"> <i class="glyphicon glyphicon-pencil" ></i> </a> - <a class="btn btn-default btn-xs" ng-click="alarmPopup($node)"> - <i class="glyphicon glyphicon-bell" ></i> - </a> </span> </div> Modified: branches/ng-jtimer/src/main/webapp/partials/timeModal.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/timeModal.html 2014-07-03 15:52:17 UTC (rev 3013) +++ branches/ng-jtimer/src/main/webapp/partials/timeModal.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -2,7 +2,7 @@ <h3> Edition de la tâche.</h3> <div class="btn-group" dropdown is-open="status.isopen" ng-show="obj.action==''"> - <button type="button" class="btn btn-primary dropdown-toggle"> + <button type="button" class="btn btn-default btn-sm dropdown-toggle"> Action à faire sur la tâche: <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> @@ -17,7 +17,7 @@ <!-- Div dropdown choix de periode --> <div class="btn-group" dropdown is-open="status.isopen" ng-if="!activTime && obj.action !='' && obj.action !='Ajout'"> - <button type="button" class="btn btn-primary dropdown-toggle"> + <button type="button" class="btn btn-default btn-sm dropdown-toggle"> Les périodes pour la tâche sélectionnée : <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> @@ -45,8 +45,8 @@ <div class = "timepick" ng-controller="RadioTimeCtrl"> <div> <div class="btn-group"> - <label class="btn btn-primary" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Left'">Début de période </label> - <label class="btn btn-primary" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Right'">Fin de période </label> + <label class="btn btn-default btn-sm" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Left'">Début de période </label> + <label class="btn btn-default btn-sm" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Right'">Fin de période </label> </div> </div> <div class="timepick"> @@ -74,8 +74,8 @@ <div> <div class="btn-group"> - <label class="btn btn-primary" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Left'">Début de période </label> - <label class="btn btn-primary" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Right'">Fin de période </label> + <label class="btn btn-default btn-sm" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Left'">Début de période </label> + <label class="btn btn-default btn-sm" ng-model="radioModel" ng-change="changeFonc()" btn-radio="'Right'">Fin de période </label> </div> </div> @@ -101,13 +101,13 @@ Début : {{getStartObjTime()}} - Fin : {{getStopObjTime()}} - Duree : {{getObjDuration() | time}} </alert> </div> - +<!-- <div class="modal-footer"> - <button class="btn btn-primary" ng-click="ok()">OK</button> + <button class="btn btn-default btn-sm" ng-click="ok()">OK</button> <button class="btn btn-warning" ng-click="cancel()">Cancel</button> </div> +--> - </div> Added: branches/ng-jtimer/src/main/webapp/partials/timesModal.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/timesModal.html (rev 0) +++ branches/ng-jtimer/src/main/webapp/partials/timesModal.html 2014-07-11 08:01:54 UTC (rev 3014) @@ -0,0 +1,72 @@ +<div id="modalheader"> + <!--<div ng-controller="DatePickerCtrl" style="display:inline-block; min-height:290px;" ng-show="!dateChosen"> + <datepicker ng-model="dateobj.date" ng-change="changeDayDate()" min-date="minDate" max-date="dateMaxPicker" show-weeks="true" class="well well-sm"></datepicker> + </div>--> + + + <div class="left paded"> + <br/> + Pick a date : + <div ng-controller="ReportDatePickerCtrl" class="row paded"> + <div class="col-md-6"> + <p class="input-group medium_input"> + <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dateobj.date" ng-change="changeDate()" + is-open="opened" min-date="minDate" max-date="dateobj.today" ng-required="true" close-text="Close" /> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button> + </span> + </p> + </div> + </div> + + + + <div> <!--ng-show="dateChosen"--> + Time for this date : + <div class="paded divYScrolable"> + <div ng-repeat="(index,item) in times" class="rowYScrolable" ng-class="{ 'selected-row' : (item === selectedItem)}"> + + <div class="borderedbottom" ng-click="select(item, index)"> + At : {{getStartTime(item)}} for : {{getDuration(item)| time}}<i class="glyphicon glyphicon-minus-sign btn" ng-click="removeTime(index,item)"></i> + </div> + </div> + + <span ng-show="times.length == 0" > + No time for {{task.name}} at this date. + </span> + </div> + + </div> + </div> + + <div class="right paded" ng-if="selectedItem"> + <div> + + <h4>Description : </h4> + <div class="paded"> + Start : {{getStartTime(selectedItem)}}<br/> + End : {{getStopTime(selectedItem)}}<br/> + Duration : {{getDuration(selectedItem)| time}} + </div> + + <h4>Modification : </h4> + + <div style="display : inline-block;"> + De : + </div> + <div style="display : inline-block;"> + <timepicker + ng-model="dateobj.startPeriod" ng-change="changeModel()" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"> + </timepicker> + </div> + <div style="display : inline-block;"> + A : + </div> + <div style="display : inline-block;"> + <timepicker + ng-model="dateobj.endPeriod" ng-change="changeModel()" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"> + </timepicker> + </div> + </div> + </div> +</div>
participants (1)
-
obruce@users.chorem.org