- Files Added: myClasses, newcourse, projects, tasks
This commit is contained in:
parent
1d5655b056
commit
ff9ea86131
9 changed files with 316 additions and 9 deletions
60
templates/js/controllers/myClassesController.js
Normal file
60
templates/js/controllers/myClassesController.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
angular.module('SeHub')
|
||||
.controller('myClassesController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
$scope.isStudent = false;
|
||||
$scope.isCourse = false;
|
||||
$scope.isNewCourse = false;
|
||||
$scope.newClassName = false;
|
||||
$scope.user.createNewCourse = '';
|
||||
$scope.user.finalDate = '';
|
||||
$scope.showMyClass = false;
|
||||
|
||||
if($scope.user.isLecturer)
|
||||
{
|
||||
$scope.isStudent = false;
|
||||
console.log("Lecturer Mode!");
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.isStudent = true;
|
||||
console.log("Student Mode!");
|
||||
}
|
||||
|
||||
|
||||
$scope.chooseCourseClicked = function()
|
||||
{
|
||||
$scope.isCourse = true;
|
||||
console.log("choose course Clicked!!");
|
||||
}
|
||||
|
||||
$scope.createCourseClicked = function()
|
||||
{
|
||||
$scope.isNewCourse = true;
|
||||
console.log("create course Clicked!!");
|
||||
}
|
||||
|
||||
$scope.showMyCourses = function()
|
||||
{
|
||||
$scope.showMyClass = true;
|
||||
}
|
||||
|
||||
$scope.submitNewClassClicked = function()
|
||||
{
|
||||
if($scope.user.createNewCourse != '' && $scope.user.finalDate != '')
|
||||
{
|
||||
console.log("finalDate " + $scope.user.finalDate);
|
||||
console.log($scope.user.createNewCourse);
|
||||
$mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.')
|
||||
.ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent());
|
||||
// $window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO
|
||||
}
|
||||
else
|
||||
{
|
||||
$mdDialog.show($mdDialog.alert().title('Error - Creating Course').content('You have encountered and error in creating the course.')
|
||||
.ariaLabel('Email verification alert dialog').ok('Try Again!').targetEvent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}]);
|
10
templates/js/controllers/newCourseController.js
Normal file
10
templates/js/controllers/newCourseController.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
angular.module('SeHub')
|
||||
.controller('newCourseController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
|
||||
$scope.goBack = function()
|
||||
{
|
||||
$window.location.href = 'templates/views/myClasses.html';
|
||||
}
|
||||
|
||||
}]);
|
16
templates/js/controllers/projectsController.js
Normal file
16
templates/js/controllers/projectsController.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
angular.module('SeHub')
|
||||
.controller('projectsContoller', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
console.log("in projects controller");
|
||||
|
||||
$scope.createProjectClicked = function()
|
||||
{
|
||||
console.log("project created! not rly!! ");
|
||||
// $window.location.href = 'http://localhost:8080/home#/tasks/new'; // Reference to 'newTask' page
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}]);
|
17
templates/js/controllers/tasksController.js
Normal file
17
templates/js/controllers/tasksController.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
angular.module('SeHub')
|
||||
.controller('tasksController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
|
||||
{
|
||||
console.log("in controller");
|
||||
|
||||
$scope.createTaskClicked = function(name)
|
||||
{
|
||||
var taskName = name;
|
||||
console.log("task created! " + taskName);
|
||||
$window.location.href = 'http://localhost:8080/home#/tasks/new'; // Reference to 'newTask' page
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}]);
|
|
@ -114,52 +114,52 @@
|
|||
</md-select>
|
||||
<div layout = "column" layout-margin layout-padding>
|
||||
<div layout="row">
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit" >
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
</div>
|
||||
<div layout="row">
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
</div>
|
||||
<div layout="row">
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
</a>
|
||||
<a href="http://localhost:8080/home#/projects/">
|
||||
<a href="http://localhost:8080/home#/projects">
|
||||
<md-card flex class = "projectExhibit">
|
||||
Press On Me
|
||||
</md-card>
|
||||
|
|
186
templates/views/myClasses.html
Normal file
186
templates/views/myClasses.html
Normal file
|
@ -0,0 +1,186 @@
|
|||
<div class = "myClasses">
|
||||
<md-content layout-padding layout-margin>
|
||||
<h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1>
|
||||
</md-content>
|
||||
<div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
|
||||
<div layout="row">
|
||||
<div layout-margin layout-padding>
|
||||
<md-button ng-click="createCourseClicked()" ng class="md-raised md-primary">Create Class</md-button>
|
||||
</div>
|
||||
<div layout-margin layout-padding>
|
||||
<md-button ng-click="showMyCourses()" ng class="md-raised md-primary">Show My Classes</md-button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="isNewCourse">
|
||||
<md-content>
|
||||
<md-content layout-padding layout="row" layout-sm="column">
|
||||
<md-input-container>
|
||||
<label>User Name</label>
|
||||
<input ng-model="user.name">
|
||||
</md-input-container>
|
||||
<md-input-container>
|
||||
<label>Email</label>
|
||||
<input ng-model="user.email" type="email">
|
||||
</md-input-container>
|
||||
</md-content>
|
||||
<md-content layout-padding>
|
||||
<form name="createNewCourseForm">
|
||||
<div layout layout-sm="column">
|
||||
<md-input-container style="width:80%">
|
||||
<label>Class Name</label>
|
||||
<input ng-model="user.createNewCourse" min-length="1" required>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>Course Finish Date</label>
|
||||
<input type="date" ng-model="user.finalDate" required>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout layout-sm="column">
|
||||
<md-input-container flex>
|
||||
<label>First name</label>
|
||||
<input ng-model="user.firstName">
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>Last Name</label>
|
||||
<input ng-model="theMax">
|
||||
</md-input-container>
|
||||
</div>
|
||||
<md-input-container flex>
|
||||
<label>General Info (optional)</label>
|
||||
<textarea ng-model="user.courseInfo" columns="1" md-maxlength="150"></textarea>
|
||||
</md-input-container>
|
||||
</form>
|
||||
</md-content>
|
||||
<div layout-padding layout-margin>
|
||||
<md-button ng-click="submitNewClassClicked()" class="md-raised md-primary">Submit New Class</md-button>
|
||||
</div>
|
||||
</md-content>
|
||||
</div>
|
||||
<div layout-margin layout-padding ng-if="showMyClass">
|
||||
<md-select placeholder="Choose Existing Course" ng-model="course" ng-click="chooseCourseClicked()" class="courseDropDown">
|
||||
<md-option ng-repeat="c in courses" value="{{c.course}}">{{c.course}}</md-option>
|
||||
</md-select>
|
||||
</div>
|
||||
<!-- <md-content>
|
||||
<div layout="row">
|
||||
<div flex="65">
|
||||
<md-card>
|
||||
<p class = "messagesFeed">Messages</p>
|
||||
</md-card>
|
||||
</div>
|
||||
<div flex="34">
|
||||
<md-card>
|
||||
<p class = "tasksFeed">Tasks</p>
|
||||
</md-card>
|
||||
</div>
|
||||
</div>
|
||||
<div layout="row">
|
||||
<div flex="65">
|
||||
<md-card>
|
||||
<div class = "messagesContent">
|
||||
<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>
|
||||
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>
|
||||
<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 class ="addMessage" layout="row" layout-margin layout padding>
|
||||
<div>
|
||||
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary"><i class="fa fa-comments"></i></md-button>
|
||||
</div>
|
||||
<div ng-if="addMsg">
|
||||
<md-select placeholder="Choose Course" ng-model="course" ng-click="chooseCourseClicked()" class="courseDropDown">
|
||||
<md-option ng-repeat="c in courses" value="{{c.course}}">{{c.course}}</md-option>
|
||||
</md-select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div ng-if="addMsg">
|
||||
<div layout = "row" layout-margin layout padding layout-align = "left center">
|
||||
<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>
|
||||
</div>
|
||||
<div class="port_spacer"></div>
|
||||
<md-input-container>
|
||||
<label> Write Your Desired Message Here And Press Post</label>
|
||||
<input type="text" minlength="1" ng-model="msg.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-select placeholder="Choose Course" ng-model="course" ng-click="chooseCourseClicked()" style="z-index: 300"></md-select>
|
||||
</md-content>
|
||||
</div>
|
||||
</div>
|
6
templates/views/newCourse.html
Normal file
6
templates/views/newCourse.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class = "newCourse">
|
||||
<md-content layout-padding layout-margin>
|
||||
<h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My New Course</h1>
|
||||
<md-button ng-click="goBack()" class="md-raised md-primary">Go Back</md-button>
|
||||
</md-content>
|
||||
</div>
|
6
templates/views/projects.html
Normal file
6
templates/views/projects.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class = "projects">
|
||||
<md-content layout-padding layout-margin>
|
||||
<h1 style="margin-left:15px"><i class="fa fa-file-cube-o"></i> Projects</h1>
|
||||
<md-button ng-click="createProjectClicked()" ng class="md-raised md-primary">Create Project</md-button>
|
||||
</md-content>
|
||||
</div>
|
6
templates/views/tasks.html
Normal file
6
templates/views/tasks.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class = "tasks">
|
||||
<md-content layout-padding layout-margin>
|
||||
<h1 style="margin-left:15px"><i class="fa fa-file-text-o"></i> Tasks</h1>
|
||||
<md-button ng-click="createTaskClicked(taskName)" ng class="md-raised md-primary">Create Task</md-button>
|
||||
</md-content>
|
||||
</div>
|
Loading…
Reference in a new issue