- 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();
$scope.loadingData = false; // if($scope.user === $scope.project.info.master_id)
// {
// $scope.isMasterOrLecturer = true;
// }
// if($scope.project && $scope.project.length > 0) // TODO - TEST?
// {
$scope.loadingData = false;
// }
console.log($scope.project); console.log($scope.project);
}).error(function(err) }).error(function(err)
{ {

View file

@ -2,36 +2,40 @@
<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>
<md-card class="cardAllcourses"> <div layout-paddig layout-margin class="loader" ng-if="loadingData">
<div flex = "99" layout = "row" ng-repeat = "t in holdArrays" value = "{{t}}" layout-padding> <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">
<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%"> <md-card-content>
<md-card-content> <h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" --> </md-card-content>
</md-card-content> </div>
</div> </md-button>
</md-button>
</div>
<div ng-if="t.length == 1">
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
<div style="width:97%;height:97%">
<md-card-content>
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
</md-card-content>
</div>
</md-button>
</div>
</div> </div>
<div class="spacer"></div> <div ng-if="t.length == 1">
<div ng-if = "scope.coursesEmpty"> <md-button ng-click = "goToClass(course.id, course.courseName)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
You Are Not Related To Any Course, You May Join Any Course You Wish. <div style="width:97%;height:97%">
<md-card-content>
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
</md-card-content>
</div>
</md-button>
</div> </div>
</div> </div>
<div class="spacer"></div>
</div> </div>
</md-card> </md-card>
</div>
<!-- Lecturer Mode --> <!-- Lecturer Mode -->

View file

@ -1,54 +1,71 @@
<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>
<div flex = "25"> <h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project '{{project.projectName}}'</h1>
Project Logo
<!-- <img ng-src="{{project.logo_url}} class = "md-avatar"> -->
</div> </div>
<div flex = "20"> <div> <!-- ng-if = "{{project.logo_url}}"> -->
Project Name: {{project.projectName}} <div flex = "25">
</div> <img ng-src="{{project.logo_url}}" class = "md-avatar">
<div layout = "row" flex = "45">
<div flex>
<md-button ng-click="editProject()" style = "size:150%; width:50%;" ng class="md-raised md-primary">
<i class="fa fa-pencil-square-o"></i>
</md-button>
</div> </div>
<div flex>
<md-button ng-click="removeProject()" style = "size:150%%; width:40%;" ng class="md-raised md-primary">
<i class="fa fa-times"></i>
</md-button>
</div>
</div>
</div>
<div flex = "99" layout = "row">
<div flex = "18">
Team Members:
<ul>
<li ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}"> {{member.name}}</a>
</li>
</ul>
</div>
<div flex = "40">
<!-- Graph -->
<div ng-if="loadingData" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="line" class="chart chart-line" data="project.info.stats.weekly_commits" labels="project.weekly_labels" legend="true" ></canvas>
</md-card>
</div>
<div flex = "40">
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="project.projectName" class="chart chart-bar" data="project.info.stats.micro.data" labels="project.info.stats.micro.labels" series="project.info.stats.micro.series"></canvas>
</md-card>
</div> </div>
</div> </div>
<div> <div>
<div flex = "96"> <div layout = "row" flex = "45">
<!-- <div ng-if = "isMasterOrLecturer"> -->
<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>
</md-button>
</div>
<div layout-padding>
<md-button ng-click="removeProject($event)" ng class="md-raised md-primary">
<i class="fa fa-times"></i>
</md-button>
</div>
</md-card>
<!-- </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 = "10" layout-padding layout-margin border = "1">
Team Members:
<ul layout-padding>
<li ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;"> {{member.name}}</a>
</li>
</ul>
</div>
<div flex = "45">
<!-- Graph -->
<div ng-if="loadingData" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="line" class="chart chart-line" data="project.info.stats.weekly_commits" labels="project.weekly_labels" legend="true" ></canvas>
</md-card>
</div>
<div flex = "40">
<md-card>
<canvas layout-padding layout-margin ng-if = "!loadingData" id="project.projectName" class="chart chart-bar" data="project.info.stats.micro.data" labels="project.info.stats.micro.labels" series="project.info.stats.micro.series"></canvas>
</md-card>
</div>
</div>
</md-card>
<div>
<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">