Skip to content

Commit

Permalink
Created Courses Final Inscriptions New & Show Views (#95)
Browse files Browse the repository at this point in the history
- Add translation messages
- Created style for the view
  • Loading branch information
MatiasMercado authored Feb 4, 2017
1 parent 98350b9 commit b5bc34a
Show file tree
Hide file tree
Showing 9 changed files with 401 additions and 115 deletions.
25 changes: 25 additions & 0 deletions app/scripts/controllers/courses/CoursesFinalInscriptionNewCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

define(['paw'], function(paw) {
paw.controller('CoursesFinalInscriptionNewCtrl', ['$routeParams', '$window', '$filter', function($routeParams, $window, $filter) {
var _this = this;
var courseId = $routeParams.courseId;
this.new = function(finalInscription) {
// Make Api request
var parsedDate = $filter('date')(finalInscription.finalExamDate, 'yyyy-MM-ddTHH:mm:ss');
};

this.cancel = function() {
$window.history.back();
};

this.currentDate = new Date();

this.course = {
courseId: '72.03',
credits: 3,
name: 'Introducción a Informática',
semester: 1
};
}]);
});
62 changes: 62 additions & 0 deletions app/scripts/controllers/courses/CoursesFinalInscriptionShowCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';

define(['paw'], function(paw) {
paw.controller('CoursesFinalInscriptionShowCtrl', ['$routeParams', function($routeParams) {
var _this = this;
var courseId = $routeParams.courseId;
var inscriptionId = $routeParams.inscriptionId;

this.formatDate = function(finalExamDate) {
var date = finalExamDate.split('T')[0];
var time = finalExamDate.split('T')[1];
return date.split('-')[2] + '/' + date.split('-')[1] + '/' + date.split('-')[0] + ' ' + time;
};

this.course = {
courseId: '72.03',
credits: 3,
name: 'Introducción a Informática',
semester: 1,
inscription: {
id: '1',
courseId: '93.42',
vacancy: '12',
maxVacancy: '50',
finalExamDate: '2017-01-20T18:45',
state: 'OPEN',
students: [
{
firstName: 'Matías',
lastName: 'Mercado',
docket: '55019'
},
{
firstName: 'Facundo',
lastName: 'Mercado',
docket: '51202'
},
{
firstName: 'Gibar',
lastName: 'Sin',
docket: '54655'
},
{
firstName: 'Obi Wan',
lastName: 'Kenobi',
docket: '12000'
},
{
firstName: 'Darth',
lastName: 'Vader',
docket: '66666'
},
{
firstName: 'Luke',
lastName: 'Skywalker',
docket: '53222'
}
]
}
};
}]);
});
27 changes: 17 additions & 10 deletions app/scripts/i18n/translations.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define([], function() {
i18nAddStudent: 'Agregar alumno',
i18nCoursesIndex: 'Ver todas',
i18nAddCourse: 'Agregar materia',
i18nAddFinalInscription: 'Agregar inscripción a final',

// Login
i18nLogin: 'Iniciar Sesión',
Expand Down Expand Up @@ -64,6 +65,7 @@ define([], function() {
// New
i18nStudentsNewButton: 'Agregar Alumno',
i18nAdminsNewButton: 'Agregar Administrador',
i18nFinalInscriptionNewButton: 'Agregar',

// User Update
i18nRequiredFields: 'Campos Obligatorios',
Expand Down Expand Up @@ -101,16 +103,6 @@ define([], function() {
i18nUnenroll: 'Dar de Baja',
// Students Inscriptions
i18nEnroll: 'Matricularse',
// Final Exams
i18nFinalExams: 'Exámenes Finales',
i18nFinalExamsTaken: 'Exámenes a los que se encuentra inscripto',
i18nVacancy: 'Cupos',
i18nState: 'Estado',
i18nFinalExamDate: 'Fecha del examen',
i18nNoFinalExamsFound: 'No se encontraron fechas de examen final',
i18nInscriptionOpen: 'Abierto',
i18nInscriptionClosed: 'Cerrado',
i18nFinalEnroll: 'Inscribirse',

// Courses Index
i18nCourseId: 'Código',
Expand All @@ -136,6 +128,19 @@ define([], function() {

// New
i18nCoursesButtonNew: 'Agregar',
// Final Exams
i18nFinalExams: 'Exámenes Finales',
i18nFinalExam: 'Exámen Final',
i18nFinalExamsTaken: 'Exámenes a los que se encuentra inscripto',
i18nVacancy: 'Cupos',
i18nState: 'Estado',
i18nFinalExamDate: 'Fecha del examen',
i18nNoFinalExamsFound: 'No se encontraron fechas de examen final',
i18nInscriptionOpen: 'Abierto',
i18nInscriptionClosed: 'Cerrado',
i18nFinalEnroll: 'Inscribirse',
i18nFinalStudents: 'Alumnos inscriptos',
i18nfinalExamDatePlaceholder: 'yyyy-MM-ddTHH:mm:ss',

// Search filters
i18nSearchButton: 'Buscar',
Expand All @@ -144,6 +149,7 @@ define([], function() {
i18nNoCoursesFound: 'No se encontraron materias disponibles',

// Form errors
i18nInvalidDate: 'La fecha seleccionada es inválida.',
i18nFormErrorDni: 'El DNI debe tener 8 dígitos.',
i18nNumericField: 'El valor ingresado debe ser un número válido.',
i18nFormErrorTelephone: 'El número de teléfono ingresado es inválido.',
Expand All @@ -152,5 +158,6 @@ define([], function() {
i18nLengthAnd: 'y',
i18nLengthSuffix: 'caracteres.'


};
});
220 changes: 115 additions & 105 deletions app/scripts/routes.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,119 @@
'use strict';

define([], function() {
return {
defaultRoutePath: '/',
routes: {
'/': {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
},
'/login': {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
},
'/students': {
templateUrl: 'views/students/index.html',
controller: 'StudentsIndexCtrl',
relativePath: '/students'
},
'/students/new': {
templateUrl: 'views/students/new.html',
controller: 'StudentsNewCtrl',
relativePath: '/students'
},
'/admins/new': {
templateUrl: 'views/admins/new.html',
controller: 'AdminsNewCtrl',
relativePath: '/admins'
},
'/students/:docket': {
templateUrl: 'views/students/show.html',
controller: 'StudentsShowCtrl',
relativePath: '/students'
},
'/students/:docket/edit': {
templateUrl: 'views/students/edit.html',
controller: 'StudentsEditCtrl',
relativePath: '/students'
},
'/courses': {
templateUrl: 'views/courses/index.html',
controller: 'CoursesIndexCtrl',
relativePath: '/courses'
},
'/courses/:courseId': {
templateUrl: 'views/courses/show.html',
controller: 'CoursesShowCtrl',
relativePath: '/courses'
},
'/courses/:courseId/students': {
templateUrl: 'views/courses/students_index.html',
controller: 'CoursesStudentsIndexCtrl',
relativePath: '/courses'
},
'/courses/:courseId/students/passed': {
templateUrl: 'views/courses/students_passed.html',
controller: 'CoursesStudentsPassedCtrl',
relativePath: '/courses'
},
'/courses/:courseId/correlatives/new': {
templateUrl: 'views/courses/correlatives_new.html',
controller: 'CoursesCorrelativesNewCtrl',
relativePath: '/courses'
},
'/students/:docket/courses': {
templateUrl: 'views/students/courses_index.html',
controller: 'StudentsCoursesIndexCtrl',
relativePath: '/students'
},
'/students/:docket/inscriptions': {
templateUrl: 'views/students/inscriptions.html',
controller: 'StudentsInscriptionsCtrl',
relativePath: '/students'
},
'/courses/:courseId/edit': {
templateUrl: 'views/courses/edit.html',
controller: 'CoursesEditCtrl',
relativePath: '/courses'
},
'/courses/new': {
templateUrl: 'views/courses/new.html',
controller: 'CoursesNewCtrl',
relativePath: '/courses'
},
'/students/:docket/final_inscriptions': {
templateUrl: '/views/students/final_inscriptions.html',
controller: 'StudentsFinalInscriptionsCtrl',
relativePath: '/students'
},
'/admins': {
templateUrl: 'views/admins/index.html',
controller: 'AdminsIndexCtrl',
relativePath: '/admins'
},
'/admins/:adminDni': {
templateUrl: '/views/admins/show.html',
controller: 'AdminsShowCtrl',
relativePath: '/admins'
},
'/user/change_password': {
templateUrl: 'views/user/change_password.html',
controller: 'UserChangePasswordCtrl',
relativePath: '/user'
}
/* ===== yeoman hook ===== */
/* Do not remove these commented lines! Needed for auto-generation */
}
};
return {
defaultRoutePath: '/',
routes: {
'/': {
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
},
'/login': {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
},
'/students': {
templateUrl: 'views/students/index.html',
controller: 'StudentsIndexCtrl',
relativePath: '/students'
},
'/students/new': {
templateUrl: 'views/students/new.html',
controller: 'StudentsNewCtrl',
relativePath: '/students'
},
'/admins/new': {
templateUrl: 'views/admins/new.html',
controller: 'AdminsNewCtrl',
relativePath: '/admins'
},
'/students/:docket': {
templateUrl: 'views/students/show.html',
controller: 'StudentsShowCtrl',
relativePath: '/students'
},
'/students/:docket/edit': {
templateUrl: 'views/students/edit.html',
controller: 'StudentsEditCtrl',
relativePath: '/students'
},
'/courses': {
templateUrl: 'views/courses/index.html',
controller: 'CoursesIndexCtrl',
relativePath: '/courses'
},
'/courses/:courseId': {
templateUrl: 'views/courses/show.html',
controller: 'CoursesShowCtrl',
relativePath: '/courses'
},
'/courses/:courseId/students': {
templateUrl: 'views/courses/students_index.html',
controller: 'CoursesStudentsIndexCtrl',
relativePath: '/courses'
},
'/courses/:courseId/students/passed': {
templateUrl: 'views/courses/students_passed.html',
controller: 'CoursesStudentsPassedCtrl',
relativePath: '/courses'
},
'/courses/:courseId/correlatives/new': {
templateUrl: 'views/courses/correlatives_new.html',
controller: 'CoursesCorrelativesNewCtrl',
relativePath: '/courses'
},
'/students/:docket/courses': {
templateUrl: 'views/students/courses_index.html',
controller: 'StudentsCoursesIndexCtrl',
relativePath: '/students'
},
'/students/:docket/inscriptions': {
templateUrl: 'views/students/inscriptions.html',
controller: 'StudentsInscriptionsCtrl',
relativePath: '/students'
},
'/courses/:courseId/edit': {
templateUrl: 'views/courses/edit.html',
controller: 'CoursesEditCtrl',
relativePath: '/courses'
},
'/courses/new': {
templateUrl: 'views/courses/new.html',
controller: 'CoursesNewCtrl',
relativePath: '/courses'
},
'/students/:docket/final_inscriptions': {
templateUrl: '/views/students/final_inscriptions.html',
controller: 'StudentsFinalInscriptionsCtrl',
relativePath: '/students'
},
'/admins': {
templateUrl: 'views/admins/index.html',
controller: 'AdminsIndexCtrl',
relativePath: '/admins'
},
'/admins/:adminDni': {
templateUrl: '/views/admins/show.html',
controller: 'AdminsShowCtrl',
relativePath: '/admins'
},
'/user/change_password': {
templateUrl: 'views/user/change_password.html',
controller: 'UserChangePasswordCtrl',
relativePath: '/user'
},
'/courses/:courseId/final_inscriptions/new': {
templateUrl: 'views/courses/final_inscriptions_new.html',
controller: 'CoursesFinalInscriptionNewCtrl',
relativePath: '/courses'
},
'/courses/:courseId/final_inscriptions/:inscriptionId': {
templateUrl: 'views/courses/final_inscriptions_show.html',
controller: 'CoursesFinalInscriptionShowCtrl',
relativePath: '/courses'
}
/* ===== yeoman hook ===== */
/* Do not remove these commented lines! Needed for auto-generation */
}
};
});
2 changes: 2 additions & 0 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ $fa-font-path: '../bower_components/font-awesome/fonts';
@import 'partials/admins/show';
@import 'partials/login';
@import 'partials/user/change_password';
@import 'partials/courses/final_inscriptions_show';
@import 'partials/courses/final_inscriptions_new';
Loading

0 comments on commit b5bc34a

Please sign in to comment.