Skip to content

Commit

Permalink
Created Courses Students Passed View (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasMercado committed Feb 3, 2017
1 parent 7d7a062 commit 81410ba
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 0 deletions.
62 changes: 62 additions & 0 deletions app/scripts/controllers/courses/CoursesStudentsPassedCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';

define(['paw'], function(paw) {
paw.controller('CoursesStudentsPassedCtrl', ['$routeParams', function($routeParams) {
var _this = this;
var courseId = $routeParams.courseId; // For future Service calls

this.course = {
courseId: '72.03',
name: 'Introducción a Informática',
credits: 3,
semester: 1,
passedStudents: [
{
grade: '4',
firstName: 'Matías',
lastName: 'Mercado',
docket: '55019'
},
{
grade: '10',
firstName: 'Facundo',
lastName: 'Mercado',
docket: '51202'
},
{
grade: '9.50',
firstName: 'Gibar',
lastName: 'Sin',
docket: '54655'
},
{
grade: '8.50',
firstName: 'Obi Wan',
lastName: 'Kenobi',
docket: '12000'
},
{
grade: '10',
firstName: 'Darth',
lastName: 'Vader',
docket: '66666'
},
{
grade: '8',
firstName: 'Luke',
lastName: 'Skywalker',
docket: '53222'
}]
};

this.filter = {
docket: $routeParams.docket,
firstName: $routeParams.firstName,
lastName: $routeParams.lastName
};

this.resetSearch = function() {
this.filter = {};
};
}]);
});
3 changes: 3 additions & 0 deletions app/scripts/i18n/translations.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ define([], function() {

// Courses Students Index
i18nQualify: 'Calificar',
// Courses Students Approved
i18nGrade: 'Nota',


// Search filters
i18nSearchButton: 'Buscar',
Expand Down
5 changes: 5 additions & 0 deletions app/scripts/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ define([], function() {
templateUrl: 'views/courses/students_index.html',
controller: 'CoursesStudentsIndexCtrl',
relativePath: '/courses'
},
'/courses/:courseId/students/passed': {
templateUrl: 'views/courses/students_passed.html',
controller: 'CoursesStudentsPassedCtrl',
relativePath: '/courses'
}
/* ===== yeoman hook ===== */
/* Do not remove these commented lines! Needed for auto-generation */
Expand Down
77 changes: 77 additions & 0 deletions app/views/courses/students_passed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<div ng-controller='CoursesStudentsPassedCtrl as controller' class='courses-students-passed-container'>
<!-- Page Heading -->
<div class='page-header break-words'>
<h1 class='inline'>
<span translate='i18nCoursesPanelSection'></span>
</h1>
<h2 class='inline'>
<span> - </span>
<span> {{controller.course.name}} </span>
<small> - </small>
<small translate='i18nCourseApproved'></small>
</h2>
</div>
<!-- /Page Heading -->

<!-- Filter -->
<div class='filter-container'>
<div class='filter-fields'>
<div class='own-input-group'>
<span class='search-label' translate=i18nDocket></span>
<input type='text' class='form-input-field' ng-model='controller.filter.docket' placeholder="{{ 'i18nDocket' | translate }}..."/>
</div>
<div class='own-input-group'>
<span class='search-label' translate='i18nFirstName'></span>
<input type='text' class='form-input-field' ng-model='controller.filter.firstName' placeholder="{{ 'i18nFirstName' | translate }}..."/>
</div>
<div class='own-input-group'>
<span class='search-label' translate='i18nLastName'></span>
<input type='text' class='form-input-field' ng-model='controller.filter.lastName' placeholder="{{ 'i18nLastName' | translate }}..."/>
</div>
</div>
<div class='filter-buttons'>
<button class='btn btn-default' type='submit'>
<span class='fa fa-search' aria-hidden='true'></span>
<span translate='i18nSearchButton' translate ></span>
</button>
<button class='btn btn-default' ng-click='controller.resetSearch()' type='submit'>
<span class='fa fa-repeat' aria-hidden='true'></span>
<span translate='i18nResetButton'></span>
</button>
</div>
</div>
<!-- /Filter -->

<!-- Students -->
<div class='table-responsive'>
<table class='table table-hover'>
<thead>
<tr>
<th translate='i18nDocket'></th>
<th translate='i18nFirstName'></th>
<th translate='i18nLastName'></th>
<th translate='i18nGrade'></th>
<th translate='i18nActions'></th>
</tr>
</thead>
<tbody>
<tr ng-hide='controller.course.passedStudents.length > 0' class='bg-warning'>
<td colspan='5' class='text-danger text-center' translate='i18nNoStudentsFound'></td>
</tr>
<tr ng-repeat='student in controller.course.passedStudents'>
<td>{{ student.docket }}</td>
<td>{{ student.firstName }}</td>
<td>{{ student.lastName }}</td>
<td>{{ student.grade }}</td>
<td class='actions-container'>
<a class='btn btn-default' role='button'>
<span class='fa fa-user' aria-hidden='true'></span>
<span translate='i18nStudentShow'></span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<!-- /Students -->
</div>

0 comments on commit 81410ba

Please sign in to comment.