From 44aaa5c08f24674e2aaad4454e93256d33b279cd Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Mon, 22 Jun 2015 13:04:21 +0300 Subject: [PATCH] Fixing A BAAAD Commit --- templates/css/theme.css | 162 ++++++++++++------ templates/js/app.js | 11 +- templates/js/controllers/homeController.js | 102 +++++------ templates/js/controllers/mainController.js | 2 +- .../js/controllers/registerController.js | 4 +- .../js/controllers/settingsController.js | 17 +- templates/views/home.html | 130 +++++++++----- templates/views/index.html | 13 ++ templates/views/settings.html | 6 + 9 files changed, 282 insertions(+), 165 deletions(-) diff --git a/templates/css/theme.css b/templates/css/theme.css index 00e4f28..45b271e 100644 --- a/templates/css/theme.css +++ b/templates/css/theme.css @@ -33,9 +33,9 @@ md-list .md-button { https://github.com/google/material-design-icons */ -p { +/*p { margin-left: 2em; -} +}*/ .menuBtn { background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) no-repeat center center; @@ -76,28 +76,21 @@ body.noscroll margin-top: 1em; margin-right: 1em; position: center; - -webkit-border-radius: 30%; -moz-border-radius: 30%; border-radius: 30%; - - } -/*.avatar { - background: rgba(0, 0, 0, 0.2); - }*/ - - .avatar img { - border-radius: 40px; - position:center; - width: 80px; - height: 80px; - margin: 6px; /*centers the image in the parent element */ - -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); - -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); - box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); - } +.avatar img { + border-radius: 40px; + position:center; + width: 80px; + height: 80px; + margin: 6px; + -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); + -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); + box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75); +} /* Added BY devMatan */ @@ -111,14 +104,8 @@ body.noscroll }*/ - .campusAvatar img - { -/* - margin-top: 1em; - margin-right: 1em; - position: center; - */ - +.campusAvatar img +{ border-radius: 40px; position:center; width: 80px; @@ -157,9 +144,24 @@ body.noscroll margin-bottom: 10px; } -.md-avatar img +.feed { - /*TODO*/ + overflow-y: scroll; + height: 350px; + /*width: 100%;*/ +} + +/*.feedMessages +{ + overflow: scroll; + height: 300px; + width: 100%; +} +.feedTasks +{ + overflow: scroll; + height: 300px; + width: 100%; } .feedContent @@ -167,7 +169,7 @@ body.noscroll padding-left: 6%; font-size: 15px; display:table; -} +}*/ .md-no-sticky { @@ -181,7 +183,6 @@ body.noscroll border-radius: 150px; -webkit-border-radius: 150px; -moz-border-radius: 150px; - /*background: url(http://i61.tinypic.com/v86f7.png) no-repeat;*/ box-shadow: 0 0 8px rgba(0, 0, 0, .8); -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .8); -moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8); @@ -256,7 +257,6 @@ body.noscroll -moz-border-radius: 100px; border-radius: 50px; width: 30%; - /*top: -40px;*/ position: relative; z-index: 50; } @@ -282,8 +282,17 @@ body.noscroll font-weight: bold; cursor: pointer; } - .se-menu li .selected{ + + .se-menu li:active{ + background-color: #B2B2B2; + text-shadow:#e0e0e0 1px 1px 0; + font-weight: bold; + } + + .se-menu .selected{ background-color: #E2E2E2; + text-shadow:#e0e0e0 1px 1px 0; + font-weight: bold; } .user-box{ @@ -293,7 +302,6 @@ body.noscroll .user-box img{ width: 100%; border: 4px #7f7f7f solid; - -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; @@ -342,26 +350,70 @@ body.noscroll } -/* md-list-item .md-no-style.md-button, md-list-item.md-no-proxy.md-button { - font-size: inherit; - height: inherit; - text-align: left; - text-transform: none; - width: 100%; - white-space: normal; +/* Colors*/ +.gray{ + background:#f5f5f5; +} +.aliceblue { + background: aliceblue; +} + .green { + background: #b9f6ca; +} + .yellow { + background: #ffff8d; +} + .blue { + background: #84ffff; +} + .purple { + background: #b388ff; +} + .red { + background: #ff8a80; +} +/* End Colors */ + +.whiteframedemoBasicUsage md-whiteframe { + background: #fff; + margin: 20px; + padding: 20px; } -md-list-item, md-list-item .md-list-item-inner { - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-justify-content: flex-start; - -ms-flex-pack: start; - justify-content: flex-start; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - min-height: 48px; - }*/ - -/*End Effects for MD*/ +.tasksContent +{ + padding-left: 4px; + padding-right: 4px; + margin: 5px; + background-color: aliceblue; + overflow: scroll; + height:250; + width:500; +} +.messagesContent +{ + padding-left: 4px; + padding-right: 4px; + margin: 5px; + background-color: #f5f5f5; + overflow: scroll; + height:250; + width:500; +} +p.tasksFeed +{ + padding-left: 4px; + margin: 5px; + width:500; + height: auto; + background-color: aliceblue; + +} +p.messagesFeed +{ + padding-left: 4px; + margin: 5px; + width:500; + height: auto; + background-color: #f5f5f5; +} \ No newline at end of file diff --git a/templates/js/app.js b/templates/js/app.js index 86cbcc1..4511b58 100644 --- a/templates/js/app.js +++ b/templates/js/app.js @@ -2,7 +2,7 @@ var DEBUG = true; var welcome = angular.module('welcome', ['ngMaterial', 'seHub.services', 'ngRoute' , 'ngCookies']); -var app = angular.module('SeHub', ['ngMaterial', 'ngRoute', 'seHub.services', 'ngCookies']); +var app = angular.module('SeHub', ['ngMaterial', 'ngRoute', 'seHub.services', 'ngCookies', 'chart.js']); welcome.config(function($mdThemingProvider) { @@ -41,8 +41,15 @@ app.config(['$routeProvider', '$locationProvider', .when('/Settings', { templateUrl: 'templates/views/settings.html', controller: 'settingsController' + }) + .when('/tasks', { + templateUrl: 'templates/views/tasks.html', + controller: 'tasksController' + }) + .when('/tasks/new', { + templateUrl: 'templates/views/newTask.html', + controller: 'newTasksController' }); - } ]); diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 009a4f5..2e1b19d 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -1,71 +1,51 @@ angular.module('SeHub') .controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { - var imagePath = $scope.user.avatar_url; - $scope.phones = [ - { type: 'Home', number: '(972) 865-82861' }, - { type: 'Cell', number: '(972) 5251-32309' }, - ]; + $scope.isStudent = false; + $scope.addMsg = false; + $scope.msgToPost = ""; + $scope.oldText = ""; - $scope.messages = [ - { - face : imagePath, - what: 'I need to go to luna-park', - who: 'Matan Bar Yosef', - when: '3:08PM', - notes: " Lets do something" - }, - { - face : imagePath, - what: 'Lets Lets Lets', - who: 'Matan Bar Yosef', - when: '4:33PM', - notes: " Lets go drink something" - }, - { - face : imagePath, - what: 'Let me tell you a secret', - who: 'Sagi Dayan', - when: '4:15PM', - notes: " I am S'ein" - }, - { - face : imagePath, - what: 'Listen to this!', - who: 'Aran Zaiger', - when: '6:15PM', - notes: " I am gaylord ultima!!" - }, - { - face : imagePath, - what: 'Hi?', - who: 'Etye Meyer', - when: '7:45AM', - notes: " I am mega gaylord ultima" - } - ]; + var imagePath = $scope.user.avatar_url; + $scope.phones = [ + { type: 'Home', number: '(972) 865-82861' }, + { type: 'Cell', number: '(972) 5251-32309' }, + ]; - $scope.tasks = [ - { - ExNum: '1', - dueDate: '23/06/15', - notes: " Build A Game: Scrabble" - }, - { - ExNum: '3', - dueDate: '30/06/15', - notes: " Static Array" - }, - { - ExNum: '4', - dueDate: '07/07/15', - notes: " Dynamic Array" - }, - ]; + if($scope.user.isLecturer) + { + $scope.isStudent = false; + console.log("Lecturer Mode!"); + } + else + { + $scope.isStudent = true; + console.log("Student Mode!"); + } + $scope.addMessageClicked = function() + { + $scope.addMsg = true; // Reveal the "POST" Button + } + $scope.postMessageClicked = function(msg) // Posting the message itself + { + if(msg != null) + { + $scope.prevText = "- " + msg; + implementText = document.getElementById("msg").value; + $scope.prevText += "

"; + document.getElementById("bindText").innerHTML += $scope.prevText; + } + document.getElementById("msg").value = ''; + $scope.prevText = ''; + } + $scope.clearAllClicked = function() // Clear Screen from text + { + document.getElementById("bindText").innerHTML = ""; + } - // animation - $scope.isEnterd = top.setIsEnterd; + // 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 1f175ab..f2eb0b4 100644 --- a/templates/js/controllers/mainController.js +++ b/templates/js/controllers/mainController.js @@ -53,7 +53,7 @@ angular.module('SeHub') "title": "Tasks", "icon": "fa fa-clipboard", "style": "", - "route": "/campuses" + "route": "/tasks" }, { "title": "Settings", "icon": "fa fa-cogs", diff --git a/templates/js/controllers/registerController.js b/templates/js/controllers/registerController.js index 071096c..6ce4d08 100644 --- a/templates/js/controllers/registerController.js +++ b/templates/js/controllers/registerController.js @@ -83,7 +83,7 @@ angular.module('SeHub') console.log("DONE - 200"); $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification - // TODO ADD delete cookies and redirect only after pressed 'Got it' + // TODO ADD- delete cookies and redirect only after pressed 'Got it' $cookieStore.remove("com.sehub.www"); // Removing the cookies $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page }).error(function() @@ -117,8 +117,6 @@ angular.module('SeHub') var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if (!result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked { - console.log(email + ", Error in email, should alert"); - // alert('Please provide a valid e-mail address'); $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); } diff --git a/templates/js/controllers/settingsController.js b/templates/js/controllers/settingsController.js index 81a4a98..35c9531 100644 --- a/templates/js/controllers/settingsController.js +++ b/templates/js/controllers/settingsController.js @@ -35,7 +35,13 @@ angular.module('SeHub') $scope.profileMode = "Save Profile"; $scope.profileModeIcon = "fa fa-floppy-o"; } else { - dataService.userBrodcast($scope.user); + apiService.updateUser(token, $scope.user).success(function(data) { + console.info('User Saved'); + dataService.userBrodcast($scope.user); + + }).error(function(e) { + console.error('Fail To Save User'); + }); $scope.profileMode = "Edit Profile"; $scope.profileModeIcon = "fa fa-pencil"; } @@ -74,5 +80,14 @@ angular.module('SeHub') }]; + $scope.labels = ['Commits', 'Issues Assigned', 'Messages', 'Open Tasks']; + $scope.series = ['Project A', 'Project B']; + + $scope.data = [ + [54, 3, 15, 3], + [28, 48, 40, 3] + ]; + + } ]); \ No newline at end of file diff --git a/templates/views/home.html b/templates/views/home.html index 7b2fc30..cd2fc49 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -22,47 +22,93 @@ - - -
-
- Messages - -
- {{item.who}} - - -
-

- -

{{ item.who }}

-
{{ item.what }}
-
{{ item.notes }}
-
{{ item.when }}
-
-
-
+
+ +
+
+ +

Messages

+
+
+
+ +

Tasks

+
+
- -
-
-
- - - - Tasks - - -
- -
Ex: {{ item.ExNum }}
-
Task Title: {{ item.notes }}
-
Due Date: {{ item.dueDate }}
-
-
-
-
-
-
- +
+
+ +

+
+
+
+ +

+ For Task 3 Press: Task #3 +

+ 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 +

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

Messages

+
+
+
+ +

Tasks

+
+
+
+
+
+ +

+
+
+
+ +

+ For Task 3 Press: Task #3 +

+ For Task 4 Press: Task #4 +

+ For Task 5 Press: Task #5 +

+ +
+
+
+
+
\ No newline at end of file diff --git a/templates/views/index.html b/templates/views/index.html index c683489..9599164 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -6,6 +6,10 @@ + + + + @@ -79,6 +83,14 @@ + + + + + + + + @@ -88,6 +100,7 @@ + \ No newline at end of file diff --git a/templates/views/settings.html b/templates/views/settings.html index 7f07403..c90b019 100644 --- a/templates/views/settings.html +++ b/templates/views/settings.html @@ -55,6 +55,12 @@
+ +

+ Statistics: +

+