little changes

This commit is contained in:
idoctnef
2016-09-11 18:23:55 +02:00
parent 846ebf23bd
commit d5a4e4c47f
3 changed files with 10 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ exports.lastConnectionUser = function() {
if(err) return res.send(500, err.message);
//console.log("user: " + users[i].username + ", connected=false");
});
//falta posar el .working a false, i si estava a true, anar al projecte i posar l'hora actual com a final al workStrike
}
}
}

View File

@@ -39,6 +39,7 @@ angular.module('workApp', ['chart.js'])
users = result.data;
});
};
$scope.countingTime;
/* DASHBOARD initialization */
$scope.dashboardInit = function(){
if(localStorage.getItem('owt_token')){// adding token to the headers
@@ -102,7 +103,6 @@ angular.module('workApp', ['chart.js'])
.then(function(result){
users = result.data;
});
};
/* </DASHBOARD initialization */
@@ -255,7 +255,6 @@ angular.module('workApp', ['chart.js'])
$scope.currentprojectIndex;
$scope.projectSelect = function(index){
//$scope.btnStop();
console.log(index);
$scope.currentprojectIndex=index;
$scope.currentproject=$scope.projects[index];
};
@@ -310,6 +309,7 @@ angular.module('workApp', ['chart.js'])
}
$scope.projects=response.data;
$scope.getLoggedUser();
$scope.currentproject=$scope.projects[$scope.currentprojectIndex];
},
function(response) {// failed
});

View File

@@ -52,7 +52,8 @@
<li ng-repeat="user in users" class="collection-item avatar blue-grey darken-3">
<img ng-src="img/avatars/{{user.avatar}}.png" class="circle">
<span class="title">{{user.username}}</span>
<span ng-show="user.connected" class="new badge" data-badge-caption="online"></span>
<span ng-show="user.connected" class="new badge blue" data-badge-caption="online"></span>
<span ng-show="user.working" class="new badge" data-badge-caption="working"></span>
<p>{{user.description}}</p>
</li>
</ul>
@@ -120,7 +121,7 @@
{{currentproject.title}}
</span>
<p>
Total time: {{currentproject.totaltime | secondsToDateTime | date:'HH:mm:ss'}}
Current strike time: {{currentproject.totaltime | secondsToDateTime | date:'HH:mm:ss'}}
</p>
<p ng-repeat="user in currentproject.users">
{{user.username}}: <b>{{user.time | secondsToDateTime | date:'HH:mm:ss'}}</b>
@@ -130,6 +131,10 @@
<div class="card-action">
<div ng-show="arrayObjectIndexOf(currentproject.users, user.username, 'username')!=-1">
<a ng-click="btnWork()" ng-show="!user.working" class="waves-effect waves-light btn green lighten-2">Work!</a>
<div ng-show="user.working" class="progress">
<div class="indeterminate"></div>
</div>
<a ng-click="btnStop()" ng-show="user.working" class="waves-effect waves-light btn red lighten-2">Stop!</a>
</div>
<div ng-show="arrayObjectIndexOf(currentproject.users, user.username, 'username')==-1">