arnaucube
arnaucube/openworktimePublic Self-hosted repository
little changes
idoctnef idoctnef@openmailbox.org
Sun, 11 Sep 2016 18:23:55 +0200
commit

d5a4e4c47f4abe7411a5c2e1e6359a774ba81936

parent

846ebf23bd6bfef473ebda2b2a7e54fd67ed6225

3 files changed, 10 insertions(+), 4 deletions(-)

jump to
M intervalComprovations.js → intervalComprovations.js

@@ -32,6 +32,7 @@ users[i].save(function(err) {

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 } } }
M webapp/controllers.js → webapp/controllers.js

@@ -39,6 +39,7 @@ .then(function(result){

users = result.data; }); }; + $scope.countingTime; /* DASHBOARD initialization */ $scope.dashboardInit = function(){ if(localStorage.getItem('owt_token')){// adding token to the headers

@@ -102,7 +103,6 @@ })

.then(function(result){ users = result.data; }); - }; /* </DASHBOARD initialization */

@@ -255,7 +255,6 @@ };

$scope.currentprojectIndex; $scope.projectSelect = function(index){ //$scope.btnStop(); - console.log(index); $scope.currentprojectIndex=index; $scope.currentproject=$scope.projects[index]; };

@@ -310,6 +309,7 @@ response.data[i].chart=translateWorkStrikes2Chart(response.data[i].workStrikes);

} $scope.projects=response.data; $scope.getLoggedUser(); + $scope.currentproject=$scope.projects[$scope.currentprojectIndex]; }, function(response) {// failed });
M webapp/dashboard.html → webapp/dashboard.html

@@ -52,7 +52,8 @@ <ul class="collection">

<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 @@ <img ng-src="img/{{currentproject.icon}}.png" class="o_project_title_img"/>

{{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>

<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">