- create course - added

- show my classes - added
This commit is contained in:
Matan Bar Yosef 2015-06-23 19:04:41 +03:00
parent 5a118075c4
commit 1d5655b056
6 changed files with 42 additions and 8 deletions

View file

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

View file

@ -6,17 +6,28 @@ angular.module('SeHub')
$scope.msgToPost = ""; $scope.msgToPost = "";
$scope.oldText = ""; $scope.oldText = "";
$scope.messages = []; $scope.messages = [];
$scope.msg = {};
$rootScope.seToken = $cookies['com.sehub.www'];
var token = $rootScope.seToken;
var imagePath = $scope.user.avatar_url; var imagePath = $scope.user.avatar_url;
//var campusName = '';
$scope.course = '';
// $scope.campusName = '';
$scope.phones = [ $scope.phones = [
{ type: 'Home', number: '(972) 865-82861' }, { type: 'Home', number: '(972) 865-82861' },
{ type: 'Cell', number: '(972) 5251-32309' }, { type: 'Cell', number: '(972) 5251-32309' },
]; ];
if($scope.user.isLecturer) if($scope.user.isLecturer)
{ {
$scope.isStudent = false; $scope.isStudent = false;
console.log("Lecturer Mode!"); console.log("Lecturer Mode!");
// console.log($scope.campusName);
} }
else else
{ {
@ -24,12 +35,20 @@ angular.module('SeHub')
console.log("Student Mode!"); console.log("Student Mode!");
} }
// apiService.getCourseByCampusName($scope.user.classes_id_list[0]).success(function(data)
// {
// console.log("Campus Name is ON! " + $scope.user.classes_id_list[0])
// $scope.course = data;
// }).error(function()
// {
// console.log("Error on ===> getCourseByCampusName")
// });
$scope.addMessageClicked = function() $scope.addMessageClicked = function()
{ {
$scope.addMsg = true; // Reveal the "POST" Button $scope.addMsg = true; // Reveal the "POST" Button
} }
$scope.msg = {};
$scope.postMessageClicked = function() // Posting the message itself $scope.postMessageClicked = function() // Posting the message itself
{ {
if($scope.msg.msgToAdd != null) if($scope.msg.msgToAdd != null)
@ -48,14 +67,11 @@ angular.module('SeHub')
$scope.chooseCourseClicked = function() $scope.chooseCourseClicked = function()
{ {
console.log("choose course Clicked!!"); console.log("choose course Clicked!!");
} }
$scope.chooseProjectClicked = function() $scope.chooseProjectClicked = function()
{ {
console.log("choose project Clicked!!"); console.log("choose project Clicked!!");
} }

View file

@ -26,7 +26,7 @@ angular.module('SeHub')
if($scope.user.name === ";") if($scope.user.name === ";")
{ {
$scope.user.name = ""; $scope.user.name = "";
$scope.user.name = $scope.user.username $scope.user.name = $scope.user.username;
$scope.userHasNoName = true; $scope.userHasNoName = true;
} }

View file

@ -1,3 +1,4 @@
var DEBUG = true; var DEBUG = true;
var service = angular.module('seHub.services', []); var service = angular.module('seHub.services', []);
@ -42,6 +43,16 @@ service.factory('apiService', ['$http', function($http) {
}; };
return $http(req); return $http(req);
}, },
getCourseByCampusName: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token;
req = {
method : "GET",
url : url,
data: token
};
return $http(req);
},
getAllCourses: function(token){ getAllCourses: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token; var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token;
req = { req = {

View file

@ -88,9 +88,11 @@
</md-card> </md-card>
</div> </div>
</div> </div>
<div class ="addMessage" layout-margin layout padding> <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> <md-button ng-click="addMessageClicked()" ng class="md-raised md-primary"><i class="fa fa-comments"></i></md-button>
</div> </div>
</div>
<div ng-if="addMsg"> <div ng-if="addMsg">
<div layout = "row" layout-margin layout padding layout-align = "left center"> <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="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>

View file

@ -115,6 +115,7 @@
<script src="templates/js/controllers/myClassesController.js"></script> <script src="templates/js/controllers/myClassesController.js"></script>
<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>
</body> </body>
</html> </html>