- Project layout - fixed
- project tabs - commits, issues... (work in progress - see the alpha version)
This commit is contained in:
parent
691333ddcd
commit
59ff8a176f
4 changed files with 170 additions and 78 deletions
|
@ -2,6 +2,7 @@ angular.module('SeHub')
|
|||
.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)
|
||||
{
|
||||
$scope.loadingData = true;
|
||||
$scope.isStudent = false;
|
||||
$scope.isCourse = false;
|
||||
$scope.isNewCourse = false;
|
||||
|
@ -11,7 +12,7 @@ angular.module('SeHub')
|
|||
$scope.user.finalDate = '';
|
||||
$scope.user.startDate = '';
|
||||
$scope.showMyClass = false;
|
||||
$scope.coursesEmpty = false;
|
||||
$scope.coursesEmpty = true;
|
||||
$scope.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
|
||||
{
|
||||
$scope.loadingData = false;
|
||||
$scope.courses = data;
|
||||
console.log("success " + $scope.courses);
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -7,19 +7,28 @@ angular.module('SeHub')
|
|||
$scope.isEditPressed = false;
|
||||
$scope.user = $scope.$parent.user;
|
||||
$scope.loadingData = true;
|
||||
$scope.isMasterOrLecturer = false;
|
||||
|
||||
// $scope.thisProject = {};
|
||||
// $scope.thisProject.courseName = $routeParams.className;
|
||||
|
||||
$scope.editProject = function()
|
||||
$scope.editProject = function(ev)
|
||||
{
|
||||
$scope.isEditPressed = true;
|
||||
console.log("EditPressed " + $scope.isEditPressed);
|
||||
}
|
||||
$scope.removeProject = function()
|
||||
|
||||
$scope.removeProject = function(ev)
|
||||
{
|
||||
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()
|
||||
{
|
||||
|
@ -28,7 +37,15 @@ angular.module('SeHub')
|
|||
$scope.project = data;
|
||||
console.log($scope.project);
|
||||
$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;
|
||||
// }
|
||||
|
||||
console.log($scope.project);
|
||||
}).error(function(err)
|
||||
{
|
||||
|
|
|
@ -2,10 +2,16 @@
|
|||
<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 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">
|
||||
<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 ng-if = "!scope.coursesEmpty">
|
||||
<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" >
|
||||
<div style="width:97%;height:97%">
|
||||
|
@ -26,12 +32,10 @@
|
|||
</div>
|
||||
</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>
|
||||
</md-card>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Lecturer Mode -->
|
||||
|
|
|
@ -1,38 +1,54 @@
|
|||
<div class = "project">
|
||||
<md-content layout-padding layout-margin>
|
||||
<h1 layout-margin style="margin-left:15px"><i class="fa fa-cube"></i> Project</h1>
|
||||
<!-- Yipi Kayea Mother Fraker -->
|
||||
<div flex = "99" layout = "row" layout-padding>
|
||||
<div layout = "row">
|
||||
<div layout = "column">
|
||||
<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">
|
||||
Project Logo
|
||||
<!-- <img ng-src="{{project.logo_url}} class = "md-avatar"> -->
|
||||
<img ng-src="{{project.logo_url}}" class = "md-avatar">
|
||||
</div>
|
||||
<div flex = "20">
|
||||
Project Name: {{project.projectName}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div layout = "row" flex = "45">
|
||||
<div flex>
|
||||
<md-button ng-click="editProject()" style = "size:150%; width:50%;" ng class="md-raised md-primary">
|
||||
<!-- <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 flex>
|
||||
<md-button ng-click="removeProject()" style = "size:150%%; width:40%;" ng class="md-raised md-primary">
|
||||
<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 = "18">
|
||||
<div flex = "10" layout-padding layout-margin border = "1">
|
||||
Team Members:
|
||||
<ul>
|
||||
<ul layout-padding>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
<div flex = "40">
|
||||
<div flex = "45">
|
||||
<!-- Graph -->
|
||||
<div ng-if="loadingData" layout-paddig layout-margin class="loader">
|
||||
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
|
||||
|
@ -47,8 +63,9 @@
|
|||
</md-card>
|
||||
</div>
|
||||
</div>
|
||||
</md-card>
|
||||
<div>
|
||||
<div flex = "96">
|
||||
<div flex = "96" style="height:70%;">
|
||||
<div flex>
|
||||
<md-card>
|
||||
<md-content class="md-padding">
|
||||
|
@ -62,7 +79,58 @@
|
|||
<md-tab label="Commits">
|
||||
<md-content class="md-padding">
|
||||
<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-tab>
|
||||
<md-tab label="Bugs">
|
||||
|
|
Loading…
Reference in a new issue