- home page new pattern added (work in progress)

- task page - improvements for layout (api func under progress)

- campuses (loading circle - under progress)
This commit is contained in:
Matan Bar Yosef 2015-07-01 07:05:13 +03:00
parent 5201634551
commit c154b37973
11 changed files with 176 additions and 107 deletions

View file

@ -456,7 +456,7 @@ p.tasksFeed
{
padding-left: 4px;
margin: 5px;
width:340;
width:99%;
height: auto;
background-color: aliceblue;
@ -465,7 +465,7 @@ p.messagesFeed
{
padding-left: 4px;
margin: 5px;
width:690;
width:99%;
height: auto;
background-color: #f5f5f5;
}

View file

@ -1,6 +1,7 @@
angular.module('SeHub')
.controller('campusesController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService, $rootScope)
{
$scope.loadingData = true;
$scope.campusesEmpty = false;
var token = $cookies['com.sehub.www'];
@ -34,6 +35,7 @@ angular.module('SeHub')
{
apiService.getCampusesByUser(token).success(function(data) // Get all the campuses
{
$scope.loadingData = true;
$scope.campuses = data;
console.log("INSIDE " + $scope.campuses);
init(); // Executing the function to initialize campuses display

View file

@ -34,16 +34,6 @@ angular.module('SeHub')
console.log("Student Mode!");
}
// apiService.getCourseByCampusName(token).success(function(data)
// {
// console.log("Campus Name is ON! " + token)
// $scope.course = data;
// }).error(function(err)
// {
// console.log("Error ===> " + err + " ===> getCourseByCampusName")
// });
$scope.addMessageClicked = function()
{
$scope.addMsg = true; // Reveal the "POST" Button
@ -78,6 +68,37 @@ angular.module('SeHub')
$scope.msg.msgToAdd = null;
}
$scope.displayTasks = function()
{
// apiService.getAllFutureTasks(token, courseId).success(function(data) // need to check courseId
// {
// }).error(function(err)
// {
// });
}
$scope.getCourses = function()
{
// apiService.getAllCoursesByCampus(token, campusId).success(function(data) // Shows all classes from this campus
// {
// $scope.loadingData = false;
// $scope.courses = data;
// console.log("success " + $scope.courses);
// init(); // Executing the function to initialize course display
// if($scope.courses && $scope.courses.length > 0)
// {
// $scope.coursesEmpty = false;
// }
// }).error(function(err)
// {
// console.log("error: " + err);
// });
}
$scope.clearAllClicked = function() // Clear Screen from text
{
$scope.messages = [];
@ -95,4 +116,6 @@ angular.module('SeHub')
// animation
$scope.isEnterd = top.setIsEnterd;
$scope.getCourses(); // Get all the courses info
$scope.displayTasks(); // Display all tasks in task feed
}]);

View file

@ -131,7 +131,6 @@ angular.module('SeHub')
init(); // Executing the function to initialize course display
if($scope.courses && $scope.courses.length > 0)
{
// $scope.coursesEmpty = true;
$scope.coursesEmpty = false;
}
}).error(function(err)

View file

@ -3,10 +3,8 @@ angular.module('SeHub')
{
console.log("in controller");
$scope.createTaskClicked = function(name)
$scope.createTaskClicked = function()
{
var taskName = name;
console.log("task created! " + taskName);
$location.path("/tasks/new"); // Reference to 'newTask' page
}

View file

@ -13,6 +13,14 @@ service.factory('apiService', ['$http', function($http) {
};
return $http(req);
},
getUserById: function(token, id){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id;
req = {
method : "GET",
url : url
};
return $http(req);
},
getAllCampuses: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getAll/" + token;
req = {
@ -21,25 +29,11 @@ service.factory('apiService', ['$http', function($http) {
};
return $http(req);
},
sendValidationMail: function(token, email){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/validation/sendmail/" + token;
payload = {
email: email
};
getCampusesByUser: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token;
req = {
method: "POST",
url: url,
data: payload
};
return $http(req);
},
updateUser: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token;
req = {
method: "PUT",
url: url,
data: payLoad
method : "GET",
url : url
};
return $http(req);
},
@ -48,7 +42,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
@ -57,7 +50,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
@ -66,17 +58,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
createMessage: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token;
req = {
method : "POST",
url : url,
data: payLoad
};
return $http(req);
},
@ -85,25 +66,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
createCourse: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token;
req = {
method : "POST",
url : url,
data: payLoad
};
return $http(req);
},
getCampusesByUser: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/campuses/getCampusesByUser/" + token;
req = {
method : "GET",
url : url
};
return $http(req);
},
@ -112,7 +74,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
@ -121,7 +82,6 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
@ -135,16 +95,6 @@ service.factory('apiService', ['$http', function($http) {
},
getProjectsByUser: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/projects/getProjectsByUser/" + token;
req = {
method : "GET",
url : url
};
return $http(req);
},
getUserById: function(token, id){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/getUserById/" + token + "/" + id;
req = {
method : "GET",
url : url
@ -156,14 +106,21 @@ service.factory('apiService', ['$http', function($http) {
req = {
method : "GET",
url : url
};
return $http(req);
},
joinCourse: function(token, courseId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/joinCourse/" + token + "/" + courseId;
getCoursesByUserID: function(token, userId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId;
req = {
method : "PUT",
method : "GET",
url : url
};
return $http(req);
},
getAllFutureTasks: function(token, courseId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token + "/" + courseId;
req = {
method : "GET",
url : url
};
return $http(req);
@ -186,13 +143,52 @@ service.factory('apiService', ['$http', function($http) {
};
return $http(req);
},
getCoursesByUserID: function(token, userId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId;
createMessage: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/createMessage/" + token;
req = {
method : "GET",
method : "POST",
url : url,
data: payLoad
};
return $http(req);
},
sendValidationMail: function(token, email){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/validation/sendmail/" + token;
payload = {
email: email
};
req = {
method: "POST",
url: url,
data: payload
};
return $http(req);
},
createCourse: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/create/" + token;
req = {
method : "POST",
url : url,
data: payLoad
};
return $http(req);
},
joinCourse: function(token, courseId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/joinCourse/" + token + "/" + courseId;
req = {
method : "PUT",
url : url
};
return $http(req);
},
updateUser: function(token, payLoad){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/users/updateUser/" + token;
req = {
method: "PUT",
url: url,
data: payLoad
};
return $http(req);
}
};
}]);

View file

@ -1,7 +1,5 @@
<div class = "myCampuses">
<md-content layout-padding layout-margin>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-university"></i> Pick A Campus</h1>
</md-content>
<md-card class="cardAllCampuses">
<div ng-if = "!scope.campusesEmpty">
<div flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>

View file

@ -55,7 +55,7 @@
</md-input-container>
</div>
<!-- <div>
<p>/</p>
<br>/</br>
</div> -->
<div>
<md-input-container flex>
@ -85,4 +85,7 @@
</md-card>
</div>
</div>
<div layout-margin>
</div>
</div>

View file

@ -88,6 +88,54 @@
</md-card>
</div>
</div>
<md-card height="70%">
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<md-content class="md-padding">
<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%">
</div>
<div flex>
<div layout = "column">
<div>
<b>{{user.name}}</b>
</div>
<div>
class_name
</div>
</div>
</div>
</div>
<div>
<div flex="69" class="msgSent" layout-margin layout-padding>
{{msg.text}}
</div>
</div>
</div>
</md-card>
</div>
</md-content>
</md-tab>
<md-tab label="one">
<md-content class="md-padding">
<h1 class="md-display-2">Tab One</h1>
One
</md-content>
</md-tab>
<md-tab label="two">
<md-content class="md-padding">
<h1 class="md-display-2">Tab Two</h1>
Two
</md-content>
</md-tab>
</md-tabs>
</md-content>
</md-card>
<div class ="addMessage" layout="row" layout-margin layout padding>
<div>
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary"><i class="fa fa-comments"></i></md-button>

View file

@ -1,7 +1,7 @@
<div class = "myClasses">
<md-content layout-padding layout-margin>
<!-- <md-content layout-padding layout-margin> -->
<h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1>
</md-content>
<!-- </md-content> -->
<div layout-paddig layout-margin class="loader" ng-if="loadingData">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>

View file

@ -1,17 +1,22 @@
<div class = "tasks">
<md-content layout-padding layout-margin>
<h1 style="margin-left:15px"><i class="fa fa-file-text-o"></i> Tasks</h1>
<div ng-if="user.isLecturer">
<md-button ng-click="createTaskClicked(taskName)" ng class="md-raised md-primary">Create Task</md-button>
<div flex>
<md-card>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Submitted">
<md-tab label="" <i class="fa fa-check"></i>
<md-content class="md-padding">
<h1 class="md-display-2">Submitted</h1>
<p>Submitted...</p>
<table style="width:100%;" border = "1" class = "tabDesign">
<tr>
<th style = "width:20%">Task Name</th>
<th style = "width:20%">Date</th>
<th style = "width:20%">Grade</th>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="Delayed">
@ -26,23 +31,20 @@
<p> Not Submitted ..</p>
</md-content>
</md-tab>
<md-tab label="WhatEver">
<md-content class="md-padding">
<h1 class="md-display-2">WhatEver</h1>
<p>Bla Bla Bla..</p>
</md-content>
</md-tab>
<div ng-if = "user.isLecturer">
<md-button ng-click="createTaskClicked()" ng class="md-raised md-primary">Create Task</md-button>
</div>
</md-tabs>
</md-content>
</md-card>
</div>
<!-- Should Be In Table List -->
<div class = "allProjectsShow" flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "project in t" value = "{{project}}">
<md-button ng-click = "goToProject(project.id)" style="width:32%; height:32%;" flex="32" layout-padding class = "md-raised">
<div class = "allTasksShow" flex = "99" layout = "row" ng-repeat = "t in threeSizedArray" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "task in t" value = "{{task}}">
<md-button ng-click = "goToTask(task.id)" style="width:32%; height:32%;" flex="32" layout-padding class = "md-raised">
<!-- <img src="{{campus.avatar_url}}" style = "width:14%; height:auto;"> -->
{{project.title}}
{{task.title}}
</md-button>
</div>
</div>