Update repo with several changes

This commit is contained in:
Reynaldo Reyes
2016-04-27 20:34:27 -04:30
parent 38aaff259a
commit 0b3440abba
27 changed files with 316 additions and 146 deletions

View File

@@ -0,0 +1,14 @@
<div class="modal-header">
<h3 class="modal-title">Liberar BT</h3>
</div>
<div style="text-align: center" class="modal-body">
{{ mensaje }}
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-show="botonOk" type="button"
ng-click="vm.freeBTAddress(index)">OK</button>
<button class="btn btn-warning" ng-show="botonCancelar" type="button"
ng-click="cancel()">Cancelar</button>
<button class="btn btn-primary" ng-show="otroBotonOk" type="button"
ng-click="ok(urlLo)">Aceptar</button>
</div>

View File

@@ -20,6 +20,7 @@
if (value._id == selectedCourse._id ) {
vm.index = key;
vm.section = value.sections;
vm.course = value.name;
}
});
},
@@ -45,7 +46,8 @@
$rootScope.otroBotonOk = false;
$rootScope.botonCancelar = true;
$rootScope.rsplice = false;
$rootScope.mensaje = "¿Seguro que desea eliminar la sección?";
var name = vm.section[index].name;
$rootScope.mensaje = "¿Seguro que desea eliminar la sección "+name+"?";
$scope.modalInstance = $modal.open({
animation: $rootScope.animationsEnabled,

View File

@@ -1,5 +1,5 @@
<div class="row clearfix">
<h4>Listado de Secciones</h4></br>
<h4>Listado de Secciones en {{vm.course}} </h4></br>
<div>
<span class="input-group-btn">
<button class="btn-success btn" ng-click="vm.createSection()" style="margin: 10px"> Crear Sección </button>
@@ -31,10 +31,10 @@
<span ng-show="sortType == 'semester' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="10%" style="text-align: center">
Modificar
Matricula
</th>
<th width="10%" style="text-align: center">
Borrar
Eliminar
</th>
</tr>
</thead>

View File

@@ -5,8 +5,8 @@
.module('app.section')
.controller('SectionUpdateCtrl', SectionUpdateCtrl)
SectionUpdateCtrl.$inject = ['$scope', '$rootScope', '$state', 'professors', '$modal', 'selectedSection', 'selectedCourse'];
function SectionUpdateCtrl($scope, $rootScope, $state, professors, $modal, selectedSection, selectedCourse){
SectionUpdateCtrl.$inject = ['$scope', '$rootScope', '$state', 'professors', '$modal', 'selectedSection', 'selectedCourse','data'];
function SectionUpdateCtrl($scope, $rootScope, $state, professors, $modal, selectedSection, selectedCourse, data){
var professorid = $rootScope.professorId;
var vm = this;
vm.section = {};
@@ -28,10 +28,57 @@
console.log("Error al obtener los datos.");
});
vm.addStudent = function (index) {
vm.addStudent = function () {
$state.go('StudentCreate');
};
vm.mailUpdate = function (index) {
data.Student = vm.students[index];
data.Index = index;
$state.go('StudentUpdate');
};
vm.freeBTAddressModal = function (index) {
$rootScope.index = index;
$rootScope.botonOk = true;
$rootScope.otroBotonOk = false;
$rootScope.botonCancelar = true;
$rootScope.eliminarLoading = false;
$rootScope.mensaje = "¿Desea liberar la dirección de BT del estudiante "+ vm.students[index].lastname +", "+ vm.students[index].name + "?";
$scope.modalInstance = $modal.open({
animation: $rootScope.animationsEnabled,
templateUrl: 'partials/section/modal/student_bt_removal_modal.html',
scope: $scope,
size: 'sm',
resolve: {
items: function () {
return "";
}
}
});
};
vm.freeBTAddress = function (index) {
vm.student = vm.students[index];
vm.student.btaddress = null;
vm.professor.courses[selectedCourse.index].sections[selectedSection.index].students.push(vm.student);
professors.update({ id: professorid }, vm.professor,
function(){
$rootScope.botonOk = false;
$rootScope.otroBotonOk = true;
$rootScope.botonCancelar = false;
$rootScope.mensaje = "Dirección BT de " + vm.student.lastname + ", " + vm.student.name + " fue liberada";
},
function(){
$rootScope.botonOk = false;
$rootScope.otroBotonOk = true;
$rootScope.botonCancelar = false;
$rootScope.mensaje = "Error al liberar dirección de BT del estudiante " + vm.estudiante.Apellido + ", " + vm.estudiante.Nombre;
});
};
vm.retirarEstudianteModal = function (index) {
$rootScope.index = index;
$rootScope.botonOk = true;
@@ -39,7 +86,6 @@
$rootScope.botonCancelar = true;
$rootScope.eliminarLoading = false;
$rootScope.mensaje = "¿Desea retirar al estudiante "+ vm.students[index].lastname +", "+ vm.students[index].name + "?";
$scope.modalInstance = $modal.open({
animation: $rootScope.animationsEnabled,
templateUrl: 'partials/section/modal/update_section_modal.html',
@@ -71,12 +117,6 @@
});
};
$rootScope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$rootScope.opened = true;
};
$scope.ok = function () {
$scope.modalInstance.dismiss('cancel');
};
@@ -88,8 +128,6 @@
vm.back = function () {
$state.go('SectionList');
};
return vm;
};
})();

View File

@@ -10,26 +10,37 @@
<table class="table table-bordered table-striped">
<thead>
<tr>
<th width="10%">
<th width="10%" style="text-align: center">
Cedula
<span ng-show="sortType == 'id' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'id' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="20%">
<th width="20%" style="text-align: center">
Nombre
<span ng-show="sortType == 'name' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'name' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="20%">
<th width="20%" style="text-align: center">
Apellido
<span ng-show="sortType == 'lastname' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'lastname' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="30%">
<th width="20%" style="text-align: center">
Correo
<span ng-show="sortType == 'email' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'email' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="10%" style="text-align: center">
Actualizar Correo
</th>
<th width="10%" style="text-align: center">
Dirección BT
<span ng-show="sortType == 'email' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'email' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="10%" style="text-align: center">
Liberar Dirección BT
</th>
<th width="10%" style="text-align: center">
Retirar
</th>
@@ -42,8 +53,21 @@
<td style="vertical-align:middle">{{ student.lastname }}</td>
<td style="vertical-align:middle">{{ student.email }}</td>
<td style="text-align: center">
<span title="Click aqui para Eliminar un Estudiante"
class="glyphicon glyphicon-remove" aria-hidden="true"
<span class="glyphicon glyphicon-envelope"
aria-hidden="true"
ng-click="vm.mailUpdate($index)"
style="cursor:pointer;"></span>
</td>
<td style="vertical-align:middle">{{ student.btaddress }}</td>
<td style="text-align: center">
<span class="glyphicon glyphicon-signal"
aria-hidden="true"
ng-click="vm.freeBTAddressModal($index)"
style="cursor:pointer;"></span>
</td>
<td style="text-align: center">
<span class="glyphicon glyphicon-remove"
aria-hidden="true"
ng-click="vm.retirarEstudianteModal($index)"
style="cursor:pointer;"></span>
</td>