- 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
|
||||
{
|
||||
$scope.userTasks = data;
|
||||
console.log($scope.userTasks);
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log(err.message);
|
||||
|
|
|
@ -7,35 +7,41 @@ 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.projectMessages = data;
|
||||
$scope.displayingMessages = false;
|
||||
$scope.projectMessages = data;
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log(err.message);
|
||||
console.log(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
$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()
|
||||
|
@ -79,7 +88,7 @@ angular.module('SeHub')
|
|||
$location.path('/myProjects');
|
||||
}).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));
|
||||
});
|
||||
},
|
||||
|
@ -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)
|
||||
|
|
|
@ -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 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,28 +100,33 @@
|
|||
<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>
|
||||
<div flex = "20" layout = "row">
|
||||
<div>
|
||||
{{msg.user.username}}
|
||||
<div ng-if="displayingMessages" layout-paddig layout-margin class="loader">
|
||||
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
|
||||
</div>
|
||||
<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>
|
||||
{{msg.group.courseName}}
|
||||
{{msg.group.projectName}}
|
||||
<div flex = "20" layout = "column">
|
||||
<div>
|
||||
{{msg.user.username}}
|
||||
</div>
|
||||
<div>
|
||||
{{msg.group.courseName}}
|
||||
{{msg.group.projectName}}
|
||||
</div>
|
||||
</div>
|
||||
<div flex = "40">
|
||||
{{msg.message}}
|
||||
</div>
|
||||
</div>
|
||||
<div flex = "40">
|
||||
{{msg.message}}
|
||||
</div>
|
||||
</div>
|
||||
</md-card>
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue