- Project layout - fixed

- project tabs - commits, issues... (work in progress - see the alpha version)
This commit is contained in:
Matan Bar Yosef 2015-06-30 15:56:53 +03:00
parent 691333ddcd
commit 59ff8a176f
4 changed files with 170 additions and 78 deletions

View file

@ -2,6 +2,7 @@ angular.module('SeHub')
.controller('myClassesController', ['$scope', '$location', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', .controller('myClassesController', ['$scope', '$location', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope',
function ($scope, $location, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) function ($scope, $location, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
{ {
$scope.loadingData = true;
$scope.isStudent = false; $scope.isStudent = false;
$scope.isCourse = false; $scope.isCourse = false;
$scope.isNewCourse = false; $scope.isNewCourse = false;
@ -11,7 +12,7 @@ angular.module('SeHub')
$scope.user.finalDate = ''; $scope.user.finalDate = '';
$scope.user.startDate = ''; $scope.user.startDate = '';
$scope.showMyClass = false; $scope.showMyClass = false;
$scope.coursesEmpty = false; $scope.coursesEmpty = true;
$scope.campusId; $scope.campusId;
var campusId = $routeParams.campusId; var campusId = $routeParams.campusId;
@ -124,12 +125,14 @@ angular.module('SeHub')
{ {
apiService.getAllCoursesByCampus(token, campusId).success(function(data) // Shows all classes from this campus apiService.getAllCoursesByCampus(token, campusId).success(function(data) // Shows all classes from this campus
{ {
$scope.loadingData = false;
$scope.courses = data; $scope.courses = data;
console.log("success " + $scope.courses); console.log("success " + $scope.courses);
init(); // Executing the function to initialize course display init(); // Executing the function to initialize course display
if(!$scope.courses) if($scope.courses && $scope.courses.length > 0)
{ {
$scope.coursesEmpty = true; // $scope.coursesEmpty = true;
$scope.coursesEmpty = false;
} }
}).error(function(err) }).error(function(err)
{ {

View file

@ -7,19 +7,28 @@ angular.module('SeHub')
$scope.isEditPressed = false; $scope.isEditPressed = false;
$scope.user = $scope.$parent.user; $scope.user = $scope.$parent.user;
$scope.loadingData = true; $scope.loadingData = true;
$scope.isMasterOrLecturer = false;
// $scope.thisProject = {}; // $scope.thisProject = {};
// $scope.thisProject.courseName = $routeParams.className; // $scope.thisProject.courseName = $routeParams.className;
$scope.editProject = function() $scope.editProject = function(ev)
{ {
$scope.isEditPressed = true; $scope.isEditPressed = true;
console.log("EditPressed " + $scope.isEditPressed); console.log("EditPressed " + $scope.isEditPressed);
} }
$scope.removeProject = function()
$scope.removeProject = function(ev)
{ {
console.log("Project has been removed!"); console.log("Project has been removed!");
} $mdDialog.show($mdDialog.alert().title('Remove Project').content('Are you sure you want to remove the project ?')
.ariaLabel('Removing project alert dialog').ok('Yes').targetEvent(ev));
// .then(function() {
// $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
// }); // Pop-up alert
};
$scope.getProjectInfo = function() $scope.getProjectInfo = function()
{ {
@ -28,7 +37,15 @@ angular.module('SeHub')
$scope.project = data; $scope.project = data;
console.log($scope.project); console.log($scope.project);
$scope.init_line_lables(); $scope.init_line_lables();
// if($scope.user === $scope.project.info.master_id)
// {
// $scope.isMasterOrLecturer = true;
// }
// if($scope.project && $scope.project.length > 0) // TODO - TEST?
// {
$scope.loadingData = false; $scope.loadingData = false;
// }
console.log($scope.project); console.log($scope.project);
}).error(function(err) }).error(function(err)
{ {

View file

@ -2,10 +2,16 @@
<md-content layout-padding layout-margin> <md-content layout-padding layout-margin>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1> <h1 layout-margin style="margin-left:15px"><i class="fa fa-graduation-cap"></i> My Classes</h1>
</md-content> </md-content>
<div layout-paddig layout-margin class="loader" ng-if="loadingData">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<div ng-if = "coursesEmpty && !loadingData" layout-padding layout-margin>
You Are Not Related To Any Course, You May Join Any Course You Wish.
</div>
<div ng-if = "!coursesEmpty">
<md-card class="cardAllcourses"> <md-card class="cardAllcourses">
<div flex = "99" layout = "row" ng-repeat = "t in holdArrays" value = "{{t}}" layout-padding> <div flex = "99" layout = "row" ng-repeat = "t in holdArrays" value = "{{t}}" layout-padding>
<div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" > <div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" >
<div ng-if = "!scope.coursesEmpty">
<div ng-if="t.length != 1"> <div ng-if="t.length != 1">
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:100%; height:32%;" layout-padding class = "md-raised" > <md-button ng-click = "goToClass(course.id, course.courseName)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
<div style="width:97%;height:97%"> <div style="width:97%;height:97%">
@ -26,12 +32,10 @@
</div> </div>
</div> </div>
<div class="spacer"></div> <div class="spacer"></div>
<div ng-if = "scope.coursesEmpty">
You Are Not Related To Any Course, You May Join Any Course You Wish.
</div>
</div>
</div> </div>
</md-card> </md-card>
</div>
<!-- Lecturer Mode --> <!-- Lecturer Mode -->

View file

@ -1,38 +1,54 @@
<div class = "project"> <div class = "project">
<md-content layout-padding layout-margin> <md-content layout-padding layout-margin>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project</h1> <div layout = "row">
<!-- Yipi Kayea Mother Fraker --> <div layout = "column">
<div flex = "99" layout = "row" layout-padding> <div>
<h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project '{{project.projectName}}'</h1>
</div>
<div> <!-- ng-if = "{{project.logo_url}}"> -->
<div flex = "25"> <div flex = "25">
Project Logo <img ng-src="{{project.logo_url}}" class = "md-avatar">
<!-- <img ng-src="{{project.logo_url}} class = "md-avatar"> -->
</div> </div>
<div flex = "20">
Project Name: {{project.projectName}}
</div> </div>
</div>
<div>
<div layout = "row" flex = "45"> <div layout = "row" flex = "45">
<div flex> <!-- <div ng-if = "isMasterOrLecturer"> -->
<md-button ng-click="editProject()" style = "size:150%; width:50%;" ng class="md-raised md-primary"> <md-card layout = "row">
<div layout-padding>
<md-button ng-click="editProject($event)" ng class="md-raised md-primary">
<i class="fa fa-pencil-square-o"></i> <i class="fa fa-pencil-square-o"></i>
</md-button> </md-button>
</div> </div>
<div flex> <div layout-padding>
<md-button ng-click="removeProject()" style = "size:150%%; width:40%;" ng class="md-raised md-primary"> <md-button ng-click="removeProject($event)" ng class="md-raised md-primary">
<i class="fa fa-times"></i> <i class="fa fa-times"></i>
</md-button> </md-button>
</div> </div>
</md-card>
<!-- </div> -->
</div> </div>
</div> </div>
</div>
<!-- <div flex = "99" layout = "row" layout-padding>
<div flex = "20">
Project Name: {{project.projectName}}
</div>
</div> -->
<md-card>
<div flex = "99" layout = "row"> <div flex = "99" layout = "row">
<div flex = "18"> <div flex = "10" layout-padding layout-margin border = "1">
Team Members: Team Members:
<ul> <ul layout-padding>
<li ng-repeat = "member in project.members"> <li ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}"> {{member.name}}</a> <a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;"> {{member.name}}</a>
</li> </li>
</ul> </ul>
</div> </div>
<div flex = "40"> <div flex = "45">
<!-- Graph --> <!-- Graph -->
<div ng-if="loadingData" layout-paddig layout-margin class="loader"> <div ng-if="loadingData" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular> <md-progress-circular md-mode="indeterminate"></md-progress-circular>
@ -47,8 +63,9 @@
</md-card> </md-card>
</div> </div>
</div> </div>
</md-card>
<div> <div>
<div flex = "96"> <div flex = "96" style="height:70%;">
<div flex> <div flex>
<md-card> <md-card>
<md-content class="md-padding"> <md-content class="md-padding">
@ -62,7 +79,58 @@
<md-tab label="Commits"> <md-tab label="Commits">
<md-content class="md-padding"> <md-content class="md-padding">
<h1 class="md-display-2">Commits</h1> <h1 class="md-display-2">Commits</h1>
<p>Commits...</p> <table style="width:100%;" border = "1">
<tr>
<th>Name</th>
<th>Number</th>
<th>url</th>
</tr>
<tr ng-repeat = "member in project.members">
<td>
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;">
{{member.name}}
</a>
</td>
<td>
<div ng-repeat = "commit in project.info.info">
{{commit.commits_url}}
</div>
</td>
<td></td>
</tr>
</table>
</md-content>
</md-tab>
<md-tab label="Issues">
<md-content class="md-padding">
<h1 class="md-display-2">Issues</h1>
<table style="width:100%;" border = "1">
<tr>
<th style = "width:25%;">Name</th>
<th>Title</th>
<th style = "width:10%;">url</th>
</tr>
<tr ng-repeat = "member in project.members">
<td align="center">
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;">
{{member.name}}
</a>
</td>
<td align="top">
<div ng-repeat = "issue in project.info.issues" layout-margin>
{{issue.title}}
</div>
</td>
<td>
<div ng-repeat = "issue in project.info.issues" layout-margin>
<a ng-href="{{issue.html_url}}" style="text-decoration:none; color:black;">
{{issue.html_url}}
</a>
</div>
</td>
</tr>
</table>
</md-content> </md-content>
</md-tab> </md-tab>
<md-tab label="Bugs"> <md-tab label="Bugs">