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
*/
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;
@ -147,7 +147,7 @@ body.noscroll
.feed
{
overflow-y: scroll;
height: 300px;
height: 350px;
/*width: 100%;*/
}
@ -349,17 +349,11 @@ body.noscroll
box-sizing: content-box;
}
/*gridList Effects*/
md-grid-list
{
margin: 8px;
}
.gray
{
/* Colors*/
.gray{
background:#f5f5f5;
}
.aliceblue {
background: aliceblue;
}
@ -378,6 +372,7 @@ md-grid-list
.red {
background: #ff8a80;
}
/* End Colors */
.whiteframedemoBasicUsage md-whiteframe {
background: #fff;
@ -385,40 +380,40 @@ md-grid-list
padding: 20px;
}
/* md-grid-tile {
transition: all 400ms ease-out 50ms;
}*/
/*END gridList Effects*/
.tasksContent
{
/*float:left;*/
padding-left: 4px;
padding-right: 4px;
margin: 5px;
background-color: aliceblue;
overflow: scroll;
height:250;
width:500;
}
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: 300px;
white-space: normal;
.messagesContent
{
padding-left: 4px;
padding-right: 4px;
margin: 5px;
background-color: #f5f5f5;
overflow: scroll;
height:250;
width:500;
}
/*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*/
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;
}

View file

@ -1,57 +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: '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 += "<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
$scope.isEnterd = top.setIsEnterd;
// animation
$scope.isEnterd = top.setIsEnterd;
}]);

View file

@ -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));
}

View file

@ -22,52 +22,93 @@
</div>
</md-card>
</md-content>
<md-content layout-padding>
<md-card>
<div class = "feed">
<md-grid-list
md-cols-sm="1" md-cols-md="2" md-cols-gt-md="6"
md-row-height-gt-md="1:1" md-row-height="2:2"
md-gutter="12px" md-gutter-gt-sm="8px" >
<md-grid-tile class="aliceblue"
md-rowspan="2" md-colspan="3" md-colspan-sm="1">
<md-grid-tile-header>
<h3>Messages</h3>
</md-grid-tile-header>
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 ng-if="user.isLecturer"> <!-- Lecturer 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>
</md-card>
</md-content>
<!-- <div layout="row" layout-fill style="padding-right: 320px;">
<md-whiteframe class="md-whiteframe-z4" layout layout-align="center center">
<span>.md-whiteframe-z4</span>
</md-whiteframe>
<md-whiteframe class="md-whiteframe-z5" layout layout-align="center center">
<span>.md-whiteframe-z5</span>
</md-whiteframe>
</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>
<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>