Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created Students Courses Index View #84

Merged
merged 1 commit into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions app/scripts/controllers/students/StudentsCoursesIndexCtrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';

define(['paw'], function(paw) {
paw.controller('StudentsCoursesIndexCtrl', ['$routeParams', function($routeParams) {
var docket = $routeParams.docket; // For future Service calls

this.student = {
docket: '55019',
firstName: 'Matías',
lastName: 'Mercado',
email: 'mmercado@itba.edu.ar',
genre: 'Masculino',
dni: '38917403',
birthday: '1995-05-04',
address: {
country: 'Argentina',
city: 'Buenos Aires',
neighborhood: 'Almagro',
number: '682',
street: 'Corrientes',
floor: '2',
door: 'A',
telephone: '1544683390',
zipCode: '1100'
},
courses: [
{
courseId: '72.03',
credits: 3,
name: 'Introducción a Informática',
semester: 1
},
{
courseId: '94.21',
credits: 6,
name: 'Formacion General I',
semester: 5
}
]
};

this.filter = {
id: $routeParams.id,
name: $routeParams.name
};
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 @@ -84,6 +84,9 @@ define([], function() {
// Course Show
i18nCourses: 'Materias',
i18nInformation: 'Información',
// Students Inscriptions
i18nUnenroll: 'Dar de Baja',
// Courses Index
i18nCourseId: 'Código',
i18nCourseName: 'Nombre',
i18nCredits: 'Créditos',
Expand Down
5 changes: 5 additions & 0 deletions app/scripts/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ define([], function() {
templateUrl: 'views/courses/correlatives_new.html',
controller: 'CoursesCorrelativesNewCtrl',
relativePath: '/courses'
},
'/students/:docket/courses': {
templateUrl: 'views/students/courses_index.html',
controller: 'StudentsCoursesIndexCtrl',
relativePath: '/students'
}
/* ===== yeoman hook ===== */
/* Do not remove these commented lines! Needed for auto-generation */
Expand Down
1 change: 1 addition & 0 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ $fa-font-path: '../bower_components/font-awesome/fonts';
@import 'partials/courses/show';
@import 'partials/courses/students_index';
@import 'partials/courses/correlatives_new';
@import 'partials/students/courses_index';
20 changes: 20 additions & 0 deletions app/styles/partials/students/_courses_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@import 'modules/variables/importer';

.students-courses-index-container {
.table {
.actions-container {
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: flex-start;

.btn {
flex: 1;
min-width: 175px;
max-width: 200px;
margin: 10px;
margin-left: 0;
}
}
}
}
77 changes: 77 additions & 0 deletions app/views/students/courses_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<div ng-controller='StudentsCoursesIndexCtrl as controller' class='students-courses-index-container'>
<!-- Page Heading -->
<div class='page-header break-words'>
<h1 class='inline'>
<span translate='i18nStudents'></span>
</h1>
<h2 class='inline'>
<span> - </span>
<span> {{controller.student.firstName}} {{controller.student.lastName}}</span>
<small> - </small>
<small translate='i18nStudentCourses'></small>
</h2>
</div>
<!-- /Page Heading -->

<!-- Filter -->
<div class='filter-container'>
<div class='filter-fields'>
<div class='own-input-group'>
<span class='search-label' translate=i18nCourseId></span>
<input type='text' class='form-input-field' ng-model='controller.filter.id' placeholder="{{ 'i18nCourseId' | translate }}..."/>
</div>
<div class='own-input-group'>
<span class='search-label' translate='i18nCourseName'></span>
<input type='text' class='form-input-field' ng-model='controller.filter.name' placeholder="{{ 'i18nCourseName' | 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 -->

<!-- Content -->
<div class='table-responsive'>
<table class='table table-hover'>
<thead>
<tr>
<th translate='i18nCourseId'></th>
<th translate='i18nCourseName'></th>
<th translate='i18nCredits'></th>
<th translate='i18nSemester'></th>
<th translate='i18nActions'></th>
</tr>
</thead>
<tbody>
<tr ng-hide='controller.student.courses.length > 0' class='bg-warning'>
<td colspan='5' class='text-danger text-center' translate='i18nNoCoursesFound'></td>
</tr>
<tr ng-repeat='course in controller.student.courses'>
<td>{{ course.courseId }}</td>
<td>{{ course.name }}</td>
<td>{{ course.credits }}</td>
<td>{{ course.semester }}</td>
<td class='actions-container'>
<a class='btn btn-default' role='button'>
<span class='fa fa-info-circle' aria-hidden='true'></span>
<span translate='i18nCourseShow'></span>
</a>
<a class='btn btn-danger' role='button'>
<span class='fa fa-trash' aria-hidden='true'></span>
<span translate='i18nUnenroll'></span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Content -->
</div>