-getAllfutureCampusTasks - fixed
-messages in dashboard - fixed
This commit is contained in:
parent
9bede4b399
commit
dfd141229c
6 changed files with 169 additions and 59 deletions
|
@ -87,6 +87,7 @@ angular.module('SeHub')
|
|||
'courseId': intClassId,
|
||||
'gitRepository': $scope.project.repoOwner + '/' + $scope.project.gitRepoName
|
||||
};
|
||||
console.log("Look Down");
|
||||
console.log(jsonNewProj);
|
||||
|
||||
if ($scope.project.logoUrl)
|
||||
|
@ -94,7 +95,7 @@ angular.module('SeHub')
|
|||
|
||||
apiService.createProject(token, jsonNewProj).success(function(data)
|
||||
{
|
||||
loadingData = false;
|
||||
$scope.loadingData = false;
|
||||
projectId = data.id;
|
||||
$mdDialog.show($mdDialog.alert().title('Project Created').content('You have successfully created project.')
|
||||
.ariaLabel('Project created alert dialog').ok('Great!').targetEvent())
|
||||
|
@ -104,7 +105,8 @@ angular.module('SeHub')
|
|||
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log("Error: " + err.message);
|
||||
$scope.creatingProject = false;
|
||||
console.log(err.message);
|
||||
$mdDialog.show($mdDialog.alert().title('Error Creating Project').content('You have failed Creating the project.')
|
||||
.ariaLabel('Create project alert dialog').ok('Try Again!').targetEvent()); // Pop-up alert
|
||||
});
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
angular.module('SeHub')
|
||||
.controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
.controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope',
|
||||
function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
$scope.isStudent = false;
|
||||
$scope.addMsg = false;
|
||||
$scope.msgToPost = "";
|
||||
$scope.oldText = "";
|
||||
$scope.messages = [];
|
||||
$scope.userMessages = [];
|
||||
$scope.messagesDisplay = [];
|
||||
$scope.courses = [];
|
||||
$scope.campuses = [];
|
||||
$scope.msg = {};
|
||||
$scope.courseObj = {};
|
||||
// $scope.course = ""; // should be "" ? // {} ??
|
||||
|
||||
$scope.user = $scope.$parent.user;
|
||||
$rootScope.seToken = $cookies['com.sehub.www'];
|
||||
var token = $rootScope.seToken;
|
||||
var imagePath = $scope.user.avatar_url;
|
||||
|
||||
if($scope.user.isLecturer)
|
||||
{
|
||||
|
@ -28,6 +28,20 @@ angular.module('SeHub')
|
|||
console.log("Student Mode!");
|
||||
}
|
||||
|
||||
$scope.displayMessages = function()
|
||||
{
|
||||
apiService.getAllUserMessages(token).success(function(data)
|
||||
{
|
||||
console.log(data);
|
||||
$scope.userMessages = data;
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log("Error: " + err.message);
|
||||
});
|
||||
}
|
||||
|
||||
$scope.displayMessages(); //
|
||||
|
||||
$scope.addMessageClicked = function()
|
||||
{
|
||||
$scope.addMsg = true; // Reveal the "POST" Button
|
||||
|
@ -53,8 +67,8 @@ angular.module('SeHub')
|
|||
console.log(err);
|
||||
});
|
||||
|
||||
console.log($scope.msg.msgToAdd);
|
||||
$scope.messages.push({"text": $scope.msg.msgToAdd});
|
||||
$location.path('/home/');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -66,30 +80,25 @@ angular.module('SeHub')
|
|||
|
||||
$scope.displayTasks = function()
|
||||
{
|
||||
apiService.getAllUserTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK
|
||||
{
|
||||
$scope.tasks = data;
|
||||
console.log(data);
|
||||
}).error(function(err)
|
||||
{
|
||||
|
||||
});
|
||||
|
||||
// apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId
|
||||
// {
|
||||
|
||||
// console.log("YE");
|
||||
// }).error(function(err)
|
||||
// {
|
||||
|
||||
// console.log("Error: " + err.message);
|
||||
// });
|
||||
|
||||
|
||||
}
|
||||
|
||||
$scope.displayMessages = function()
|
||||
{
|
||||
// apiService.getMessagesByGroupId(token, $scope.courseObj.id).success(function(data)
|
||||
// {
|
||||
// $scope.messages = data;
|
||||
// console.log($scope.messages);
|
||||
// }).error(function(err)
|
||||
// {
|
||||
// console.log(err);
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
$scope.getCampuses = function()
|
||||
{
|
||||
apiService.getCampusesByUser(token).success(function(data)
|
||||
|
@ -98,11 +107,11 @@ angular.module('SeHub')
|
|||
$scope.getCourses(); // Get all the courses info
|
||||
if($scope.messages)
|
||||
{
|
||||
$scope.displayMessages(); // // Display all messages in message feed and the latest one
|
||||
//$scope.displayMessages(); // // Display all messages in message feed and the latest one
|
||||
}
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log("Error: " + err);
|
||||
console.log("Error: " + err.message);
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -122,14 +131,14 @@ angular.module('SeHub')
|
|||
}
|
||||
}).error(function(err)
|
||||
{
|
||||
console.log("Error: " + err);
|
||||
console.log("Error: " + err.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$scope.clearAllClicked = function() // Clear Screen from text
|
||||
{
|
||||
$scope.messages = [];
|
||||
$scope.userMessages = [];
|
||||
}
|
||||
|
||||
$scope.chooseCourseClicked = function()
|
||||
|
@ -175,8 +184,8 @@ angular.module('SeHub')
|
|||
$scope.getCampuses(); // Get all the campuses info
|
||||
|
||||
// animation
|
||||
|
||||
// $scope.displayTasks(); // Display all tasks in task feed and the latest one
|
||||
// $scope.displayMessages();
|
||||
$scope.displayTasks(); // Display all tasks in task feed and the latest one
|
||||
$scope.isEnterd = top.setIsEnterd;
|
||||
|
||||
}]);
|
|
@ -110,6 +110,5 @@ angular.module('SeHub').controller('newTasksController', ['$scope',
|
|||
$scope.RB = function(comp){
|
||||
console.info(comp);
|
||||
}
|
||||
|
||||
}
|
||||
]);
|
|
@ -35,11 +35,21 @@ angular.module('SeHub')
|
|||
|
||||
$scope.removeProject = function(ev)
|
||||
{
|
||||
$mdDialog.show($mdDialog.alert().title('Remove Project').content('Are you sure you want to remove the project ?')
|
||||
.ariaLabel('Removing project alert dialog').ok('Yes').targetEvent(ev));
|
||||
// .then(function() {
|
||||
$mdDialog.show($mdDialog.confirm().title('Remove Project').content('Are you sure you want to remove the project ?')
|
||||
.ariaLabel('Removing project alert dialog').ok('Yes').cancel('No').targetEvent(ev));
|
||||
|
||||
/*
|
||||
.than(function()
|
||||
{
|
||||
$scope.alert = 'You decided to get rid of your debt.';
|
||||
},
|
||||
function()
|
||||
{
|
||||
$scope.alert = 'You decided to keep your debt.';
|
||||
});
|
||||
*/
|
||||
|
||||
// $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
|
||||
// }); // Pop-up alert
|
||||
};
|
||||
|
||||
$scope.getProfileRoute = function(userName)
|
||||
|
@ -48,8 +58,6 @@ angular.module('SeHub')
|
|||
{
|
||||
if(userName === $scope.project.members[i].name)
|
||||
{
|
||||
console.log(userName);
|
||||
console.log($scope.project.members[i].name);
|
||||
return '#/profile/' + $scope.project.members[i].id;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -189,6 +189,46 @@ service.factory('apiService', ['$http', function($http) {
|
|||
};
|
||||
return $http(req);
|
||||
},
|
||||
removeProject: function(token, projectId){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/deleteProject/" + token + "/" + projectId;
|
||||
req = {
|
||||
method: "DELETE",
|
||||
url: url
|
||||
};
|
||||
return $http(req);
|
||||
},
|
||||
getAllFutureTasks: function(token, courseId){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureCampusTasks/" + token + "/" + courseId;
|
||||
req = {
|
||||
method: "GET",
|
||||
url: url
|
||||
};
|
||||
return $http(req);
|
||||
},
|
||||
getAllUserTasks: function(token){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllUserTasks/" + token;
|
||||
req = {
|
||||
method: "GET",
|
||||
url: url
|
||||
};
|
||||
return $http(req);
|
||||
},
|
||||
getAllTasksByCourse: function(token, courseId){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllTasksByCourse/" + token + "/" + courseId;
|
||||
req = {
|
||||
method: "GET",
|
||||
url: url
|
||||
};
|
||||
return $http(req);
|
||||
},
|
||||
getAllUserMessages: function(token){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/messages/getAllUserMessages/" + token;
|
||||
req = {
|
||||
method: "GET",
|
||||
url: url
|
||||
};
|
||||
return $http(req);
|
||||
},
|
||||
getCourseById: function(token, id){
|
||||
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesById/" + token + "/" + id;
|
||||
req = {
|
||||
|
|
|
@ -30,17 +30,50 @@
|
|||
<div>
|
||||
Closest Task-
|
||||
<md-card layout-margin layout-padding>
|
||||
Will Be Here
|
||||
<div>
|
||||
In Course: {{tasks[0].courseName}}
|
||||
</div>
|
||||
</md-card>
|
||||
</div>
|
||||
<div>
|
||||
Latest Message-
|
||||
<md-card layout-margin layout-padding>
|
||||
Will Be Here
|
||||
{{userMessages[0].message}}
|
||||
</md-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--
|
||||
<table style="width:100%;" border = "1">
|
||||
<tr>
|
||||
<th>Message</th>
|
||||
<th style = "width:20%;">Date</th>
|
||||
<th style = "width:10%;">Committer</th>
|
||||
</tr>
|
||||
<tr ng-repeat = "commit in project.info.commits" layout-margin align = "center">
|
||||
<td>
|
||||
<span ng-repeat = "msg in commit">
|
||||
<a target = "_blank"ng-href="{{commit.html_url}}"
|
||||
style="text-decoration:none; color:black;">
|
||||
{{msg.message}}
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span ng-repeat = "date in commit.author">
|
||||
{{date.date}}
|
||||
</span>
|
||||
</td>
|
||||
<td ng-repeat = "member in project.members">
|
||||
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;">
|
||||
{{member.name}}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
-->
|
||||
|
||||
<div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
|
||||
<md-card>
|
||||
<div flex = 90>
|
||||
|
@ -49,30 +82,47 @@
|
|||
<md-tab label="Messages">
|
||||
<md-content class="tabDesign">
|
||||
<md-content class="messagesContent">
|
||||
<!-- <div class = "messagesContent"> -->
|
||||
<md-card ng-repeat = "msg in messages">
|
||||
<div layout="column">
|
||||
<div layout="row" layout-margin layout-padding>
|
||||
<div flex="10" class="md-avatar">
|
||||
<img ng-src="{{user.avatar_url}}" style="width:100%">
|
||||
<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>
|
||||
<div flex>
|
||||
<div layout = "column">
|
||||
<div>
|
||||
<b>{{user.name}}</b>
|
||||
</div>
|
||||
<div>
|
||||
{{courseObj.courseName}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{msg.group.courseName}}
|
||||
<br></br>
|
||||
{{msg.group.projectName}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div flex="70" class="msgSent" layout-margin layout-padding>
|
||||
{{msg.text}}
|
||||
</div>
|
||||
</div>
|
||||
<div flex = 40>
|
||||
{{msg.message}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div flex layout="column">
|
||||
<div flex = 30 class="md-avatar" layout-padding layout-margin>
|
||||
<img ng-src="{{msg.user.avatar_url}}" style="width:100%">
|
||||
</div>
|
||||
|
||||
<div layout = "row" flex = 15 layout-padding>
|
||||
<div>
|
||||
{{msg.user.username}}
|
||||
</div>
|
||||
<div>
|
||||
{{msg.group.courseName}}
|
||||
{{msg.group.projectName}}
|
||||
</div>
|
||||
</div>
|
||||
<div flex = 50 layout-padding>
|
||||
{{msg.message}}
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
</md-card>
|
||||
</md-content>
|
||||
<!-- </div> -->
|
||||
|
@ -81,7 +131,9 @@
|
|||
<md-tab label="Tasks">
|
||||
<md-content class="md-padding">
|
||||
<h1 class="md-display-2">Tasks</h1>
|
||||
One
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="two">
|
||||
|
|
Loading…
Reference in a new issue