From 8aae6ab8693143a96faa0abfc22c1656e3cbe97d Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 20:28:20 +0300 Subject: [PATCH 1/3] - myProject - location path fixed --- templates/js/controllers/myProjectsController.js | 10 +--------- templates/views/myProjects.html | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/templates/js/controllers/myProjectsController.js b/templates/js/controllers/myProjectsController.js index c55bf1d..9ca67a8 100644 --- a/templates/js/controllers/myProjectsController.js +++ b/templates/js/controllers/myProjectsController.js @@ -25,19 +25,11 @@ angular.module('SeHub') { console.log("Error: " + err.message); }); - } $scope.goToProject = function(projectId) { - for (var i = 0; i < $scope.myProjects; i++) - { - if($scope.myProjects.id === projectId) - { - console.log("project ID: " + projectId) - $location.path('/project/' + projectId); - } - }; + $location.path('/project/' + projectId); } var init = function() diff --git a/templates/views/myProjects.html b/templates/views/myProjects.html index 895d0cc..28d2a14 100644 --- a/templates/views/myProjects.html +++ b/templates/views/myProjects.html @@ -13,7 +13,7 @@
-

{{project.projectName}}

+ {{project.projectName}}
@@ -24,7 +24,7 @@ -

{{project.projectName}}

+ {{project.projectName}}
From 23e8780dd67761d398e20ab6a2eb8ce513f4d51f Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 20:33:23 +0300 Subject: [PATCH 2/3] - patterns in explor - fixed --- templates/views/myClasses.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index 9883a0e..fa25a4d 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -8,20 +8,20 @@
- +

{{course.courseName}}

- +
- +

{{course.courseName}}

- +
From ab35e946c0193a35af8dfa1ecc4a844723642c50 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 29 Jun 2015 21:01:30 +0300 Subject: [PATCH 3/3] - goldMINE!!! -location reference fixed --- templates/js/app.js | 2 +- templates/js/controllers/classController.js | 9 ++++----- templates/js/controllers/myClassesController.js | 9 +++++---- templates/views/myClasses.html | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/js/app.js b/templates/js/app.js index 7fcca2e..338d7af 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -54,7 +54,7 @@ app.config(['$routeProvider', '$locationProvider', templateUrl: 'templates/views/newTask.html', controller: 'newTasksController' }) - .when('/class/:projectId', { + .when('/class/:classId/:className', { templateUrl: 'templates/views/class.html', controller: 'classController' }) diff --git a/templates/js/controllers/classController.js b/templates/js/controllers/classController.js index e7e13ae..397890a 100644 --- a/templates/js/controllers/classController.js +++ b/templates/js/controllers/classController.js @@ -2,19 +2,18 @@ angular.module('SeHub') .controller('classController', ['$scope', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { var token = $cookies['com.sehub.www']; - var classId = $routeParams.projectId; - // var projectId = ""; + var classId = $routeParams.classId; + $scope.project = {}; + $scope.project.courseName = $routeParams.className; $scope.projectsEmpty = true; $scope.isCreateProjectClicked = false; $scope.submitNewCourseClicked = false; - $scope.project = {}; $scope.loadingData = true; $scope.isInCourse = false; - $scope.project.courseName = classId; + $scope.displayProjects = function() { - console.log("in displayProjecs!!! "); apiService.getProjectsByCourse(token, classId).success(function(data) // Get all the campuses { $scope.loadingData = false; diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index 627631f..5ccfd82 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -15,10 +15,10 @@ angular.module('SeHub') $scope.campusId; var campusId = $routeParams.campusId; - $scope.goToClass = function(classId) + $scope.goToClass = function(classId, className) { - console.log("Done! " + $scope.courses); - $location.path('/class/' + classId.toString()); // Will display all the projects in this course + console.log("Done! " + className); + $location.path('/class/' + classId.toString() + '/' + className); // Will display all the projects in this course } $scope.chooseCampusClicked = function() @@ -82,7 +82,8 @@ angular.module('SeHub') $mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.') .ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent()) .then(function() { - $location.path('/newCourse'); // TODO TODO TODO + // $location.path('/newCourse'); // TODO TODO TODO + $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course }); // Pop-up alert }).error(function(err) { diff --git a/templates/views/myClasses.html b/templates/views/myClasses.html index fa25a4d..869e6e5 100644 --- a/templates/views/myClasses.html +++ b/templates/views/myClasses.html @@ -7,7 +7,7 @@
- +

{{course.courseName}}

@@ -16,7 +16,7 @@
- +

{{course.courseName}}