- in progress
This commit is contained in:
parent
35ecdd1f60
commit
afb9c38184
3 changed files with 49 additions and 32 deletions
|
@ -118,6 +118,7 @@ angular.module('SeHub')
|
||||||
apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK
|
apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK
|
||||||
{
|
{
|
||||||
$scope.userTasks = data;
|
$scope.userTasks = data;
|
||||||
|
console.log($scope.userTasks);
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
{
|
{
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
|
|
|
@ -7,35 +7,41 @@ angular.module('SeHub')
|
||||||
$scope.isEditPressed = false;
|
$scope.isEditPressed = false;
|
||||||
$scope.user = $scope.$parent.user;
|
$scope.user = $scope.$parent.user;
|
||||||
$scope.loadingData = true;
|
$scope.loadingData = true;
|
||||||
|
$scope.displayingMessages = true;
|
||||||
$scope.isMaster = false;
|
$scope.isMaster = false;
|
||||||
$scope.isMember = false;
|
$scope.isMember = false;
|
||||||
$scope.project = [];
|
$scope.project = [];
|
||||||
$scope.isInProject = false;
|
$scope.isInProject = false;
|
||||||
$scope.projectMessages = [];
|
$scope.projectMessages = [];
|
||||||
$scope.msg = {};
|
$scope.msg = {};
|
||||||
|
$scope.isMaster = false;
|
||||||
|
|
||||||
// $scope.thisProject = {};
|
// $scope.thisProject = {};
|
||||||
// $scope.thisProject.courseName = $routeParams.className;
|
// $scope.thisProject.courseName = $routeParams.className;
|
||||||
|
|
||||||
|
|
||||||
|
console.log($scope.user.id)
|
||||||
|
// console.log($scope.projectid)
|
||||||
|
|
||||||
$scope.displayProjectMessages = function()
|
$scope.displayProjectMessages = function()
|
||||||
{
|
{
|
||||||
apiService.getAllUserMessages(token).success(function(data)
|
apiService.getAllUserMessages(token).success(function(data)
|
||||||
{
|
{
|
||||||
$scope.projectMessages = data;
|
$scope.displayingMessages = false;
|
||||||
|
$scope.projectMessages = data;
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
{
|
{
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.goToProfile = function(memberId)
|
$scope.goToProfile = function(memberId)
|
||||||
{
|
{
|
||||||
$location.path('#/profile/' + memberId);
|
$location.path('/profile/' + memberId);
|
||||||
}
|
}
|
||||||
$scope.removeUserFromProject = function()
|
$scope.removeUserFromProject = function()
|
||||||
{
|
{
|
||||||
apiService.removeUserFromProject.success(function(data)
|
apiService.removeUserFromProject(token, $scope.user.id, projectId).success(function(data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
|
@ -66,6 +72,9 @@ angular.module('SeHub')
|
||||||
|
|
||||||
$scope.removeProject = function(ev)
|
$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')
|
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);
|
.ok('Please do it!').cancel('No').targetEvent(ev);
|
||||||
$mdDialog.show(confirm).then(function()
|
$mdDialog.show(confirm).then(function()
|
||||||
|
@ -79,7 +88,7 @@ angular.module('SeHub')
|
||||||
$location.path('/myProjects');
|
$location.path('/myProjects');
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
{
|
{
|
||||||
$mdDialog.show($mdDialog.alert().title('Project Removal').content('Project removal failed - reason' + err.message)
|
$mdDialog.show($mdDialog.alert().title('Project Removal').content('Project removal failed - reason ' + err.message)
|
||||||
.ariaLabel('project remove alert dialog').ok('Try Again').targetEvent(ev));
|
.ariaLabel('project remove alert dialog').ok('Try Again').targetEvent(ev));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -141,6 +150,8 @@ angular.module('SeHub')
|
||||||
apiService.getProjectsById(token, projectId).success(function(data)
|
apiService.getProjectsById(token, projectId).success(function(data)
|
||||||
{
|
{
|
||||||
$scope.project = data;
|
$scope.project = data;
|
||||||
|
if($scope.user.id === $scope.project.master_id)
|
||||||
|
$scope.isMaster = true;
|
||||||
for(var i = 0; i < data.members.length; i++)
|
for(var i = 0; i < data.members.length; i++)
|
||||||
{
|
{
|
||||||
if($scope.user.id === data.members[i].id)
|
if($scope.user.id === data.members[i].id)
|
||||||
|
|
|
@ -44,20 +44,20 @@
|
||||||
Team Members:
|
Team Members:
|
||||||
<ul layout-padding>
|
<ul layout-padding>
|
||||||
<div layout = "column" ng-repeat = "member in project.members">
|
<div layout = "column" ng-repeat = "member in project.members">
|
||||||
<!-- <li ng-repeat = "member in project.members"> -->
|
<div layout = "row">
|
||||||
<div layout = "row">
|
<div>
|
||||||
<div>
|
<md-button ng-click = "goToProfile(member.id)">
|
||||||
<md-button ng-click = "goToProfile(member.id)">
|
{{member.name}}
|
||||||
{{member.name}}
|
</md-button>
|
||||||
</md-button>
|
</div>
|
||||||
</div>
|
<div ng-if="isMaster">
|
||||||
<div ng-if = "isEditPressed">
|
<div ng-if = "isEditPressed">
|
||||||
<md-button ng-click="removeUserFromProject()" ng class="md-raised md-primary" aria-label="rU">
|
<md-button ng-click="removeUserFromProject()" ng class="md-raised md-primary" aria-label="rU">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- </li> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,28 +100,33 @@
|
||||||
<div flex = "96" style="height:70%;">
|
<div flex = "96" style="height:70%;">
|
||||||
<div flex>
|
<div flex>
|
||||||
<md-card>
|
<md-card>
|
||||||
<md-content class="md-padding">
|
<md-content>
|
||||||
<md-tabs md-dynamic-height md-border-bottom>
|
<md-tabs md-dynamic-height md-border-bottom>
|
||||||
<md-tab label="Messages">
|
<md-tab label="Messages">
|
||||||
<md-card ng-repeat = "msg in userMessages">
|
<div ng-if="displayingMessages" layout-paddig layout-margin class="loader">
|
||||||
<div layout = "column" layout-padding>
|
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
|
||||||
<div flex = "30" class="md-avatar">
|
</div>
|
||||||
<img ng-src="{{msg.user.avatar_url}}" style="width:100%">
|
<md-content class="tabDesign">
|
||||||
</div>
|
<md-card ng-repeat = "msg in projectMessages">
|
||||||
<div flex = "20" layout = "row">
|
<div layout = "row" layout-padding ng-if="!displayingMessages">
|
||||||
<div>
|
<div flex = "10">
|
||||||
{{msg.user.username}}
|
<img ng-src="{{msg.user.avatar_url}}" style="width:80%">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div flex = "20" layout = "column">
|
||||||
{{msg.group.courseName}}
|
<div>
|
||||||
{{msg.group.projectName}}
|
{{msg.user.username}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{msg.group.courseName}}
|
||||||
|
{{msg.group.projectName}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div flex = "40">
|
||||||
|
{{msg.message}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div flex = "40">
|
</md-card>
|
||||||
{{msg.message}}
|
</md-content>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</md-card>
|
|
||||||
</md-tab>
|
</md-tab>
|
||||||
<md-tab label="Commits">
|
<md-tab label="Commits">
|
||||||
<md-content class="tabDesign">
|
<md-content class="tabDesign">
|
||||||
|
@ -191,12 +196,12 @@
|
||||||
</table>
|
</table>
|
||||||
</md-content>
|
</md-content>
|
||||||
</md-tab>
|
</md-tab>
|
||||||
<md-tab label="tasks">
|
<!-- <md-tab label="tasks">
|
||||||
<md-content class="md-padding">
|
<md-content class="md-padding">
|
||||||
<h1 class="md-display-2">tasks</h1>
|
<h1 class="md-display-2">tasks</h1>
|
||||||
<p>tasks..</p>
|
<p>tasks..</p>
|
||||||
</md-content>
|
</md-content>
|
||||||
</md-tab>
|
</md-tab> -->
|
||||||
</md-tabs>
|
</md-tabs>
|
||||||
</md-content>
|
</md-content>
|
||||||
</md-card>
|
</md-card>
|
||||||
|
|
Loading…
Reference in a new issue