From 1e6e3f24f2a45b88e9a2dec861b5ffdafda4682d Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Mon, 22 Jun 2015 13:06:56 +0300 Subject: [PATCH] -DashBoard pattern and messages - fixed -Project evaluation pattern - added --- templates/css/theme.css | 39 ++++- templates/js/app.js | 4 + templates/js/controllers/homeController.js | 32 ++-- templates/js/controllers/mainController.js | 2 +- templates/js/services/apiService.js | 30 +++- templates/views/home.html | 169 ++++++++++++++++++--- templates/views/index.html | 2 + templates/views/register.html | 4 +- 8 files changed, 240 insertions(+), 42 deletions(-) diff --git a/templates/css/theme.css b/templates/css/theme.css index 45b271e..092a58a 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -380,6 +380,36 @@ body.noscroll padding: 20px; } +.projectExhibit +{ + padding-left: 4px; + padding-right: 4px; + margin: 5px; + background-color: aliceblue; + overflow: scroll; + overflow-y: visible; + height:250; + width:300; +} +.projectDropDown +{ + border: 10px; + border-color: solid red; +} + +.addMessage +{ + font-size: 2em; +} +.tasksContent +{ + word-break: break-word; +} +.messagesContent .msgSent +{ + word-break: break-word; +} + .tasksContent { padding-left: 4px; @@ -387,8 +417,9 @@ body.noscroll margin: 5px; background-color: aliceblue; overflow: scroll; + overflow-y: visible; height:250; - width:500; + width:340; } .messagesContent { @@ -398,13 +429,13 @@ body.noscroll background-color: #f5f5f5; overflow: scroll; height:250; - width:500; + width:690; } p.tasksFeed { padding-left: 4px; margin: 5px; - width:500; + width:340; height: auto; background-color: aliceblue; @@ -413,7 +444,7 @@ p.messagesFeed { padding-left: 4px; margin: 5px; - width:500; + width:690; height: auto; background-color: #f5f5f5; } \ No newline at end of file diff --git a/templates/js/app.js b/templates/js/app.js index 3a9b514..bc9bd78 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -45,6 +45,10 @@ app.config(['$routeProvider', '$locationProvider', .when('/tasks', { templateUrl: 'templates/views/tasks.html', controller: 'tasksController' + }) + .when('/myClasses', { + templateUrl: 'templates/views/myClasses.html', + controller: 'myClassesController' }); } ]); diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 2e1b19d..9a13dbb 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -5,6 +5,7 @@ angular.module('SeHub') $scope.addMsg = false; $scope.msgToPost = ""; $scope.oldText = ""; + $scope.messages = []; var imagePath = $scope.user.avatar_url; $scope.phones = [ @@ -28,24 +29,37 @@ angular.module('SeHub') $scope.addMsg = true; // Reveal the "POST" Button } - $scope.postMessageClicked = function(msg) // Posting the message itself + $scope.msg = {}; + $scope.postMessageClicked = function() // Posting the message itself { - if(msg != null) + if($scope.msg.msgToAdd != null) { - $scope.prevText = "- " + msg; - implementText = document.getElementById("msg").value; - $scope.prevText += "

"; - document.getElementById("bindText").innerHTML += $scope.prevText; + console.log($scope.msg.msgToAdd); + $scope.messages.push({"text": $scope.msg.msgToAdd}); } - document.getElementById("msg").value = ''; - $scope.prevText = ''; + $scope.msg.msgToAdd = null; } $scope.clearAllClicked = function() // Clear Screen from text { - document.getElementById("bindText").innerHTML = ""; + $scope.messages = []; } + $scope.chooseCourseClicked = function() + { + console.log("choose course Clicked!!"); + + + } + + $scope.chooseProjectClicked = function() + { + console.log("choose project Clicked!!"); + + } + + + // animation $scope.isEnterd = top.setIsEnterd; }]); \ No newline at end of file diff --git a/templates/js/controllers/mainController.js b/templates/js/controllers/mainController.js index f2eb0b4..8d6e5ba 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -43,7 +43,7 @@ angular.module('SeHub') "title": "My Classes", "icon": "fa fa-graduation-cap", "style": "", - "route": "/campuses" + "route": "/myClasses" }, { "title": "My Projects", "icon": "fa fa-cube", diff --git a/templates/js/services/apiService.js b/templates/js/services/apiService.js index d07e1f1..276fa04 100644 --- a/templates/js/services/apiService.js +++ b/templates/js/services/apiService.js @@ -17,7 +17,6 @@ service.factory('apiService', ['$http', function($http) { req = { method : "GET", url : url - }; return $http(req); }, @@ -26,13 +25,11 @@ service.factory('apiService', ['$http', function($http) { payload = { email: email }; - req = { method: "POST", url: url, data: payload }; - return $http(req); }, updateUser: function(token, payLoad){ @@ -44,6 +41,33 @@ service.factory('apiService', ['$http', function($http) { data: payLoad }; return $http(req); + }, + getAllCourses: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAll/" + token; + req = { + method : "GET", + url : url + + }; + return $http(req); + }, + getAllMessages: function(token){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getAllMessages/" + token; + req = { + method : "GET", + url : url + + }; + return $http(req); + }, + getCourseMessages: function(token, courseName){ + var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCourseMessages/" + token + '/' + courseName; + req = { + method : "GET", + url : url + + }; + return $http(req); } }; }]); \ No newline at end of file diff --git a/templates/views/home.html b/templates/views/home.html index cd2fc49..53e6fd5 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -1,8 +1,8 @@ -
+
- +
@@ -22,27 +22,55 @@
+ +

Dash Board

+
- -
-
+ +
+

Messages

-
+

Tasks

-
-
+
+
-

+
+ +
+
+
+ +
+
+
+
+ {{user.name}} +
+
+ class_name +
+
+
+
+
+
+ {{msg.text}} +
+
+
+
+
-
+

For Task 3 Press: Task #3 @@ -60,43 +88,129 @@

-
- Add Message +
+
- Post + Post Clear All
- +
+ + +

+ Project Evaluation +

+ + +
+
+ + a + a + a + + + s + s + s + + + d + d + d + +
+
+ + e + e + e + + + q + q + q + + + w + w + w + +
+
+ + b + b + b + + + r + r + r + + + x + x + x + +
+
+
- -
-
+ +
+

Messages

-
+

Tasks

-
-
+
+
-

+
+ +
+
+
+ +
+
+
+
+ {{user.name}} +
+
+ class_name +
+
+
+
+
+
+ {{msg.text}} +
+
+
+
+
-
+

For Task 3 Press: Task #3 @@ -104,11 +218,20 @@ For Task 4 Press: Task #4

For Task 5 Press: Task #5 +

+ For Task 6 Press: Task #6 +

+ For Task 7 Press: Task #7 +

+ For Task 8 Press: Task #8

-
+ + + +
\ No newline at end of file diff --git a/templates/views/index.html b/templates/views/index.html index f1fef9e..f86b52b 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -100,6 +100,8 @@ + + \ No newline at end of file diff --git a/templates/views/register.html b/templates/views/register.html index 7d4d967..4fd5255 100644 --- a/templates/views/register.html +++ b/templates/views/register.html @@ -19,7 +19,7 @@

Are You A Lecturer?

- +
@@ -45,7 +45,7 @@