Skip to content

Commit

Permalink
Add carreer info to students grades (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasComercio committed Feb 4, 2017
1 parent 2bda23d commit 4faad97
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/scripts/controllers/students/StudentsGradesCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ define(
_this.student = student;
_this.student.getList('grades').then(function(transcript) {
_this.student.transcript = transcript;
if (transcript.totalCredits > 0) {
_this.carreerPrecentage = transcript.currentCredits / transcript.totalCredits * 100;
}
});
}, function(response) {
$log.info('Response status: ' + response.status);
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/i18n/translations.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ define([], function() {
i18nFullName: 'Nombre y Apellido',
i18nGradeInvalidRange: 'La nota debe ser mayor o igual a 1 y menor o igual a 10',
i18nOneDecimalOnly: 'La nota debe ser un número entero o un número decimal con un sólo decimal. Ejemplos: 10 ; 5.5 ; 3.4',
i18nCarreerPercentageCompleted: 'Porcentaje de carrera completado',
i18nApprovedCredits: 'Créditos aprobados',

// Courses Index
i18nCourseId: 'Código',
Expand Down
5 changes: 4 additions & 1 deletion app/scripts/services/Students.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ define(['paw', 'services/AuthenticatedRestangular'], function(paw) {
return data.students;
}
if (what === 'grades') {
return data.transcript;
var transcript = data.transcript;
transcript.currentCredits = data.currentCredits;
transcript.totalCredits = data.totalCredits;
return transcript;
}
return data;
} else if (operation === 'post') {
Expand Down
14 changes: 14 additions & 0 deletions app/styles/partials/students/grades.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
@import 'modules/variables/importer';

.students-grades-container {
.carreer-info-container {
.progress-bar-container {
border-radius: 0;
height: 35px;
margin: 0;

.progress-bar {
display: flex;
justify-content: center;
align-items: center;
}
}
}

.no-courses-on-sga {
padding: 15px;
border: 1px solid $persian-red;
Expand Down
13 changes: 13 additions & 0 deletions app/views/students/grades.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ <h2 class='inline'>
</div>
<!-- /Page Heading -->

<!-- Carreer info -->
<div class='carreer-info-container'>
<div>
<span class='bold' translate='i18nApprovedCredits'></span>
<span>: {{ controller.student.transcript.currentCredits }} / {{ controller.student.transcript.totalCredits }}</span>
</div>
<div>
<p class='bold' translate='i18nCarreerPercentageCompleted'></p>
<uib-progressbar class='progress-bar-container progress-striped active' value='controller.carreerPrecentage'><i>{{controller.carreerPrecentage}}%</i></uib-progressbar>
</div>
</div>
<!-- /Carreer info -->

<!-- Semesters -->
<div ng-show='controller.student.transcript.length <= 0' class='bg-warning'>
<p class='text-danger text-center no-courses-on-sga' translate='i18nNoCoursesOnSga'></p>
Expand Down

0 comments on commit 4faad97

Please sign in to comment.