Merge pull request #50 from sagidayan/UI

- Add message for lecturer - ADDED
This commit is contained in:
Sagi Dayan 2015-06-20 16:25:07 +03:00
commit 19aa25de2a
4 changed files with 168 additions and 140 deletions

View file

@ -33,9 +33,9 @@ md-list .md-button {
https://github.com/google/material-design-icons https://github.com/google/material-design-icons
*/ */
p { /*p {
margin-left: 2em; margin-left: 2em;
} }*/
.menuBtn { .menuBtn {
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) no-repeat center center; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) no-repeat center center;
@ -147,7 +147,7 @@ body.noscroll
.feed .feed
{ {
overflow-y: scroll; overflow-y: scroll;
height: 300px; height: 350px;
/*width: 100%;*/ /*width: 100%;*/
} }
@ -349,17 +349,11 @@ body.noscroll
box-sizing: content-box; box-sizing: content-box;
} }
/*gridList Effects*/
md-grid-list /* Colors*/
{ .gray{
margin: 8px;
}
.gray
{
background:#f5f5f5; background:#f5f5f5;
} }
.aliceblue { .aliceblue {
background: aliceblue; background: aliceblue;
} }
@ -378,6 +372,7 @@ md-grid-list
.red { .red {
background: #ff8a80; background: #ff8a80;
} }
/* End Colors */
.whiteframedemoBasicUsage md-whiteframe { .whiteframedemoBasicUsage md-whiteframe {
background: #fff; background: #fff;
@ -385,40 +380,40 @@ md-grid-list
padding: 20px; padding: 20px;
} }
/* md-grid-tile {
transition: all 400ms ease-out 50ms;
}*/
/*END gridList Effects*/
.tasksContent .tasksContent
{ {
/*float:left;*/ padding-left: 4px;
padding-right: 4px;
margin: 5px;
background-color: aliceblue;
overflow: scroll;
height:250;
width:500;
} }
.messagesContent
{
md-list-item .md-no-style.md-button, md-list-item.md-no-proxy.md-button { padding-left: 4px;
font-size: inherit; padding-right: 4px;
height: inherit; margin: 5px;
text-align: left; background-color: #f5f5f5;
text-transform: none; overflow: scroll;
width: 300px; height:250;
white-space: normal; width:500;
} }
p.tasksFeed
/*md-list-item, md-list-item .md-list-item-inner { {
display: -webkit-flex; padding-left: 4px;
display: -ms-flexbox; margin: 5px;
display: flex; width:500;
-webkit-justify-content: flex-start; height: auto;
-ms-flex-pack: start; background-color: aliceblue;
justify-content: flex-start;
-webkit-align-items: center; }
-ms-flex-align: center; p.messagesFeed
align-items: center; {
min-height: 48px; padding-left: 4px;
}*/ margin: 5px;
width:500;
/*End Effects for MD*/ height: auto;
background-color: #f5f5f5;
}

View file

@ -1,57 +1,51 @@
angular.module('SeHub') angular.module('SeHub')
.controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) .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.isStudent = false;
$scope.phones = [ $scope.addMsg = false;
{ type: 'Home', number: '(972) 865-82861' }, $scope.msgToPost = "";
{ type: 'Cell', number: '(972) 5251-32309' }, $scope.oldText = "";
];
$scope.messages = [ var imagePath = $scope.user.avatar_url;
{ $scope.phones = [
face : imagePath, { type: 'Home', number: '(972) 865-82861' },
what: 'Let me tell you a secret', { type: 'Cell', number: '(972) 5251-32309' },
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"
}
];
$scope.tasks = [ if($scope.user.isLecturer)
{ {
ExNum: '1', $scope.isStudent = false;
dueDate: '23/06/15', console.log("Lecturer Mode!");
notes: " Build A Game: Scrabble" }
}, else
{ {
ExNum: '3', $scope.isStudent = true;
dueDate: '30/06/15', console.log("Student Mode!");
notes: " Static Array" }
},
{
ExNum: '4',
dueDate: '07/07/15',
notes: " Dynamic Array"
},
];
$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 += "<br></br>";
document.getElementById("bindText").innerHTML += $scope.prevText;
}
document.getElementById("msg").value = '';
$scope.prevText = '';
}
$scope.clearAllClicked = function() // Clear Screen from text
{
document.getElementById("bindText").innerHTML = "";
}
// animation // animation
$scope.isEnterd = top.setIsEnterd; $scope.isEnterd = top.setIsEnterd;
}]); }]);

View file

@ -83,7 +83,7 @@ angular.module('SeHub')
console.log("DONE - 200"); console.log("DONE - 200");
$mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') $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 .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 $cookieStore.remove("com.sehub.www"); // Removing the cookies
$window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page
}).error(function() }).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; 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 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.') $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)); .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email));
} }

View file

@ -22,52 +22,93 @@
</div> </div>
</md-card> </md-card>
</md-content> </md-content>
<div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
<md-content layout-padding> <md-content layout-padding>
<md-card> <div layout="row" layout-margin layout-padding>
<div class = "feed"> <div>
<md-grid-list <md-card>
md-cols-sm="1" md-cols-md="2" md-cols-gt-md="6" <p class = "messagesFeed">Messages</p>
md-row-height-gt-md="1:1" md-row-height="2:2" </md-card>
md-gutter="12px" md-gutter-gt-sm="8px" > </div>
<md-grid-tile class="aliceblue" <div>
md-rowspan="2" md-colspan="3" md-colspan-sm="1"> <md-card>
<md-grid-tile-header> <p class = "tasksFeed">Tasks</p>
<h3>Messages</h3> </md-card>
</md-grid-tile-header> </div>
In The Future Will Enter Wanted MESSAGES Text Here
</md-grid-tile>
<md-grid-tile class="gray"
md-rowspan="2" md-colspan="3" md-colspan-sm="1">
<md-grid-tile-header>
<h3>Tasks</h3>
</md-grid-tile-header>
<!-- In The Future Will Enter Wanted TASKS Text Here -->
<div class = "tasksContent" style:"text-align= left;">
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>
</div>
</md-grid-tile>
</md-grid-list>
</div> </div>
</md-card> <div layout="row" layout-margin layout-padding>
</md-content> <div>
<md-card>
<p id = "bindText" class = "messagesContent"></p>
<!-- <div layout="row" layout-fill style="padding-right: 320px;"> </md-card>
<md-whiteframe class="md-whiteframe-z4" layout layout-align="center center"> </div>
<span>.md-whiteframe-z4</span> <div>
</md-whiteframe> <md-card>
<md-whiteframe class="md-whiteframe-z5" layout layout-align="center center"> <p class = "tasksContent">
<span>.md-whiteframe-z5</span> For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
</md-whiteframe> <br></br>
</div> --> 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 layout-margin layout padding>
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary">Add Message</md-button>
</div>
<div ng-if="addMsg">
<div layout = "row" layout-margin layout padding layout-align = "left center">
<md-button ng-click="postMessageClicked(msgToAdd)" 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" id="msg" md-maxlength="150" minlength="1" ng-model="msgToAdd" required>
</md-input-container>
</div>
</md-content>
</div>
<div ng-if="isStudent"> <!-- Student Mode -->
<md-content layout-padding>
<div layout="row" layout-margin layout-padding>
<div>
<md-card>
<p class = "messagesFeed">Messages</p>
</md-card>
</div>
<div>
<md-card>
<p class = "tasksFeed">Tasks</p>
</md-card>
</div>
</div>
<div layout="row" layout-margin layout-padding>
<div>
<md-card>
<p id = "bindText" class = "messagesContent"></p>
</md-card>
</div>
<div>
<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>
</p>
</md-card>
</div>
</div>
</md-content>
</div>
</div> </div>