- Lecturer / Student Mode added
- TODO fix previous text input from (add message by lecturer)
This commit is contained in:
parent
3c48e3fbe9
commit
badcf43151
2 changed files with 6 additions and 49 deletions
|
@ -1,6 +1,7 @@
|
|||
angular.module('SeHub')
|
||||
.controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
$scope.isStudent = false;
|
||||
$scope.addMsg = false;
|
||||
$scope.msgToPost = "";
|
||||
$scope.oldText = "";
|
||||
|
@ -13,58 +14,18 @@ angular.module('SeHub')
|
|||
|
||||
if($scope.user.isLecturer)
|
||||
{
|
||||
$scope.isStudent = false;
|
||||
console.log("Lecturer Mode!");
|
||||
$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"
|
||||
}
|
||||
];
|
||||
|
||||
$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"
|
||||
},
|
||||
];
|
||||
}
|
||||
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
|
||||
|
@ -76,10 +37,8 @@ angular.module('SeHub')
|
|||
$scope.prevText += "<br></br>";
|
||||
document.getElementById("bindText").innerHTML += $scope.prevText;
|
||||
}
|
||||
$scope.prevText = '';
|
||||
document.getElementById("bindText").value = '';
|
||||
document.getElementById("msg").value = '';
|
||||
|
||||
$scope.prevText = '';
|
||||
}
|
||||
|
||||
$scope.clearAllClicked = function() // Clear Screen from text
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
</div>
|
||||
</md-card>
|
||||
</md-content>
|
||||
|
||||
<div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
|
||||
<md-content layout-padding>
|
||||
<div layout="row" layout-margin layout-padding>
|
||||
|
@ -69,7 +68,7 @@
|
|||
<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 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>
|
||||
|
@ -77,7 +76,7 @@
|
|||
</div>
|
||||
</md-content>
|
||||
</div>
|
||||
<div ng-if="!user.isLecturer"> <!-- Student Mode -->
|
||||
<div ng-if="isStudent"> <!-- Student Mode -->
|
||||
<md-content layout-padding>
|
||||
<div layout="row" layout-margin layout-padding>
|
||||
<div>
|
||||
|
@ -112,5 +111,4 @@
|
|||
</div>
|
||||
</md-content>
|
||||
</div>
|
||||
|
||||
</div>
|
Loading…
Reference in a new issue