-DashBoard pattern and messages - fixed

-Project evaluation pattern - added
This commit is contained in:
Matan Bar Yosef 2015-06-22 13:06:56 +03:00
parent 19aa25de2a
commit 1e6e3f24f2
8 changed files with 240 additions and 42 deletions

View file

@ -380,6 +380,36 @@ body.noscroll
padding: 20px; 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 .tasksContent
{ {
padding-left: 4px; padding-left: 4px;
@ -387,8 +417,9 @@ body.noscroll
margin: 5px; margin: 5px;
background-color: aliceblue; background-color: aliceblue;
overflow: scroll; overflow: scroll;
overflow-y: visible;
height:250; height:250;
width:500; width:340;
} }
.messagesContent .messagesContent
{ {
@ -398,13 +429,13 @@ body.noscroll
background-color: #f5f5f5; background-color: #f5f5f5;
overflow: scroll; overflow: scroll;
height:250; height:250;
width:500; width:690;
} }
p.tasksFeed p.tasksFeed
{ {
padding-left: 4px; padding-left: 4px;
margin: 5px; margin: 5px;
width:500; width:340;
height: auto; height: auto;
background-color: aliceblue; background-color: aliceblue;
@ -413,7 +444,7 @@ p.messagesFeed
{ {
padding-left: 4px; padding-left: 4px;
margin: 5px; margin: 5px;
width:500; width:690;
height: auto; height: auto;
background-color: #f5f5f5; background-color: #f5f5f5;
} }

View file

@ -45,6 +45,10 @@ app.config(['$routeProvider', '$locationProvider',
.when('/tasks', { .when('/tasks', {
templateUrl: 'templates/views/tasks.html', templateUrl: 'templates/views/tasks.html',
controller: 'tasksController' controller: 'tasksController'
})
.when('/myClasses', {
templateUrl: 'templates/views/myClasses.html',
controller: 'myClassesController'
}); });
} }
]); ]);

View file

@ -5,6 +5,7 @@ angular.module('SeHub')
$scope.addMsg = false; $scope.addMsg = false;
$scope.msgToPost = ""; $scope.msgToPost = "";
$scope.oldText = ""; $scope.oldText = "";
$scope.messages = [];
var imagePath = $scope.user.avatar_url; var imagePath = $scope.user.avatar_url;
$scope.phones = [ $scope.phones = [
@ -28,24 +29,37 @@ angular.module('SeHub')
$scope.addMsg = true; // Reveal the "POST" Button $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; console.log($scope.msg.msgToAdd);
implementText = document.getElementById("msg").value; $scope.messages.push({"text": $scope.msg.msgToAdd});
$scope.prevText += "<br></br>";
document.getElementById("bindText").innerHTML += $scope.prevText;
} }
document.getElementById("msg").value = ''; $scope.msg.msgToAdd = null;
$scope.prevText = '';
} }
$scope.clearAllClicked = function() // Clear Screen from text $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 // animation
$scope.isEnterd = top.setIsEnterd; $scope.isEnterd = top.setIsEnterd;
}]); }]);

View file

@ -43,7 +43,7 @@ angular.module('SeHub')
"title": "My Classes", "title": "My Classes",
"icon": "fa fa-graduation-cap", "icon": "fa fa-graduation-cap",
"style": "", "style": "",
"route": "/campuses" "route": "/myClasses"
}, { }, {
"title": "My Projects", "title": "My Projects",
"icon": "fa fa-cube", "icon": "fa fa-cube",

View file

@ -17,7 +17,6 @@ service.factory('apiService', ['$http', function($http) {
req = { req = {
method : "GET", method : "GET",
url : url url : url
}; };
return $http(req); return $http(req);
}, },
@ -26,13 +25,11 @@ service.factory('apiService', ['$http', function($http) {
payload = { payload = {
email: email email: email
}; };
req = { req = {
method: "POST", method: "POST",
url: url, url: url,
data: payload data: payload
}; };
return $http(req); return $http(req);
}, },
updateUser: function(token, payLoad){ updateUser: function(token, payLoad){
@ -44,6 +41,33 @@ service.factory('apiService', ['$http', function($http) {
data: payLoad data: payLoad
}; };
return $http(req); 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);
} }
}; };
}]); }]);

View file

@ -1,8 +1,8 @@
<div> <div layout-padding layout-margin>
<div class="loader" ng-if="loadingData"> <div class="loader" ng-if="loadingData">
<md-progress-circular md-mode="indeterminate"></md-progress-circular> <md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div> </div>
<md-content layout-padding> <md-content >
<md-card class="gray-font fadeOutUp" ng-if="isEnterd"> <md-card class="gray-font fadeOutUp" ng-if="isEnterd">
<div layout="row"> <div layout="row">
<div class="spacer"></div> <div class="spacer"></div>
@ -22,27 +22,55 @@
</div> </div>
</md-card> </md-card>
</md-content> </md-content>
<md-content>
<h1 style="margin-left:15px;"><i class="fa fa-dashboard"></i> Dash Board</h1>
</md-content>
<div ng-if="user.isLecturer"> <!-- Lecturer Mode --> <div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
<md-content layout-padding> <md-content>
<div layout="row" layout-margin layout-padding> <div layout="row">
<div> <div flex="65">
<md-card> <md-card>
<p class = "messagesFeed">Messages</p> <p class = "messagesFeed">Messages</p>
</md-card> </md-card>
</div> </div>
<div> <div flex="34">
<md-card> <md-card>
<p class = "tasksFeed">Tasks</p> <p class = "tasksFeed">Tasks</p>
</md-card> </md-card>
</div> </div>
</div> </div>
<div layout="row" layout-margin layout-padding> <div layout="row">
<div> <div flex="65">
<md-card> <md-card>
<p id = "bindText" class = "messagesContent"></p> <div class = "messagesContent">
</md-card> <md-card ng-repeat = "msg in messages">
<div layout="column">
<div layout="row" layout-margin layout-padding>
<div flex="10" class="md-avatar">
<img ng-src="{{user.avatar_url}}" style="width:100%">
</div>
<div flex>
<div layout = "column">
<div>
<b>{{user.name}}</b>
</div> </div>
<div> <div>
class_name
</div>
</div>
</div>
</div>
<div>
<div flex="69" class="msgSent" layout-margin layout-padding>
{{msg.text}}
</div>
</div>
</div>
</md-card>
</div>
</md-card>
</div>
<div flex="34">
<md-card> <md-card>
<p class = "tasksContent"> <p class = "tasksContent">
For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a> For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
@ -60,43 +88,129 @@
</md-card> </md-card>
</div> </div>
</div> </div>
<div layout-margin layout padding> <div class ="addMessage" layout-margin layout padding>
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary">Add Message</md-button> <md-button ng-click="addMessageClicked()" ng class="md-raised md-primary"><i class="fa fa-comments"></i></md-button>
</div> </div>
<div ng-if="addMsg"> <div ng-if="addMsg">
<div layout = "row" layout-margin layout padding layout-align = "left center"> <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="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>
<md-button ng-click="clearAllClicked()" ng class="md-raised md-primary">Clear All</md-button> <md-button ng-click="clearAllClicked()" ng class="md-raised md-primary">Clear All</md-button>
</div> </div>
<div class="port_spacer"></div> <div class="port_spacer"></div>
<md-input-container> <md-input-container>
<label> Write Your Desired Message Here And Press Post</label> <label> Write Your Desired Message Here And Press Post</label>
<input type="text" id="msg" md-maxlength="150" minlength="1" ng-model="msgToAdd" required> <input type="text" minlength="1" ng-model="msg.msgToAdd" required>
</md-input-container> </md-input-container>
</div> </div>
</md-content> </md-content>
<md-content layout-padding layout-margin>
<h1>
<em><i class="fa fa-folder-open"></i> Project Evaluation</em>
</h1>
<md-select placeholder="Choose Project" ng-model="project" ng-click="chooseProjectClicked()" style="z-index: 300" class="projectDropDown">
</md-select>
<div layout = "column" layout-margin layout-padding>
<div layout="row">
<md-card flex class = "projectExhibit">
a
a
a
</md-card>
<md-card flex class = "projectExhibit">
s
s
s
</md-card>
<md-card flex class = "projectExhibit">
d
d
d
</md-card>
</div>
<div layout="row">
<md-card flex class = "projectExhibit">
e
e
e
</md-card>
<md-card flex class = "projectExhibit">
q
q
q
</md-card>
<md-card flex class = "projectExhibit">
w
w
w
</md-card>
</div>
<div layout="row">
<md-card flex class = "projectExhibit">
b
b
b
</md-card>
<md-card flex class = "projectExhibit">
r
r
r
</md-card>
<md-card flex class = "projectExhibit">
x
x
x
</md-card>
</div>
</div>
</md-content>
</div> </div>
<div ng-if="isStudent"> <!-- Student Mode --> <div ng-if="isStudent"> <!-- Student Mode -->
<md-content layout-padding> <md-content>
<div layout="row" layout-margin layout-padding> <div layout="row">
<div> <div flex="65">
<md-card> <md-card>
<p class = "messagesFeed">Messages</p> <p class = "messagesFeed">Messages</p>
</md-card> </md-card>
</div> </div>
<div> <div flex="34">
<md-card> <md-card>
<p class = "tasksFeed">Tasks</p> <p class = "tasksFeed">Tasks</p>
</md-card> </md-card>
</div> </div>
</div> </div>
<div layout="row" layout-margin layout-padding> <div layout="row">
<div> <div flex="65">
<md-card> <md-card>
<p id = "bindText" class = "messagesContent"></p> <div class = "messagesContent">
</md-card> <md-card ng-repeat = "msg in messages">
<div layout="column">
<div layout="row" layout-margin layout-padding>
<div flex="10" class="md-avatar">
<img ng-src="{{user.avatar_url}}" style="width:100%">
</div>
<div flex>
<div layout = "column">
<div>
<b>{{user.name}}</b>
</div> </div>
<div> <div>
class_name
</div>
</div>
</div>
</div>
<div>
<div flex="69" class="msgSent" layout-margin layout-padding>
{{msg.text}}
</div>
</div>
</div>
</md-card>
</div>
</md-card>
</div>
<div flex="34">
<md-card> <md-card>
<p class = "tasksContent"> <p class = "tasksContent">
For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a> For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
@ -104,11 +218,20 @@
For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a> For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a>
<br></br> <br></br>
For Task 5 Press: <a href="http://localhost:8080/home#/home">Task #5</a> 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> </p>
</md-card> </md-card>
</div> </div>
</div> </div>
<!-- <md-button ng-click="chooseCourseClicked()" ng class="md-raised md-primary">Choose Course</md-button> -->
<md-select placeholder="Choose Course" ng-model="course" ng-click="chooseCourseClicked()" style="z-index: 300">
<!-- <md-option ng-switch="user.isLecturer" ng-repeat="c in courses" value="{{c.title}}">{{c.title}}</md-option> -->
</md-select>
</md-content> </md-content>
</div> </div>
</div> </div>

View file

@ -100,6 +100,8 @@
<script src="templates/js/controllers/homeController.js"></script> <script src="templates/js/controllers/homeController.js"></script>
<script src="templates/js/controllers/settingsController.js"></script> <script src="templates/js/controllers/settingsController.js"></script>
<script src="templates/js/controllers/registerController.js"></script> <script src="templates/js/controllers/registerController.js"></script>
<script src="templates/js/controllers/tasksController.js"></script>
<script src="templates/js/controllers/myClassesController.js"></script>
</body> </body>
</html> </html>