- in progress

This commit is contained in:
Matan Bar Yosef 2015-08-03 01:01:25 +03:00
parent 35ecdd1f60
commit afb9c38184
3 changed files with 49 additions and 32 deletions

View file

@ -118,6 +118,7 @@ angular.module('SeHub')
apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK
{
$scope.userTasks = data;
console.log($scope.userTasks);
}).error(function(err)
{
console.log(err.message);

View file

@ -7,21 +7,27 @@ angular.module('SeHub')
$scope.isEditPressed = false;
$scope.user = $scope.$parent.user;
$scope.loadingData = true;
$scope.displayingMessages = true;
$scope.isMaster = false;
$scope.isMember = false;
$scope.project = [];
$scope.isInProject = false;
$scope.projectMessages = [];
$scope.msg = {};
$scope.isMaster = false;
// $scope.thisProject = {};
// $scope.thisProject.courseName = $routeParams.className;
console.log($scope.user.id)
// console.log($scope.projectid)
$scope.displayProjectMessages = function()
{
apiService.getAllUserMessages(token).success(function(data)
{
$scope.displayingMessages = false;
$scope.projectMessages = data;
}).error(function(err)
{
@ -31,11 +37,11 @@ angular.module('SeHub')
$scope.goToProfile = function(memberId)
{
$location.path('#/profile/' + memberId);
$location.path('/profile/' + memberId);
}
$scope.removeUserFromProject = function()
{
apiService.removeUserFromProject.success(function(data)
apiService.removeUserFromProject(token, $scope.user.id, projectId).success(function(data)
{
}).error(function(err)
@ -66,6 +72,9 @@ angular.module('SeHub')
$scope.removeProject = function(ev)
{
if($scope.user.id === $scope.project.master_id)
$scope.isMaster = true;
var confirm = $mdDialog.confirm().title('Remove Project').content('Would you like to delete this project?').ariaLabel('removeProj')
.ok('Please do it!').cancel('No').targetEvent(ev);
$mdDialog.show(confirm).then(function()
@ -141,6 +150,8 @@ angular.module('SeHub')
apiService.getProjectsById(token, projectId).success(function(data)
{
$scope.project = data;
if($scope.user.id === $scope.project.master_id)
$scope.isMaster = true;
for(var i = 0; i < data.members.length; i++)
{
if($scope.user.id === data.members[i].id)

View file

@ -44,20 +44,20 @@
Team Members:
<ul layout-padding>
<div layout = "column" ng-repeat = "member in project.members">
<!-- <li ng-repeat = "member in project.members"> -->
<div layout = "row">
<div>
<md-button ng-click = "goToProfile(member.id)">
{{member.name}}
</md-button>
</div>
<div ng-if="isMaster">
<div ng-if = "isEditPressed">
<md-button ng-click="removeUserFromProject()" ng class="md-raised md-primary" aria-label="rU">
<i class="fa fa-times"></i>
</md-button>
</div>
</div>
<!-- </li> -->
</div>
</div>
</ul>
</div>
@ -100,15 +100,19 @@
<div flex = "96" style="height:70%;">
<div flex>
<md-card>
<md-content class="md-padding">
<md-content>
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<md-card ng-repeat = "msg in userMessages">
<div layout = "column" layout-padding>
<div flex = "30" class="md-avatar">
<img ng-src="{{msg.user.avatar_url}}" style="width:100%">
<div ng-if="displayingMessages" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<div flex = "20" layout = "row">
<md-content class="tabDesign">
<md-card ng-repeat = "msg in projectMessages">
<div layout = "row" layout-padding ng-if="!displayingMessages">
<div flex = "10">
<img ng-src="{{msg.user.avatar_url}}" style="width:80%">
</div>
<div flex = "20" layout = "column">
<div>
{{msg.user.username}}
</div>
@ -122,6 +126,7 @@
</div>
</div>
</md-card>
</md-content>
</md-tab>
<md-tab label="Commits">
<md-content class="tabDesign">
@ -191,12 +196,12 @@
</table>
</md-content>
</md-tab>
<md-tab label="tasks">
<!-- <md-tab label="tasks">
<md-content class="md-padding">
<h1 class="md-display-2">tasks</h1>
<p>tasks..</p>
</md-content>
</md-tab>
</md-tab> -->
</md-tabs>
</md-content>
</md-card>