- Campuses -> Courses -> Projects

-* waiting for merge to get API from server
This commit is contained in:
Matan Bar Yosef 2015-06-24 21:35:21 +03:00
parent b19b60b58b
commit 0cce80ed98
10 changed files with 144 additions and 153 deletions

View file

@ -197,6 +197,18 @@ body.noscroll
border-radius: 1px black solid; border-radius: 1px black solid;
}*/ }*/
.allCampusesShow
{
overflow:hidden;
background-size: auto;
}
.campusCard
{
/*height:80%;*/
/*width:80%;*/
}
.gray-font .gray-font
{ {
color: #7f7f7f; color: #7f7f7f;
@ -397,6 +409,11 @@ body.noscroll
border-color: solid red; border-color: solid red;
} }
.cardAllCampuses
{
word-break: break-word;
}
.addMessage .addMessage
{ {
font-size: 2em; font-size: 2em;

View file

@ -61,6 +61,10 @@ app.config(['$routeProvider', '$locationProvider',
.when('/newCourse', { .when('/newCourse', {
templateUrl: 'templates/views/newCourse.html', templateUrl: 'templates/views/newCourse.html',
controller: 'newCourseController' controller: 'newCourseController'
})
.when('/campuses', {
templateUrl: 'templates/views/campuses.html',
controller: 'campusesController'
}); });
} }
]); ]);

View file

@ -35,13 +35,13 @@ angular.module('SeHub')
console.log("Student Mode!"); console.log("Student Mode!");
} }
// apiService.getCourseByCampusName($scope.user.classes_id_list[0]).success(function(data) // apiService.getCourseByCampusName(token).success(function(data)
// { // {
// console.log("Campus Name is ON! " + $scope.user.classes_id_list[0]) // console.log("Campus Name is ON! " + token)
// $scope.course = data; // $scope.course = data;
// }).error(function() // }).error(function(err)
// { // {
// console.log("Error on ===> getCourseByCampusName") // console.log("Error ===> " + err + " ===> getCourseByCampusName")
// }); // });

View file

@ -5,7 +5,6 @@ angular.module('SeHub')
$scope.isCourse = false; $scope.isCourse = false;
$scope.isNewCourse = false; $scope.isNewCourse = false;
$scope.newClassName = false; $scope.newClassName = false;
// $scope.course.courseName = '';
$scope.course = {}; $scope.course = {};
var token = $cookies['com.sehub.www']; var token = $cookies['com.sehub.www'];
$scope.user.finalDate = ''; $scope.user.finalDate = '';
@ -24,6 +23,17 @@ angular.module('SeHub')
} }
$scope.courses = ['SE', 'PC', 'Math', 'Calculus', 'Ivrit', 'English', 'Drugs'];
// apiService.getClassesByUser(token).success(function(data) // Get all the campuses
// {
// $scope.courses = data;
// }).error(function() {
// // TODO
// });
$scope.chooseCourseClicked = function() $scope.chooseCourseClicked = function()
{ {
$scope.isCourse = true; $scope.isCourse = true;
@ -32,15 +42,7 @@ angular.module('SeHub')
$scope.createCourseClicked = function() $scope.createCourseClicked = function()
{ {
$scope.isNewCourse = true; $scope.isNewCourse = !$scope.isNewCourse;
$scope.showMyClass = false;
console.log("create course Clicked!!");
}
$scope.showMyCourses = function()
{
$scope.showMyClass = true;
$scope.isNewCourse = false;
} }
$scope.submitNewClassClicked = function() $scope.submitNewClassClicked = function()
@ -74,8 +76,10 @@ angular.module('SeHub')
console.log(err); console.log(err);
}); });
$mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.') $mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.')
.ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent()); .ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent())
// $window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO .then(function() {
$window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO
}); // Pop-up alert
} }
else else

View file

@ -10,7 +10,14 @@ angular.module('SeHub')
} }
$scope.projects = ['AMI', 'LULU', 'XIN Zhau', 'LUMI lu', 'Shimi', 'Azligi zligi', 'Drugs'];
// apiService.getProjectsByCourse(courseId).success(function(data) // Get all the campuses
// {
// $scope.projects = data;
// }).error(function() {
// // TODO
// });
}]); }]);

View file

@ -96,6 +96,34 @@ service.factory('apiService', ['$http', function($http) {
url : url, url : url,
data: payLoad data: payLoad
};
return $http(req);
},
getCampusesByUser: function(){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCampusesByUser/" + token;
req = {
method : "GET",
url : url
};
return $http(req);
},
},
getClassesByCourse: function(){ // Need to add camusName (ngRoute) ~ sagi //TODO
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/ClassesByCourse/" + token;
req = {
method : "GET",
url : url
};
return $http(req);
},
getProjectsByCourse: function(){ // Need to add courseID (ngRoute) ~ sagi //TODO
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getProjectByCourse/" + token;
req = {
method : "GET",
url : url
}; };
return $http(req); return $http(req);
} }

View file

@ -116,6 +116,7 @@
<script src="templates/js/controllers/newTasksController.js"></script> <script src="templates/js/controllers/newTasksController.js"></script>
<script src="templates/js/controllers/projectsController.js"></script> <script src="templates/js/controllers/projectsController.js"></script>
<script src="templates/js/controllers/newCourseController.js"></script> <script src="templates/js/controllers/newCourseController.js"></script>
<script src="templates/js/controllers/campusesController.js"></script>
</body> </body>
</html> </html>

View file

@ -2,29 +2,35 @@
<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> <h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1>
</md-content> </md-content>
<md-card flex = "99" class="cardAllcourses">
<div flex class = "allcoursesShow" ><!-- layout = "column"> -->
<div flex layout = "row" ng-repeat = "course in courses" value = "{{course}}" layout-padding>
<a href="http://localhost:8080/home#/projects" style="color:black; text-decoration:none;">
<md-card layout-padding flex class = "campusCard">
{{course}}
</md-card>
</a>
</div>
</div>
</md-card>
<div ng-if="user.isLecturer"> <!-- Lecturer Mode --> <div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
<div layout="row"> <div layout="row">
<div layout-margin layout-padding> <div layout-margin layout-padding>
<md-button ng-click="createCourseClicked()" ng class="md-raised md-primary">Create Class</md-button> <md-button ng-click="createCourseClicked()" ng class="md-raised md-primary">Create Class</md-button>
</div> </div>
<div layout-margin layout-padding>
<md-button ng-click="showMyCourses()" ng class="md-raised md-primary">Show My Classes</md-button>
</div>
</div> </div>
<div ng-if="isNewCourse"> <div ng-if="isNewCourse">
<md-content> <md-content>
<md-content layout-padding layout="row" layout-sm="column">
<md-input-container>
<label>User Name</label>
<input ng-model="user.name">
</md-input-container>
<md-input-container>
<label>Email</label>
<input ng-model="user.email" type="email">
</md-input-container>
</md-content>
<md-content layout-padding> <md-content layout-padding>
<md-card layout-padding>
<form name="createNewCourseForm"> <form name="createNewCourseForm">
<div layout layout-sm="column">
<md-input-container flex = "50">
<label>Campus name</label>
<input ng-model="course.campusName" required>
</md-input-container>
</div>
<div layout layout-sm="column"> <div layout layout-sm="column">
<md-input-container style="width:80%"> <md-input-container style="width:80%">
<label flex = "50">Class Name</label> <label flex = "50">Class Name</label>
@ -39,13 +45,8 @@
<input type="date" ng-model="course.endDate" required> <input type="date" ng-model="course.endDate" required>
</md-input-container> </md-input-container>
</div> </div>
<div layout layout-sm="column">
<md-input-container flex = "50">
<label>Campus name</label>
<input ng-model="course.campusName">
</md-input-container>
</div>
</form> </form>
</md-card>
</md-content> </md-content>
<div layout-padding layout-margin> <div layout-padding layout-margin>
<md-button ng-click="submitNewClassClicked()" class="md-raised md-primary">Submit New Class</md-button> <md-button ng-click="submitNewClassClicked()" class="md-raised md-primary">Submit New Class</md-button>
@ -57,91 +58,6 @@
<md-option ng-repeat="c in courses" value="{{c.course}}">{{c.course}}</md-option> <md-option ng-repeat="c in courses" value="{{c.course}}">{{c.course}}</md-option>
</md-select> </md-select>
</div> </div>
<!-- <md-content>
<div layout="row">
<div flex="65">
<md-card>
<p class = "messagesFeed">Messages</p>
</md-card>
</div>
<div flex="34">
<md-card>
<p class = "tasksFeed">Tasks</p>
</md-card>
</div>
</div>
<div layout="row">
<div flex="65">
<md-card>
<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-card>
</div>
<div flex="34">
<md-card>
<p class = "tasksContent">
For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
<br></br>
For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a>
<br></br>
For Task 5 Press: <a href="http://localhost:8080/home#/home">Task #5</a>
<br></br>
For Task 6 Press: <a href="http://localhost:8080/home#/home">Task #6</a>
<br></br>
For Task 7 Press: <a href="http://localhost:8080/home#/home">Task #7</a>
<br></br>
For Task 8 Press: <a href="http://localhost:8080/home#/home">Task #8</a>
</p>
</md-card>
</div>
</div>
<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>
</div>
<div ng-if="addMsg">
<md-select placeholder="Choose Course" ng-model="course" ng-click="chooseCourseClicked()" class="courseDropDown">
<md-option ng-repeat="c in courses" value="{{c.course}}">{{c.course}}</md-option>
</md-select>
</div>
</div>
<div ng-if="addMsg">
<div layout = "row" layout-margin layout padding layout-align = "left center">
<md-button ng-click="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>
<md-button ng-click="clearAllClicked()" ng class="md-raised md-primary">Clear All</md-button>
</div>
<div class="port_spacer"></div>
<md-input-container>
<label> Write Your Desired Message Here And Press Post</label>
<input type="text" minlength="1" ng-model="msg.msgToAdd" required>
</md-input-container>
</div>
</md-content> -->
</div> </div>
<div ng-if="isStudent"> <!-- Student Mode --> <div ng-if="isStudent"> <!-- Student Mode -->

View file

@ -1,6 +1,20 @@
<div class = "projects"> <div class = "projects">
<h1 style="margin-left:15px"><i class="fa fa-cube"></i> Projects</h1>
<md-card flex = "99" class="cardAllProjects">
<div flex class = "allProjectsShow" layout = "column">
<div flex layout = "row" ng-repeat = "project in projects" value = "{{project}}" layout-padding>
<a href="http://localhost:8080/home#/home" style="color:black; text-decoration:none;">
<md-card layout-padding flex class = "projectCard">
{{project}}
</md-card>
</a>
</div>
</div>
</md-card>
<md-content layout-padding layout-margin> <md-content layout-padding layout-margin>
<h1 style="margin-left:15px"><i class="fa fa-file-cube-o"></i> Projects</h1>
<md-button ng-click="createProjectClicked()" ng class="md-raised md-primary">Create Project</md-button> <md-button ng-click="createProjectClicked()" ng class="md-raised md-primary">Create Project</md-button>
</md-content> </md-content>
</div> </div>