commit 90d22e340552b5ce13581ea158d1bd2566130a5e Author: Reynaldo Reyes Date: Mon Feb 29 00:49:18 2016 -0430 Initial commit diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..ba0accc --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0b7808 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.tmp +/nbproject/private/ \ No newline at end of file diff --git a/app/css/demo-framework.css b/app/css/demo-framework.css new file mode 100644 index 0000000..c6c0db2 --- /dev/null +++ b/app/css/demo-framework.css @@ -0,0 +1,70 @@ +body { + padding-top: 70px; + padding-bottom: 30px; +} + +.box { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); + box-shadow: 0 1px 2px rgba(0,0,0,.05); +} + +.box > h3 { + color: #333; + border-color: #ddd; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; + background-repeat: repeat-x; + display: block; + font-size: 16px; + padding: 10px 15px; + margin-top: 0; + margin-bottom: 0; +} + +.box-padding { + padding: 15px; +} + +.box-padding > h3 { + margin: -15px; + margin-bottom: 15px; +} + +.box-grey { + border-color: #ddd; +} + +.box-grey > h3 { + background-color: #f5f5f5; + background-image: -webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%); + background-image: linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%); +} + +.box-blue { + border-color: #bce8f1; +} + +.box-blue > h3 { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; + background-image: -webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%); + background-image: linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%); +} + +.box-yellow { + border-color: #faebcc; +} + +.box-yellow > h3 { + //color: #8a6d3b; + //background-color: #fcf8e3; + //border-color: #faebcc; + //background-image: -webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%); + //background-image: linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%); +} \ No newline at end of file diff --git a/app/css/nested.css b/app/css/nested.css new file mode 100644 index 0000000..e57c969 --- /dev/null +++ b/app/css/nested.css @@ -0,0 +1,149 @@ +/***************************** Required styles *****************************/ + +/** + * For the correct positioning of the placeholder element, the dnd-list and + * it's children must have position: relative + */ +.nestedDemo ul[dnd-list], +.nestedDemo ul[dnd-list] > li { + position: relative; +} + +/***************************** Dropzone Styling *****************************/ + +/** + * The dnd-list should always have a min-height, + * otherwise you can't drop to it once it's empty + */ +.nestedDemo .dropzone ul[dnd-list] { + min-height: 42px; + margin: 0px; + padding-left: 0px; +} + +/** + * The dnd-lists's child elements currently MUST have + * position: relative. Otherwise we can not determine + * whether the mouse pointer is in the upper or lower + * half of the element we are dragging over. In other + * browsers we can use event.offsetY for this. + */ +.nestedDemo .dropzone li { + background-color: #fff; + border: 1px solid #ddd; + display: block; + padding: 0px; +} + +/** + * Reduce opacity of elements during the drag operation. This allows the user + * to see where he is dropping his element, even if the element is huge. The + * .dndDragging class is automatically set during the drag operation. + */ +.nestedDemo .dropzone .dndDragging { + opacity: 0.7; +} + +/** + * The dndDraggingSource class will be applied to the source element of a drag + * operation. It makes sense to hide it to give the user the feeling that he's + * actually moving it. Note that the source element has also .dndDragging class. + */ +.nestedDemo .dropzone .dndDraggingSource { + display: none; +} + +/** + * An element with .dndPlaceholder class will be added as child of the dnd-list + * while the user is dragging over it. + */ +.nestedDemo .dropzone .dndPlaceholder { + background-color: #ddd; + min-height: 42px; + display: block; + position: relative; +} + +/***************************** Element Selection *****************************/ + +.nestedDemo .dropzone .selected .item { + color: #3c763d; + background-color: #dff0d8; +} + +.nestedDemo .dropzone .selected .box { + border-color: #d6e9c6; +} + +.nestedDemo .dropzone .selected .box > h3 { + color: #3c763d; + background-color: #dff0d8; + background-image: linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%); + border-color: #d6e9c6; +} + +/***************************** Element type specific styles *****************************/ + +.nestedDemo .dropzone .item { + padding: 10px 15px; +} + +.nestedDemo .dropzone .container-element { + margin: 10px; +} + +.nestedDemo .dropzone .container-element .column { + float: left; + width: 16.666%; +} + +.nestedDemo .dropzone .container-element .columnQuestions { + float: left; + width: 100%; +} +/***************************** Toolbox *****************************/ + +.nestedDemo .toolbox ul { + list-style: none; + padding-left: 0px; + cursor: move; +} + +.nestedDemo .toolbox button { + margin: 5px; + //width: 123px; + opacity: 1.0; +} + +.nestedDemo .toolbox .dndDragging { + opacity: 0.5; +} + +.nestedDemo .toolbox .dndDraggingSource { + opacity: 1.0; +} + +/***************************** Trashcan *****************************/ + +.nestedDemo .trashcan ul { + list-style: none; + padding-left: 0px; +} + +.nestedDemo .trashcan img { + width: 100%; + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + filter: grayscale(100%); +} + +.nestedDemo .trashcan .dndDragover img { + width: 100%; + -webkit-filter: none; + -moz-filter: none; + filter: none; +} + +.nestedDemo .trashcan .dndPlaceholder { + display: none; +} diff --git a/app/css/search-box-example.css b/app/css/search-box-example.css new file mode 100644 index 0000000..ab7b29c --- /dev/null +++ b/app/css/search-box-example.css @@ -0,0 +1,59 @@ +html, body { + height: 100%; + margin: 0px; + padding: 0px +} + +.pac-controls { + margin-top: 16px; + border: 1px solid transparent; + border-radius: 2px 0 0 2px; + box-sizing: border-box; + -moz-box-sizing: border-box; + height: 32px !important; + outline: none; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); +} + +#pac-input { + background-color: #fff; + padding: 0 11px 0 13px; + width: 400px; + font-family: 'Open Sans', sans-serif; + font-size: 15px; + font-weight: 300; + text-overflow: ellipsis; +} + +#pac-input:focus { + border-color: #4d90fe; + margin-left: -1px; + padding-left: 14px; /* Regular padding-left + 1. */ + width: 401px; +} + +.pac-container { + font-family: 'Open Sans', sans-serif; +} + +#type-selector { + color: #fff; + background-color: #4d90fe; + padding: 5px 11px 0px 11px; +} + +#type-selector label { + font-family: 'Open Sans', sans-serif; + font-size: 13px; + font-weight: 300; +} + +.angular-google-map-container { + width: 100%; + height: 600px; +} + +/* fix for Twitter Bootstrap handling of responsive images */ +.angular-google-map img { + max-width: inherit; +} diff --git a/app/css/style.css b/app/css/style.css new file mode 100644 index 0000000..2459bc8 --- /dev/null +++ b/app/css/style.css @@ -0,0 +1,130 @@ +/* + * Estilos para el modulo de notas marginales. + */ + +/* El contenido se desplaza hacia abajo porque usamos una barra de navegación fija de 50px */ +body { + padding-top: 85px; +} + +/* + * Barra de navegación superior + * Se elimina el borde por defecto de 1px. + */ +.navbar-fixed-top { + border: 0; +} + +.navbar-fixed-top-special { + position: fixed; + z-index: 30; +} + +/* + * Sidebar + */ + +/* Hide for mobile, show later */ +.sidebar { + display: none; +} +@media (min-width: 768px) { + .sidebar { + position: fixed; + top: 85px; + bottom: 0; + left: 0; + z-index: 1000; + display: block; + padding: 20px; + overflow-x: hidden; + overflow-y: auto; /* Si el contenido es mayor al visor, se hace scroll */ + background-color: #f5f5f5; + border-right: 1px solid #ccc; + } +} + +/* Navegación del sidebar */ +.nav-sidebar { + margin-right: -21px; /* 20px padding + 1px border */ + margin-bottom: 20px; + margin-left: -20px; +} +.nav-sidebar > li > a { + padding-right: 20px; + padding-left: 20px; + color: #000; +} +.nav-sidebar > .active > a, +.nav-sidebar > .active > a:hover, +.nav-sidebar > .active > a:focus { + font-style: italic; + color: #FFF; + background-color: #808080; +} + + +/* + * Contenido principal. + */ + +.main { padding: 20px; } + +@media (min-width: 768px) { + .main { + padding-right: 40px; + padding-left: 40px; + } +} +.main .page-header { margin-top: 0; } + +/* Barra superior */ +.navbar { min-height: 85px; } +.navbar-inverse { background-color: #CCC; } +.navbar-inverse .navbar-brand { color: #808080; } +.navbar-inverse .navbar-nav > li > a { color: #808080; } + +/* Estilos para errores de validación */ +small.error { color: red; } +input.ng-dirty.ng-valid { border:1px solid Green; } +input.ng-dirty.ng-invalid { border:1px solid Red; } + + +.research tr.accordion td { background:transparent url(row_bkg.png) repeat-x scroll center left; cursor:pointer; } +.research .accordion img.arrow { background:transparent url(../img/arrows.png) no-repeat scroll 0px -16px; width:16px; height:16px; display:block;} +.research .accordion img.up { background:transparent url(../img/arrows.png) no-repeat scroll 0px -16px; width:16px; height:16px; display:block; background-position:0px 0px;} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +svg .state { + stroke-width: 2; + stroke: #fff; + + -webkit-transition: stroke 0.5s, stroke-width 0.5s; + -o-transition: stroke 0.5s, stroke-width 0.5s; + transition: stroke 0.5s, stroke-width 0.5s; +} +svg .state:hover , .state.active { + cursor: pointer; + stroke-width: 4; + stroke: #000; +} + +.regionlist { + -webkit-column-count: 5; /* Chrome, Safari, Opera */ + -moz-column-count: 5; /* Firefox */ + column-count: 5; +} +.regionlist > div { + display: inline-block; + width: 100%; + border-bottom: 1px solid grey; +} +.regionlist > div > div { + display: inline-block; + width: 48%; +} \ No newline at end of file diff --git a/app/img/logo_ciencias.jpg b/app/img/logo_ciencias.jpg new file mode 100644 index 0000000..ad8fc22 Binary files /dev/null and b/app/img/logo_ciencias.jpg differ diff --git a/app/img/logo_computacion.jpg b/app/img/logo_computacion.jpg new file mode 100644 index 0000000..a81a9fa Binary files /dev/null and b/app/img/logo_computacion.jpg differ diff --git a/app/img/logo_ucv.jpg b/app/img/logo_ucv.jpg new file mode 100644 index 0000000..32d108f Binary files /dev/null and b/app/img/logo_ucv.jpg differ diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..a15263a --- /dev/null +++ b/app/index.html @@ -0,0 +1,109 @@ + + + + + + + + + + Modulo de Administración de Asistencia + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/js/app.js b/app/js/app.js new file mode 100644 index 0000000..8536ab6 --- /dev/null +++ b/app/js/app.js @@ -0,0 +1,37 @@ +(function (){ + 'user strict'; + + angular.module('app', [ + 'app.course', + 'app.login', + 'app.professor', + 'app.reports', + 'app.section', + 'app.student', + 'ngResource', + 'ui.router' + ]) + + .config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise('/'); + + $stateProvider + .state('login', { + url: '/login', + views: { + content: { + templateUrl: 'login.html', + controller: 'loginCtrl', + controllerAs: 'vm' + } + } + }) + }) + + .run(function ($rootScope) { + $rootScope.domainUrl = 'Localhost:3000'; + }); + + +})(); diff --git a/app/js/course/course.controllers.js b/app/js/course/course.controllers.js new file mode 100644 index 0000000..605e051 --- /dev/null +++ b/app/js/course/course.controllers.js @@ -0,0 +1,176 @@ +(function(){ + 'use strict'; + + angular + .module('app.course') + .controller('listarMateriaCtrl',listarMateriaCtrl) + .controller('crearMateriaCtrl', crearMateriaCtrl) + + listarMateriaCtrl.$inject = + ['$scope', '$rootScope', '$location', 'courses', '$modal']; + function listarMateriaCtrl($scope, $rootScope, $location, courses, $modal) { + var vm = this; + $rootScope.table = false; + + var materiaArreglo = []; + courses.query( + function(data){ + vm.materia = data; + angular.forEach(vm.materia, function (value){ + materiaArreglo.push({ + Codigo:value.Codigo, + Nombre:value.Nombre, + Creditos:value.Creditos, + Descripcion:value.Descripcion + }); + }); + $rootScope.table = true; + vm.listaMateria = materiaArreglo; + }, + function(data){ + console.log("Error al obtener los datos."); + + }); + + vm.eliminarMateriaModal = function (index) { + $rootScope.index = index; + $rootScope.botonOk = true; + $rootScope.otroBotonOk = false; + $rootScope.botonCancelar = true; + $rootScope.rsplice = false; + $rootScope.loading = false; + $rootScope.mensaje = "¿Seguro que desea eliminar la materia?"; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: '/partials/course/modal/delete_course_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return ""; + } + } + }); + + }; + + vm.eliminarMateria = function (index) { + $rootScope.loadingListarForm = true; + $rootScope.botonOk = false; + $rootScope.otroBotonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarMateria'; + $rootScope.rsplice = true; + + courses.delete({ id: vm.materia[index]._id }, + function() { + $rootScope.loadingListarForm = false; + $rootScope.mensaje = "Materia eliminada"; + }, + function() { + $rootScope.loadingListarForm = false; + $rootScope.mensaje = "Error eliminado materia"; + }); + }; + + vm.eliminarMateriaSplice = function(index, rsplice) { + if(rsplice){ + vm.listaMateria.splice(index, 1); + $rootScope.rsplice = false; + } + }; + + vm.modificarMateria = function (index) { + $location.url('modificarMateria'); + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + return vm; + }; + + crearMateriaCtrl.$inject = + ['$scope','$rootScope', '$modal', '$location', 'courses']; + function crearMateriaCtrl($scope, $rootScope, $modal, $location, courses) { + + var vm = this; + vm.submitted = false; + vm.mayorque = false; + $rootScope.mensaje = ""; + + vm.submit = function() { + + if (vm.data_input_form.$valid){ + vm.course = { + + "Codigo": vm.materia.Codigo, + "Nombre": vm.materia.Nombre, + "Creditos": vm.materia.Creditos, + "Descripcion" : vm.materia.Description, + }; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: + '/partials/course/modal/create_course_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + courses.save(vm.course, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarMateria'; + $rootScope.mensaje = + "Materia " + vm.materia.Nombre + " creada"; + }, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarMateria'; + $rootScope.mensaje = + "Error creando la materia " + vm.materia.Nombre; + }); + }else{ + + vm.submitted = true; + } + } + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + return vm; + }; +})(); \ No newline at end of file diff --git a/app/js/course/course.module.js b/app/js/course/course.module.js new file mode 100644 index 0000000..1d595ca --- /dev/null +++ b/app/js/course/course.module.js @@ -0,0 +1,57 @@ +(function(){ + 'use strict'; + + angular + .module("app.course", ['ui.router', 'ui.bootstrap']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/listarMaterias'); + + $stateProvider + .state('listarMateria', { + url: '/listarMateria', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/course/list_course.html', + controller: 'listarMateriaCtrl', + controllerAs: "vm" + } + } + }) + + .state('crearMateria', { + url: '/crearMateria', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/course/create_course.html', + controller: 'crearMateriaCtrl', + controllerAs: "vm" + } + } + }) + + }; +})(); diff --git a/app/js/course/course.services.js b/app/js/course/course.services.js new file mode 100644 index 0000000..a1ab8df --- /dev/null +++ b/app/js/course/course.services.js @@ -0,0 +1,13 @@ +(function(){ + 'use strict'; + + angular + .module('app.course') + .factory('courses', courses) + .value('id',{}); + + courses.$inject = ['$resource','$rootScope']; + function courses($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/courses/:id', null); + }; +})(); diff --git a/app/js/login/login.controllers.js b/app/js/login/login.controllers.js new file mode 100644 index 0000000..14c00ff --- /dev/null +++ b/app/js/login/login.controllers.js @@ -0,0 +1,175 @@ +(function(){ + 'use strict'; + + angular + .module('app.login') + .controller('loginCtrl', loginCtrl) + .controller('ModalInstanceLoginCtrl', ModalInstanceLoginCtrl) + .constant('datepickerPopupConfig', { + datepickerPopup: 'yyyy-MM-dd', + html5Types: { + date: 'yyyy-MM-dd', + 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', + 'month': 'yyyy-MM' + }, + currentText: 'Hoy', + clearText: 'Limpiar', + closeText: 'Cerrar', + closeOnDateSelection: true, + appendToBody: false, + showButtonBar: true + }); + + + ModalInstanceLoginCtrl.$inject = ['$scope', '$modalInstance', 'items', '$location']; + function ModalInstanceLoginCtrl($scope, $modalInstance, items, $location){ + + $scope.items = items; + + $scope.okLogin = function (actOk, urlLo) { + //$modalInstance.close($scope.selected.item); + if(actOk){ + $location.url(urlLo); + $modalInstance.dismiss('cancel'); + } + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + + + }; + + loginCtrl.$inject = ['$rootScope', '$location', 'Login', 'Rol','GetRol', 'hash', '$http', 'user', '$modal']; + function loginCtrl($rootScope, $location, Login, Rol, GetRol, hash, $http, user, $modal){ + var vm = this; + + + //$http.get("http://cesar:12316/api/Rol") + //.success(function(response) {$rootScope.namesw = response.Data;}); + + vm.user = user; + vm.submitted = false; + vm.mayorque = false; + $rootScope.items = ""; + $rootScope.mensaje = ""; + vm.submit = function() { + //var verificar = false; + if (vm.data_input_form.$valid){ + // se implementa todo lo necesario antes de pasar a la siguiente página. + vm.pkg = { + + "Nickname": vm.user.Nickname, + "Password": $rootScope.password + + }; + //$rootScope.mostrar = false; + $rootScope.loadingLogin = true; + $rootScope.mensaje = ""; + $rootScope.bcancel = false; + $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'myModalContentLogin.html', + controller: 'ModalInstanceLoginCtrl', + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + Login.save(vm.pkg, + function(data){ + //$rootScope.mostrar = true; + $rootScope.loadingLogin = false; + //verificar = data.Data._value; + if(data.Data._value != null){ + //$rootScope.bok = true; + $rootScope.actOk = true; + $rootScope.urlLo = 'mapasReportes'; + $rootScope.bcancel = false; + + }else{ + $rootScope.bcancel = true; + $rootScope.mensaje = data.Data._error; + } + }, + function(data){ + verificar = data.Data; + if(verificar){ + alert("no existe el usuario"); + } + + }) + GetRol.get({id:vm.user.Nickname}, function(data){ + $rootScope.role = data.Data; + } + + ); + + //$location.url('/preview/'); + }else{ + + vm.submitted = true; + } + } + + vm.onSelectChange = function () { + if(vm.genero == "Masculino"){ + $rootScope.Gender = "M"; + //alert("hola " + vm.valorRol.Name); + } + if(vm.genero == "Femenino"){ + $rootScope.Gender = "F"; + } + }; + + //$rootScope.password="s3cret"; + $rootScope.getHash = function(message) { + var hashResult = hash(message); + $rootScope.password = hashResult; + return hashResult; + }; + + vm.generos = ['', 'Masculino', 'Femenino']; + vm.genero = vm.generos[0]; + + Rol.get( + function(data){ + $rootScope.rol = data.Data; + } + ); + + + vm.toggleMin = function() { + vm.maxDate = vm.maxDate ? null : new Date(); + }; + vm.toggleMin(); + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + $rootScope.open2 = function($eventt) { + $eventt.preventDefault(); + $eventt.stopPropagation(); + + $rootScope.openedd = true; + }; + + $rootScope.dateOptions = { + formatYear: 'yy', + startingDay: 1 + }; + + return vm; + }; + + + + +})(); diff --git a/app/js/login/login.module.js b/app/js/login/login.module.js new file mode 100644 index 0000000..ec202c4 --- /dev/null +++ b/app/js/login/login.module.js @@ -0,0 +1,34 @@ +(function(){ + + 'use strict'; + + angular + .module("app.login", ['ui.router', 'ui.bootstrap']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/'); + + $stateProvider + .state('root', { + url: '', + views: { + content: { + templateUrl: 'login.html', + controller: 'LoginCtrl', + controllerAs: 'vm' + } + } + }) + + + }; +})(); diff --git a/app/js/login/login.services.js b/app/js/login/login.services.js new file mode 100644 index 0000000..5f2ca5b --- /dev/null +++ b/app/js/login/login.services.js @@ -0,0 +1,56 @@ +(function(){ + 'use strict'; + + angular + .module('app.login') + .factory('Login', Login) + .factory('Rol', Rol) + .factory('GetRol', GetRol) + .factory('hash', hash) + .value('algoritmo','SHA-1') + .value('user',{}) + .value('id',{}) + + + Login.$inject = ['$resource','$rootScope']; + function Login($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/api/VerifyUser'); + + }; + + Rol.$inject = ['$resource','$rootScope']; + function Rol($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/api/Rol'); + }; + + GetRol.$inject = ['$resource','$rootScope']; + function GetRol($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/api/User/:id'); + }; + + hash.$inject = ['algoritmo']; + function hash(algoritmo){ + + var hashFunction; + + if (algoritmo==="MD5") { + hashFunction=CryptoJS.MD5; + } else if (algoritmo==="SHA-1") { + hashFunction=CryptoJS.SHA1; + } else if (algoritmo==="SHA-2-256") { + hashFunction=CryptoJS.SHA256; + } else if (algoritmo==="SHA-2-512") { + hashFunction=CryptoJS.SHA512; + } else { + throw Error("El tipo de algoritmo no es válido:"+algoritmo); + } + + var hash=function(message) { + var objHashResult=hashFunction(message); + var strHashResult=objHashResult.toString(CryptoJS.enc.Base64); + + return strHashResult; + } + return hash; + }; +})(); diff --git a/app/js/professor/professor.controllers.js b/app/js/professor/professor.controllers.js new file mode 100644 index 0000000..9d157ac --- /dev/null +++ b/app/js/professor/professor.controllers.js @@ -0,0 +1,256 @@ +(function(){ + 'use strict'; + + angular + .module('app.professor') + .controller('listarProfesorCtrl', listarProfesorCtrl) + .controller('crearProfesorCtrl', crearProfesorCtrl) + .controller('actualizarProfesorCtrl', actualizarProfesorCtrl) + + listarProfesorCtrl.$inject = + [ '$scope', '$rootScope', '$location', 'professors', '$modal', 'profesorSeleccionado' ]; + function listarProfesorCtrl( $scope, $rootScope, $location, professors, $modal, profesorSeleccionado ){ + + var vm = this; + vm.lista = true; + $rootScope.actOk = false; + $rootScope.loading = true; + $rootScope.table = false; + + var profesorArray = []; + professors.query( + function(data){ + vm.profesor = data; + angular.forEach(vm.profesor, function (value){ + profesorArray.push({ + Cedula:value.id, + Nombre:value.name, + Apellido:value.lastname, + Telefono:value.number, + Correo: value.email + }); + }); + $rootScope.loading = false; + $rootScope.table = true; + vm.listaProfesor = profesorArray; + + }, + function(){ + console.log("Error al obtener los datos."); + }); + + vm.eliminarProfesorModal = function (index) { + $rootScope.index = index; + $rootScope.botonOK = true; + $rootScope.botonCancelar = true; + $rootScope.acceptButton = false; + + $rootScope.rsplice = false; + $rootScope.mensaje = "¿Seguro que desea eliminar el Profesor?"; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/professor/modal/list_professor_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return ""; + } + } + }); + }; + + vm.eliminarProfesor = function (index) { + + $rootScope.botonOK = false; + $rootScope.acceptButton = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarProfesor'; + + professors.delete({id: vm.profesor[index]._id}, + function () { + $rootScope.rsplice = true; + $rootScope.mensaje = + "Profesor " + vm.profesor[index].name + " eliminado"; + }, + function () { + $rootScope.listarProfesorsLoading = false; + $rootScope.mensaje = + "Error eliminando al Profesor " + vm.profesor[index].name; + }); + }; + + vm.removeProfesorSplice = function(index, rsplice) { + if(rsplice){ + vm.listaProfesor.splice(index, 1); + $rootScope.rsplice = false; + } + }; + + vm.modificarProfesor = function (index) { + profesorSeleccionado._id = vm.profesor[index]._id; + profesorSeleccionado.Cedula = vm.profesor[index].id; + profesorSeleccionado.Nombre = vm.profesor[index].name; + profesorSeleccionado.Apellido= vm.profesor[index].lastname; + profesorSeleccionado.Telefono = vm.profesor[index].number; + profesorSeleccionado.Correo= vm.profesor[index].email; + $location.url('actualizarProfesor'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + return vm; + }; + + crearProfesorCtrl.$inject = + ['$scope','$rootScope', '$location', 'professors', '$modal']; + function crearProfesorCtrl($scope, $rootScope, $location, professors, $modal){ + + var vm = this; + $rootScope.mensaje = ""; + + vm.submit = function() { + + if (vm.data_input_form.$valid){ + var professor = { + "id": vm.profesor.Cedula, + "name": vm.profesor.Nombre, + "lastname": vm.profesor.Apellido, + "email": vm.profesor.Correo, + "number": vm.profesor.Telefono, + }; + + $rootScope.botonOk = false; + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/professor/modal/create_professor_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + professors.save(professor, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarProfesor'; + $rootScope.mensaje = + "Profesor " + vm.profesor.Apellido + ", " + vm.profesor.Nombre + " agregado"; + }, + + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarProfesor'; + $rootScope.mensaje = + "Error al agregar al profesor " + vm.profesor.Apellido + ", " + vm.profesor.Nombre; + }); + }else{ + + vm.submitted = true; + } + } + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + return vm; + }; + + actualizarProfesorCtrl.$inject = + ['$scope','$rootScope', '$location', 'professors', '$modal', 'profesorSeleccionado' ]; + function actualizarProfesorCtrl ( $scope, $rootScope, $location, professors, $modal, profesorSeleccionado ){ + + var vm = this; + vm.profesor = profesorSeleccionado; + $rootScope.mensaje = ""; + $rootScope.actOk = false; + + vm.submit = function() { + + var professor = { + "_id": vm.profesor._id, + "id": vm.profesor.Cedula, + "name": vm.profesor.Nombre, + "lastname": vm.profesor.Apellido, + "email": vm.profesor.Correo, + "number": vm.profesor.Telefono, + }; + + $rootScope.botonOk = false; + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/professor/modal/update_professor_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + professors.update(professor, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarProfesor'; + $rootScope.mensaje = + "Profesor " + vm.profesor.Apellido + ", " + vm.profesor.Nombre + " actualizado"; + }, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarProfesor'; + $rootScope.mensaje = + "Error al modificar al profesor " + vm.profesor.Apellido + ", " + vm.profesor.Nombre; + }); + } + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + return vm; + }; + +})(); \ No newline at end of file diff --git a/app/js/professor/professor.module.js b/app/js/professor/professor.module.js new file mode 100644 index 0000000..ab1a73d --- /dev/null +++ b/app/js/professor/professor.module.js @@ -0,0 +1,75 @@ +(function(){ + 'use strict'; + + angular + .module("app.professor", ['ui.router', 'ui.bootstrap']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/listarProfesor'); + + $stateProvider + .state('listarProfesor', { + url: '/listarProfesor', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/professor/list_professor.html', + controller: 'listarProfesorCtrl', + controllerAs: 'vm' + } + } + }) + + .state('crearProfesor', { + url: '/crearProfesor', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/professor/create_professor.html', + controller: 'crearProfesorCtrl', + controllerAs: 'vm' + } + } + }) + + .state('actualizarProfesor', { + url: '/actualizarProfesor', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/professor/update_professor.html', + controller: 'actualizarProfesorCtrl', + controllerAs: 'vm' + } + } + }) + }; +})(); diff --git a/app/js/professor/professor.services.js b/app/js/professor/professor.services.js new file mode 100644 index 0000000..8e1b8c1 --- /dev/null +++ b/app/js/professor/professor.services.js @@ -0,0 +1,16 @@ +(function(){ + 'use strict'; + + angular + .module('app.professor') + .factory('professors', professors) + .value('profesorSeleccionado',{}); + + professors.$inject = ['$resource','$rootScope']; + function professors($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/professors/:id', null, + { + 'update': {method:'PUT'} + }); + }; +})(); \ No newline at end of file diff --git a/app/js/report/report.controllers.js b/app/js/report/report.controllers.js new file mode 100644 index 0000000..bdfaf3d --- /dev/null +++ b/app/js/report/report.controllers.js @@ -0,0 +1,105 @@ +(function(){ + 'use strict'; + + angular + .module('app.reports') + .controller('poblacionNacimientoCtrl', poblacionNacimientoCtrl) + .controller('poblacionActivaCtrl', poblacionActivaCtrl) + .controller('hombresEdadCtrl', hombresEdadCtrl) + .controller('mujeresEdadCtrl', mujeresEdadCtrl) + .controller('comidasDiaCtrl', comidasDiaCtrl) + .controller('nivelEducacionCtrl', nivelEducacionCtrl) + .controller('serviciosHogaresCtrl', serviciosHogaresCtrl) + .controller('ingresosAnualesCtrl', ingresosAnualesCtrl) + + poblacionNacimientoCtrl.$inject = ['$rootScope', 'ReportJson']; + function poblacionNacimientoCtrl($rootScope, ReportJson){ + + $rootScope.labelPoblacionNacimiento = ['Extranjeros', 'Residentes']; + ReportJson.get({id:$rootScope.elementId}, function(data) { + + $rootScope.dataPoblacionNacimiento = data.Data[0].dataPoblacionNacimiento; + + }); + }; + + poblacionActivaCtrl.$inject = ['$rootScope', 'ReportJson']; + function poblacionActivaCtrl($rootScope, ReportJson){ + + $rootScope.labelsPoblacionActiva = ['Hombres', 'Mujeres']; + $rootScope.seriesPoblacionActiva = ['Economicamente Pasivos', 'Economicamente Activos']; + $rootScope.dataPoblacionActiva = []; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataPoblacionActiva = data.Data[0].dataPoblacionActiva; + }); + }; + + hombresEdadCtrl.$inject = ['$rootScope', 'ReportJson']; + function hombresEdadCtrl($rootScope, ReportJson){ + $rootScope.labelsHombresEdad = ['0-6', '7-12','13-18', '19-25','26-44', '45-60','61-99', '80-84', '90+']; + $rootScope.seriesHombresEdad = ['Hombres por Generacion']; + $rootScope.dataHombresEdad = []; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataHombresEdad = data.Data[0].dataHombresEdad; + }); + }; + + mujeresEdadCtrl.$inject = ['$rootScope', 'ReportJson']; + function mujeresEdadCtrl($rootScope, ReportJson){ + $rootScope.labelsMujeresEdad = ['0-6', '7-12','13-18', '19-25','26-44', '45-60','61-99', '80-84', '90+']; + $rootScope.seriesMujeresEdad = ['Mujeres por Generacion']; + $rootScope.dataMujeresEdad = []; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataMujeresEdad = data.Data[0].dataMujeresEdad; + }); + }; + + comidasDiaCtrl.$inject = ['$rootScope', 'ReportJson']; + function comidasDiaCtrl($rootScope, ReportJson){ + $rootScope.labelsComidasDia = ['Desayuno', 'Almuerzo', 'Cena']; + $rootScope.dataComidasDia = []; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataComidasDia = [data.Data[0].dataComidasDia]; + }); + }; + + nivelEducacionCtrl.$inject = ['$rootScope', 'ReportJson']; + function nivelEducacionCtrl($rootScope, ReportJson){ + $rootScope.labelsNivelEducacion = ['Nivel de Educacion Superior', 'Nivel de Educacion Media']; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataNivelEducacion = data.Data[0].dataNivelEducacion; + }); + }; + + serviciosHogaresCtrl.$inject = ['$rootScope', 'ReportJson']; + function serviciosHogaresCtrl($rootScope, ReportJson){ + $rootScope.labelsServiciosHogares = ['Agua', 'Gas', 'Electricidad' , 'Linea Telefonica']; + $rootScope.dataServiciosHogares = []; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataServiciosHogares = [data.Data[0].dataServiciosHogares]; + }); + }; + + ingresosAnualesCtrl.$inject = ['$rootScope', 'ReportJson']; + function ingresosAnualesCtrl($rootScope, ReportJson){ + $rootScope.labelsIngresosAnuales = ['Menos de 10.000', 'De 11.000 a 20.000', 'De 21.000 a 35.000' , 'De 35.000 a 50.000']; + + ReportJson.get({id:$rootScope.elementId},function(data) { + + $rootScope.dataIngresosAnuales = data.Data[0].dataIngresosAnuales; + }); + }; + +})(); diff --git a/app/js/report/report.module.js b/app/js/report/report.module.js new file mode 100644 index 0000000..6864232 --- /dev/null +++ b/app/js/report/report.module.js @@ -0,0 +1,81 @@ +(function(){ + 'use strict'; + + angular + .module("app.reports", ['ui.router', 'ui.bootstrap', 'chart.js']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/reportes'); + + $stateProvider + + .state('poblacionNacimiento', { + url: '/reportes', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/reportes/reportes.html', + controller: 'poblacionNacimientoCtrl', + controllerAs: 'vm' + } + } + }) + .state('poblacionActiva', { + url: '/poblacionActivaCtrl', + templateUrl: 'partials/reportes/reportes.html', + controller: 'poblacionActivaCtrl', + controllerAs: 'vm' + }) + .state('hombresEdad', { + url: '/hombresEdad', + templateUrl: 'partials/reportes/reportes.html', + controller: 'hombresEdadCtrl', + controllerAs: 'vm' + }) + .state('mujeresEdad', { + url: '/mujeresEdad', + templateUrl: 'partials/reportes/reportes.html', + controller: 'mujeresEdadCtrl', + controllerAs: 'vm' + }) + .state('comidasDia', { + url: '/comidasDia', + templateUrl: 'partials/reportes/reportes.html', + controller: 'comidasDiaCtrl', + controllerAs: 'vm' + }) + .state('nivelEducacion', { + url: '/nivelEducacion', + templateUrl: 'partials/reportes/reportes.html', + controller: 'nivelEducacionCtrl', + controllerAs: 'vm' + }) + .state('serviciosHogares', { + url: '/serviciosHogares', + templateUrl: 'partials/reportes/reportes.html', + controller: 'serviciosHogaresCtrl', + controllerAs: 'vm' + }) + .state('ingresosAnuales', { + url: '/ingresosAnuales', + templateUrl: 'partials/reportes/reportes.html', + controller: 'ingresosAnualesCtrl', + controllerAs: 'vm' + }) + }; +})(); diff --git a/app/js/report/report.services.js b/app/js/report/report.services.js new file mode 100644 index 0000000..e483618 --- /dev/null +++ b/app/js/report/report.services.js @@ -0,0 +1,16 @@ +(function(){ + 'use strict'; + + angular + .module('app.reports') + .factory('ReportJson', ReportJson) + .value('id',{}) + + ReportJson.$inject = ['$resource','$rootScope']; + function ReportJson($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/api/reports/:id'); + //var json="data/data.json"; + //return $resource(json); + }; + +})(); \ No newline at end of file diff --git a/app/js/section/section.controllers.js b/app/js/section/section.controllers.js new file mode 100644 index 0000000..fd5714f --- /dev/null +++ b/app/js/section/section.controllers.js @@ -0,0 +1,298 @@ +(function(){ + 'use strict'; + + angular + .module('app.section') + .controller('listarMatriculaCtrl', listarMatriculaCtrl) + .controller('crearMatriculaCtrl', crearMatriculaCtrl) + .controller('actualizarMatriculaCtrl', actualizarMatriculaCtrl) + + listarMatriculaCtrl.$inject = [ '$scope', '$rootScope', '$location', 'sections', '$modal', 'matriculaSeleccionada']; + function listarMatriculaCtrl ( $scope, $rootScope, $location, sections, $modal, matriculaSeleccionada ){ + + var vm = this; + vm.lista = true; + $rootScope.actOk = false; + $rootScope.loading = true; + $rootScope.table = false; + + vm.submit = function() { + } + + var matriculaArray = []; + sections.query( + function(successResult){ + vm.matricula = successResult; + angular.forEach(vm.matricula, function (value){ + matriculaArray.push({ + Nombre:value.Nombre, + Codigo:value.Codigo, + Materia:value.Materia, + Semestre:value.Semestre, + Estudiantes: value.Estudiantes + }); + }); + $rootScope.loading = false; + $rootScope.table = true; + vm.listaMatricula = matriculaArray; + }, + function(data){ + console.log("Error al obtener los datos."); + + }); + + /**************************Eliminar Matricula**************************/ + /* En este proceso, primero se llama a un Modal el cual se cerciora que + el usuario se asegure de eliminar la matricula escogida, el usuario al + confirmar su decision llama automaticamente a la funcion que hara la + llamada a servicio que borrara la matricula de la base de datos. + */ + vm.eliminarMatriculaModal = function (index) { + + $rootScope.index = index; + $rootScope.botonOk = true; + $rootScope.otroBotonOk = false; + $rootScope.botonCancelar = true; + $rootScope.rsplice = false; + $rootScope.eliminarLoading = false; + $rootScope.mensaje = "¿Seguro que desea eliminar la matricula?"; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/matricula/modal/eliminar_matricula_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return ""; + } + } + }); + }; + + vm.eliminarMatricula= function (index) { + $rootScope.botonOk = false; + $rootScope.otroBotonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarMatricula'; + $rootScope.eliminarLoading = true; + var name = vm.matricula[index].Nombre; + + sections.delete({ id: vm.matricula[index]._id }, + function (successResult) { + $rootScope.eliminarLoading = false; + $rootScope.rsplice = true; + $rootScope.mensaje = "Sección " + name + " eliminada."; + }, + function (errorResult) { + $rootScope.eliminarLoading = false; + $rootScope.mensaje = "Error al eliminar la sección " + name; + console.log('Could not delete from server'); + }); + }; + + vm.eliminarMatriculaSplice = function (index, rsplice) { + if(rsplice){ + vm.listaMatricula.splice(index, 1); + $rootScope.rsplice = false; + } + }; + + /*************************Fin de Eliminar Matricula********************/ + + + vm.modificarMatricula = function (index) { + matriculaSeleccionada.Nombre = vm.matricula[index].Nombre; + matriculaSeleccionada.Codigo = vm.matricula[index].Codigo; + matriculaSeleccionada.Materia = vm.matricula[index].Materia; + matriculaSeleccionada.Semestre = vm.matricula[index].Semestre; + matriculaSeleccionada.Estudiantes= vm.matricula[index].Estudiantes; + $location.url('actualizarMatricula'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + return vm; + }; + + crearMatriculaCtrl.$inject = + ['$scope','$rootScope', '$location', 'sections', '$modal', 'courses']; + function crearMatriculaCtrl($scope, $rootScope, $location, sections, $modal, courses){ + + var vm = this; + vm.submitted = false; + $rootScope.mensaje = ""; + + courses.query( + function (successResult) { + vm.materias = successResult; + }, + function () { + vm.materias = null; + }); + + vm.submit = function() { + + if (vm.data_input_form.$valid){ + vm.section = { + + "section": vm.matricula.Nombre, + "code": vm.valorMateria.Codigo, + "course": vm.valorMateria.Nombre, + "semester": vm.matricula.Semestre, + "students": vm.matricula.Estudiantes, + }; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/matricula/modal/crear_matricula_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + sections.save(vm.section, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarMatricula'; + $rootScope.mensaje = "Sección " + vm.matricula.Nombre + " creada"; + }, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarMatricula'; + $rootScope.mensaje = "Error creando la seccion " + vm.matricula.Nombre; + }); + }else{ + vm.submitted = true; + } + }; + + vm.cargarEstudiantes = function () { + + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + return vm; + }; + + actualizarMatriculaCtrl.$inject = ['$scope', '$rootScope', '$location', 'sections', '$modal', 'matriculaSeleccionada']; + function actualizarMatriculaCtrl($scope, $rootScope, $location, sections, $modal, matriculaSeleccionada){ + + var vm = this; + vm.lista = true; + $rootScope.loading = true; + $rootScope.table = false; + vm.matricula = matriculaSeleccionada; + vm.listaEstudiantes = vm.matricula.Estudiantes; + + + vm.actualizarMatricula = function() { + sections.update(section, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarMatricula'; + $rootScope.mensaje = "Sección actualizada"; + }, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarMatricula'; + $rootScope.mensaje = "Error al actualizar la Sección "; + }); + } + + vm.retirarEstudianteModal = function (index) { + $rootScope.index = index; + + $rootScope.botonOk = true; + $rootScope.otroBotonOk = false; + $rootScope.botonCancelar = true; + + $rootScope.rsplice = false; + $rootScope.eliminarLoading = false; + $rootScope.mensaje = "¿Desea retirar este estudiante de la Sección?"; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/matricula/modal/actualizar_matricula_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return ""; + } + } + }); + }; + + vm.retirarEstudiante = function (index) { + $rootScope.botonOk = false; + $rootScope.otroBotonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'actualizarMatricula'; + }; + + vm.retirarEstudianteSplice = function(index, rsplice) { + if(rsplice){ + vm.listaEstudiantes.splice(index, 1); + $rootScope.rsplice = false; + + var section = { + 'section': vm.matricula.Nombre, + 'code': vm.matricula.Codigo, + 'course': vm.matricula.Seccion, + 'semester': vm.matricula.Semestre, + 'students': vm.listaEstudiantes + }; + } + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + return vm; + }; + +})(); \ No newline at end of file diff --git a/app/js/section/section.module.js b/app/js/section/section.module.js new file mode 100644 index 0000000..93c6231 --- /dev/null +++ b/app/js/section/section.module.js @@ -0,0 +1,79 @@ +(function(){ + + 'use strict'; + + angular + .module("app.section", ['ui.router', 'ui.bootstrap']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/listarMatricula'); + + $stateProvider + + .state('listarMatricula', { + url: '/listarMatricula', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/section/list_section.html', + controller: 'listarMatriculaCtrl', + controllerAs: 'vm' + } + } + }) + + .state('crearMatricula', { + url: '/crearMatricula', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/section/create_section.html', + controller: 'crearMatriculaCtrl', + controllerAs: 'vm' + } + } + }) + + .state('actualizarMatricula', { + url: '/actualizarMatricula', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/section/update_section.html', + controller: 'actualizarMatriculaCtrl', + controllerAs: 'vm' + } + } + }) + + + }; +})(); + diff --git a/app/js/section/section.services.js b/app/js/section/section.services.js new file mode 100644 index 0000000..34cd5cc --- /dev/null +++ b/app/js/section/section.services.js @@ -0,0 +1,23 @@ +(function(){ + 'use strict'; + + angular + .module('app.section') + .factory('sections', sections) + .factory('courses', courses) + .value('matriculaSeleccionada',{}); + + sections.$inject = ['$resource','$rootScope']; + function sections($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/sections/:id', null, + { + 'update': {method:'PUT'} + }); + }; + + courses.$inject = ['$resource','$rootScope']; + function courses($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/courses'); + }; + +})(); \ No newline at end of file diff --git a/app/js/sidebar/sidebar.controllers.js b/app/js/sidebar/sidebar.controllers.js new file mode 100644 index 0000000..657e7f7 --- /dev/null +++ b/app/js/sidebar/sidebar.controllers.js @@ -0,0 +1,97 @@ +(function(){ + 'use strict'; + + angular + .module('app') + .controller('sidebarCtrl', ['$scope', + function($scope) { + + var that = this; + $scope.showChilds = function(item){ + item.active = !item.active;}; + + $scope.items = [ + { + + text: 'Modulo de Administración', + subItems: [ + { + state: 'listarProfesor', + text: 'Listar Profesores' + }, + { + state: 'crearProfesor', + text: 'Agregar Profesores' + } + ] + }, + { + + text: 'Modulo de Materias', + subItems: [ + { + state: 'listarMateria', + text: 'Listar Materias' + }, + { + state: 'crearMateria', + text: 'Agregar Materia' + } + ] + }, + { + + text: 'Modulo de Estudiantes', + subItems: [ + { + state: 'listarEstudiante', + text: 'Listar Estudiantes' + }, + { + state: 'crearEstudiante', + text: 'Agregar Estudiantes' + } + ] + }, + { + + text: 'Modulo de Matriculas', + subItems: [ + { + state: 'listarMatricula', + text: 'Listar Matricula' + }, + { + state: 'crearMatricula', + text: 'Crear Matricula' + } + ] + }, + { + + text: 'Modulo de Reportes', + subItems: [ + { + state: 'reportesAlumno', + text: 'Reportes por Alumno' + }, + { + state: 'reportesClase', + text: 'Reportes por Clase' + }, + { + state: 'reportesSeccion', + text: 'Reportes por Seccion' + }, + { + state: 'reportesMateria', + text: 'Reportes por Materia' + } + ] + } + ]; + + + }]) + +})(); diff --git a/app/js/student/student.controllers.js b/app/js/student/student.controllers.js new file mode 100644 index 0000000..49d3d70 --- /dev/null +++ b/app/js/student/student.controllers.js @@ -0,0 +1,258 @@ +(function(){ + 'use strict'; + + angular + .module('app.student') + .controller('listarEstudianteCtrl', listarEstudianteCtrl) + .controller('crearEstudianteCtrl', crearEstudianteCtrl) + .controller('actualizarEstudianteCtrl', actualizarEstudianteCtrl) + + listarEstudianteCtrl.$inject = [ '$scope', '$rootScope', '$location', 'students', '$modal', 'estudianteSeleccionado' ]; + function listarEstudianteCtrl( $scope, $rootScope, $location, students, $modal, estudianteSeleccionado ){ + + var vm = this; + vm.lista = true; + $rootScope.actOk = false; + $rootScope.loading = true; + $rootScope.table = false; + + var estudiantesArray = []; + students.query( + function(data){ + vm.estudiantes = data; + angular.forEach(vm.estudiantes, function (value){ + estudiantesArray.push({ + Cedula:value.id, + Nombre:value.name, + Apellido:value.lastname, + Telefono:value.number, + Correo: value.email + }); + }); + $rootScope.loading = false; + $rootScope.table = true; + vm.listaEstudiantes = estudiantesArray; + + }, + function(){ + console.log("Error al obtener los datos."); + }); + + vm.eliminarEstudianteModal = function (index) { + $rootScope.index = index; + $rootScope.botonOK = true; + $rootScope.botonCancelar = true; + $rootScope.acceptButton = false; + + $rootScope.rsplice = false; + $rootScope.listarEstudiantesLoading = true; + $rootScope.mensaje = "¿Seguro que desea eliminar el Estudiante?"; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/students/modal/list_students_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return ""; + } + } + }); + }; + + vm.eliminarEstudiante = function (index) { + + $rootScope.botonOK = false; + $rootScope.acceptButton = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarEstudiante'; + $rootScope.listarEstudiantesLoading = true; + + students.delete({id: vm.estudiantes[index]._id}, + function (successResult) { + $rootScope.listarEstudiantesLoading = false; + $rootScope.rsplice = true; + $rootScope.mensaje = "Usuario " + vm.estudiantes[index].name + " eliminado"; + }, + function (errorResult) { + $rootScope.listarEstudiantesLoading = false; + $rootScope.mensaje = "Error eliminando al Usuario " + vm.estudiantes[index].name; + }); + }; + + vm.removeEstudianteSplice = function(index, rsplice) { + if(rsplice){ + vm.listaEstudiantes.splice(index, 1); + $rootScope.rsplice = false; + } + }; + + vm.modificarEstudiante = function (index) { + estudianteSeleccionado._id = vm.estudiantes[index]._id; + estudianteSeleccionado.Cedula = vm.estudiantes[index].id; + estudianteSeleccionado.Nombre = vm.estudiantes[index].name; + estudianteSeleccionado.Apellido= vm.estudiantes[index].lastname; + estudianteSeleccionado.Telefono = vm.estudiantes[index].number; + estudianteSeleccionado.Correo= vm.estudiantes[index].email; + $location.url('actualizarEstudiante'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + $rootScope.opened = true; + }; + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + return vm; + }; + + crearEstudianteCtrl.$inject = ['$scope','$rootScope', '$location', 'students', '$modal']; + function crearEstudianteCtrl($scope, $rootScope, $location, students, $modal){ + + var vm = this; + $rootScope.mensaje = ""; + $rootScope.actOk = false; + + vm.submit = function() { + + if (vm.data_input_form.$valid){ + var person = { + "id": vm.estudiante.Cedula, + "name": vm.estudiante.Nombre, + "lastname": vm.estudiante.Apellido, + "email": vm.estudiante.Correo, + "number": vm.estudiante.Telefono, + }; + + $rootScope.crearEstudianteLoading = true; + $rootScope.botonOk = false; + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/students/modal/create_students_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + students.save(person, + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarEstudiante'; + $rootScope.mensaje = "Estudiante " + vm.estudiante.Apellido + ", " + vm.estudiante.Nombre + " agregado"; + $rootScope.crearEstudianteLoading = false; + }, + + function(){ + $rootScope.botonOk = true; + $rootScope.urlLo = 'listarEstudiante'; + $rootScope.mensaje = "Error al agregar al estudiante " + vm.estudiante.Apellido + ", " + vm.estudiante.Nombre; + $rootScope.crearEstudianteLoading = false; + }); + }else{ + + vm.submitted = true; + } + } + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + return vm; + }; + + actualizarEstudianteCtrl.$inject = [ '$scope','$rootScope', '$location', 'students', '$modal', 'estudianteSeleccionado' ]; + function actualizarEstudianteCtrl ( $scope, $rootScope, $location, students, $modal, estudianteSeleccionado ){ + + var vm = this; + vm.estudiante = estudianteSeleccionado; + $rootScope.mensaje = ""; + $rootScope.actOk = false; + + vm.submit = function() { + + var student = { + "_id": vm.estudiante._id, + "id": vm.estudiante.Cedula, + "name": vm.estudiante.Nombre, + "lastname": vm.estudiante.Apellido, + "email": vm.estudiante.Correo, + "number": vm.estudiante.Telefono, + }; + + $rootScope.botonOk = false; + $rootScope.modificarEstudianteLoading = true; + + $scope.modalInstance = $modal.open({ + animation: $rootScope.animationsEnabled, + templateUrl: 'partials/students/modal/update_students_modal.html', + scope: $scope, + size: 'sm', + resolve: { + items: function () { + return $rootScope.items; + } + } + }); + + students.update(student, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarEstudiante'; + $rootScope.mensaje = "Estudiante " + vm.estudiante.Apellido + ", " + vm.estudiante.Nombre + " actualizado"; + }, + function(){ + $rootScope.botonOk = true; + $rootScope.botonCancelar = false; + $rootScope.urlLo = 'listarEstudiante'; + $rootScope.mensaje = "Error al modificar al estudiante " + vm.estudiante.Apellido + ", " + vm.estudiante.Nombre; + }); + } + + $scope.ok = function (urlLo) { + $location.url(urlLo); + $scope.modalInstance.dismiss('cancel'); + }; + + $scope.cancel = function () { + $scope.modalInstance.dismiss('cancel'); + }; + + $rootScope.open = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + $rootScope.opened = true; + }; + + return vm; + }; + +})(); \ No newline at end of file diff --git a/app/js/student/student.module.js b/app/js/student/student.module.js new file mode 100644 index 0000000..13f4f13 --- /dev/null +++ b/app/js/student/student.module.js @@ -0,0 +1,75 @@ +(function(){ + 'use strict'; + + angular + .module("app.student", ['ui.router', 'ui.bootstrap']) + .run(addStateToScope) + .config(getRoutes); + + addStateToScope.$inject = ['$rootScope', '$state', '$stateParams']; + function addStateToScope($rootScope, $state, $stateParams){ + $rootScope.$state = $state; + $rootScope.$stateParams = $stateParams; + }; + + getRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; + function getRoutes($stateProvider, $urlRouterProvider){ + $urlRouterProvider.otherwise('/listarEstudiante'); + + $stateProvider + .state('listarEstudiante', { + url: '/listarEstudiante', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/students/list_students.html', + controller: 'listarEstudianteCtrl', + controllerAs: 'vm' + } + } + }) + + .state('crearEstudiante', { + url: '/crearEstudiante', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/students/create_students.html', + controller: 'crearEstudianteCtrl', + controllerAs: 'vm' + } + } + }) + + .state('actualizarEstudiante', { + url: '/actualizarEstudiante', + views: { + sidebar: { + templateUrl: 'partials/sidebar.html', + controller: 'sidebarCtrl' + }, + navbar: { + templateUrl: 'partials/navbar.html' + }, + content: { + templateUrl: 'partials/students/update_students.html', + controller: 'actualizarEstudianteCtrl', + controllerAs: 'vm' + } + } + }) + }; +})(); diff --git a/app/js/student/student.services.js b/app/js/student/student.services.js new file mode 100644 index 0000000..7e42390 --- /dev/null +++ b/app/js/student/student.services.js @@ -0,0 +1,16 @@ +(function(){ + 'use strict'; + + angular + .module('app.student') + .factory('students', students) + .value('estudianteSeleccionado',{}); + + students.$inject = ['$resource','$rootScope']; + function students($resource, $rootScope){ + return $resource('http://'+$rootScope.domainUrl+'/students/:id', null, + { + 'update': {method:'PUT'} + }); + }; +})(); \ No newline at end of file diff --git a/app/login.html b/app/login.html new file mode 100644 index 0000000..5e11b4e --- /dev/null +++ b/app/login.html @@ -0,0 +1,65 @@ +
+
+
+

Ingrese sus Datos

+
+
+
+
+ + +
+ + {{'TAG_NICK_NAME_ERROR'}} + +
+
+
+


+
+
+
+
+ + +
{{ vm.password = vm.user.Password }}
+
+ + {{'TAG_PASSWORD_ERROR'}} + +
+
{{getHash(vm.password)}}
+
+
+
+
+ +
+
+
+ +

+ + + +

+ +
+
+
+ +
+ diff --git a/app/partials/course/create_course.html b/app/partials/course/create_course.html new file mode 100644 index 0000000..e911a47 --- /dev/null +++ b/app/partials/course/create_course.html @@ -0,0 +1,82 @@ +
+
+
+

Datos de la Materia

+
+
+
+
+ + +
+ + El Código de la Materia es Obligatorio. + +
+
+
+ + +
+ + El Nombre de la Materia es Obligatorio. + +
+
+
+

+
+
+
+ + +
+ + La Cantidad de Creditos es Obligatoria. + +
+
+
+ + +
+ + Por favor, inserte una breve descripción. + +
+
+
+


+
+
+
+
+
+ +

+ + + +

+
+
+
+
+
\ No newline at end of file diff --git a/app/partials/course/list_course.html b/app/partials/course/list_course.html new file mode 100644 index 0000000..2a179e6 --- /dev/null +++ b/app/partials/course/list_course.html @@ -0,0 +1,70 @@ +
+

Lista de Materias

+


+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + Código + + + + + + Nombre + + + + + + Creditos + + + + + + Descripción + + + Eliminar +
{{ materia.Codigo }}{{ materia.Nombre }}{{ materia.Creditos }}{{ materia.Descripcion }} + +
+
+
{{ vm.eliminarMateriaSplice(index, rsplice) }}
+
\ No newline at end of file diff --git a/app/partials/course/modal/create_course_modal.html b/app/partials/course/modal/create_course_modal.html new file mode 100644 index 0000000..3ccc3c9 --- /dev/null +++ b/app/partials/course/modal/create_course_modal.html @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/partials/course/modal/delete_course_modal.html b/app/partials/course/modal/delete_course_modal.html new file mode 100644 index 0000000..2737cc8 --- /dev/null +++ b/app/partials/course/modal/delete_course_modal.html @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/app/partials/course/modal/upgrade_course_modal.html b/app/partials/course/modal/upgrade_course_modal.html new file mode 100644 index 0000000..4c0b027 --- /dev/null +++ b/app/partials/course/modal/upgrade_course_modal.html @@ -0,0 +1,12 @@ + + + \ No newline at end of file diff --git a/app/partials/course/update_course.html b/app/partials/course/update_course.html new file mode 100644 index 0000000..1e2011c --- /dev/null +++ b/app/partials/course/update_course.html @@ -0,0 +1,72 @@ +
+
+
+

Datos de la Materia

+
+
+
+
+ + +
+
+ + +
+ + El Nombre de la Materia es Obligatorio. + +
+
+
+


+
+
+ + +
+ + La Cantidad de Creditos es Obligatoria. + +
+
+
+ + +
+ + El Semestre es Obligatorio. + +
+
+
+


+
+
+
+
+
+ +

+ + + +

+
+
+
+
+
\ No newline at end of file diff --git a/app/partials/navbar.html b/app/partials/navbar.html new file mode 100644 index 0000000..63db001 --- /dev/null +++ b/app/partials/navbar.html @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/app/partials/professor/create_professor.html b/app/partials/professor/create_professor.html new file mode 100644 index 0000000..9cac0e3 --- /dev/null +++ b/app/partials/professor/create_professor.html @@ -0,0 +1,95 @@ +
+
+
+

Datos del Profesor

+
+
+
+
+ + +
+ + El Número de Cédula del Profesor es Obligatorio. + +
+
+
+ + +
+ + El Nombre del Profesor es Obligatorio. + +
+
+
+ + +
+ + El Apellido del Profesor es obligatorio. + +
+
+
+


+
+
+ + +
+ + El Correo del Profesor es obligatorio. + + + El Formato del Correo del Profesor es incorrecto. + +
+
+
+ + + + El Formato del Número de Teléfono es incorrecto. + +
+
+
+
+
+
+
+ +

+ + + +

+
+
+
+
+
+ diff --git a/app/partials/professor/list_professor.html b/app/partials/professor/list_professor.html new file mode 100644 index 0000000..da24bb2 --- /dev/null +++ b/app/partials/professor/list_professor.html @@ -0,0 +1,53 @@ +
+

Listado de Profesores

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + Cedula + + + + + + Nombre + + + + + + Apellido + + + + + Modificar + + Borrar +
{{ profesor.Cedula }}{{ profesor.Nombre }}{{ profesor.Apellido }} + + + +
+
+
{{ vm.removeProfesorSplice(index, rsplice) }}
+
diff --git a/app/partials/professor/modal/create_professor_modal.html b/app/partials/professor/modal/create_professor_modal.html new file mode 100644 index 0000000..ae039ab --- /dev/null +++ b/app/partials/professor/modal/create_professor_modal.html @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/app/partials/professor/modal/list_professor_modal.html b/app/partials/professor/modal/list_professor_modal.html new file mode 100644 index 0000000..4036b7f --- /dev/null +++ b/app/partials/professor/modal/list_professor_modal.html @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/app/partials/professor/modal/update_professor_modal.html b/app/partials/professor/modal/update_professor_modal.html new file mode 100644 index 0000000..f863686 --- /dev/null +++ b/app/partials/professor/modal/update_professor_modal.html @@ -0,0 +1,12 @@ + + + \ No newline at end of file diff --git a/app/partials/professor/update_professor.html b/app/partials/professor/update_professor.html new file mode 100644 index 0000000..4a01eb2 --- /dev/null +++ b/app/partials/professor/update_professor.html @@ -0,0 +1,62 @@ +
+
+
+
+
+
+
+

Modificar Profesor


+
+
+
+ + +
+
+ + +
+
+ + +
+
+


+
+
+
+ + + + El formato del Correo del Profesor es incorrecto. + +
+
+ + + + El formato del Teléfono debe ser: 0212-789-5551. + +
+
+
+
+
+
+
+ +

+ + + +

+
+
+
+
\ No newline at end of file diff --git a/app/partials/report/report.html b/app/partials/report/report.html new file mode 100644 index 0000000..638a1f3 --- /dev/null +++ b/app/partials/report/report.html @@ -0,0 +1,116 @@ +
+ +
+
+
+
Reporte Alumno +
+
+
+ + +
    +
  • {{'TAG_FOREIGN' }}
  • +
  • {{'TAG_RESIDENT' }}
  • +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
Reporte por Clase +
+
+
+ + +
    +
  • {{'TAG_ECONOMIC_PASSIVE' }}
  • +
  • {{'TAG_ECONOMIC_ACTIVE' }}
  • +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
Reporte por Sección +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
Reporte por Materia +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + + + + diff --git a/app/partials/section/create_section.html b/app/partials/section/create_section.html new file mode 100644 index 0000000..117f2ed --- /dev/null +++ b/app/partials/section/create_section.html @@ -0,0 +1,80 @@ +
+
+
+

Nueva Matricula

+
+
+
+
+ + +
+
+ + +
+
+ + +
+ + El Semestre es obligatorio. + +
+
+
+


+
+
+ + +
+ + La sección es obligatoria. + +
+
+

+ + + +
+

+
+
+
+
+
+
+
+ +

+ + + +

+
+
+
+
+
\ No newline at end of file diff --git a/app/partials/section/list_section.html b/app/partials/section/list_section.html new file mode 100644 index 0000000..88a12ae --- /dev/null +++ b/app/partials/section/list_section.html @@ -0,0 +1,69 @@ +
+

Listado de Secciones


+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + Sección + + + + + + Nombre de la Materia + + + + + + Codigo de la Materia + + + + + + Semestre + + + + + Modificar + + Borrar +
{{ matricula.Nombre }}{{ matricula.Materia }}{{ matricula.Codigo }}{{ matricula.Semestre }} + + + +
+
+
{{ vm.eliminarMatriculaSplice(index, rsplice) }}
+
\ No newline at end of file diff --git a/app/partials/section/modal/create_section_modal.html b/app/partials/section/modal/create_section_modal.html new file mode 100644 index 0000000..8d22a91 --- /dev/null +++ b/app/partials/section/modal/create_section_modal.html @@ -0,0 +1,12 @@ + + + \ No newline at end of file diff --git a/app/partials/section/modal/delete_section_modal.html b/app/partials/section/modal/delete_section_modal.html new file mode 100644 index 0000000..c6ad3d2 --- /dev/null +++ b/app/partials/section/modal/delete_section_modal.html @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/app/partials/section/modal/update_section_modal.html b/app/partials/section/modal/update_section_modal.html new file mode 100644 index 0000000..1fd33a3 --- /dev/null +++ b/app/partials/section/modal/update_section_modal.html @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/app/partials/section/update_section.html b/app/partials/section/update_section.html new file mode 100644 index 0000000..b5bfa36 --- /dev/null +++ b/app/partials/section/update_section.html @@ -0,0 +1,54 @@ +
+

Estudiantes Inscritos en {{ vm.matricula.Nombre }} - Seccion {{ vm.matricula.Seccion }} - Semestre {{ vm.matricula.Semestre }}

+
+
+ + + + + + + + + + + + + + + + + +
+ + Cedula + + + + + + Nombre + + + + + + Apellido + + + + + Retirar +
{{ estudiante.Cedula }}{{ estudiante.Nombre }}{{ estudiante.Apellido }} + +
+
+ +
{{ vm.retirarEstudianteSplice(index, rsplice) }}
+
+ Regresar +
+
\ No newline at end of file diff --git a/app/partials/sidebar.html b/app/partials/sidebar.html new file mode 100644 index 0000000..d5f3d53 --- /dev/null +++ b/app/partials/sidebar.html @@ -0,0 +1,21 @@ + + diff --git a/app/partials/students/create_students.html b/app/partials/students/create_students.html new file mode 100644 index 0000000..010574e --- /dev/null +++ b/app/partials/students/create_students.html @@ -0,0 +1,93 @@ +
+
+
+

Datos del Nuevo Alumno

+
+
+
+
+ + +
+ + El Numero de Cedula del Alumno es obligatorio. + +
+
+
+ + +
+ + El Nombre del Alumno es obligatorio. + +
+
+
+ + +
+ + El Apellido del Alumno es obligatorio. + +
+
+
+
+

+
+
+ + +
+ + El Correo del Alumno es obligatorio. + + + El formato del Correo del Alumno es incorrecto. + +
+
+
+ + + + El Formato del Numero de Telefono es incorrecto. + +
+
+
+
+
+
+
+ +

+ + + +

+
+
+
+
+
\ No newline at end of file diff --git a/app/partials/students/list_students.html b/app/partials/students/list_students.html new file mode 100644 index 0000000..765430e --- /dev/null +++ b/app/partials/students/list_students.html @@ -0,0 +1,67 @@ +
+

Listado de Estudiantes

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + Cedula + + + + + + Nombre + + + + + + Apellido + + + + + Modificar + + Borrar +
{{ estudiante.Cedula }}{{ estudiante.Nombre }}{{ estudiante.Apellido }} + + + +
+
+
{{vm.removeEstudianteSplice(index, rsplice)}}
+
\ No newline at end of file diff --git a/app/partials/students/modal/create_students_modal.html b/app/partials/students/modal/create_students_modal.html new file mode 100644 index 0000000..a441654 --- /dev/null +++ b/app/partials/students/modal/create_students_modal.html @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/partials/students/modal/list_students_modal.html b/app/partials/students/modal/list_students_modal.html new file mode 100644 index 0000000..8893447 --- /dev/null +++ b/app/partials/students/modal/list_students_modal.html @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/app/partials/students/modal/update_students_modal.html b/app/partials/students/modal/update_students_modal.html new file mode 100644 index 0000000..716f17d --- /dev/null +++ b/app/partials/students/modal/update_students_modal.html @@ -0,0 +1,12 @@ + + + \ No newline at end of file diff --git a/app/partials/students/update_students.html b/app/partials/students/update_students.html new file mode 100644 index 0000000..67947f8 --- /dev/null +++ b/app/partials/students/update_students.html @@ -0,0 +1,69 @@ +
+
+
+
+
+
+

Modificar Estudiante

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+


+
+
+
+ + + + El formato del Correo del Alumno es incorrecto. + +
+
+ + + + El formato del Teléfono debe ser: 0212-789-5551. + +
+
+
+
+
+
+
+ +

+ + + +

+
+
+
+
\ No newline at end of file diff --git a/app/server.js b/app/server.js new file mode 100644 index 0000000..35ac606 --- /dev/null +++ b/app/server.js @@ -0,0 +1,188 @@ +var express = require('express'); +var app = express(); +var mongojs = require('mongojs'); +var db = mongojs('AttendanceDB', + ['Courses', 'Professors', 'Sections', 'Students']); +var bodyParser = require('body-parser'); + +app.use(express.static(__dirname)); +app.use(bodyParser.json()); + +app.get('/students', function(req, res){ + console.log('Received get all request'); + db.Students.find(function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/students/:id', function(req, res){ + console.log('Received get request'); + db.Students.findOne( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.post('/students', function(req, res){ + console.log('Received add request'); + console.log(req.body); + db.Students.insert(req.body, function(docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.delete('/students/:id', function(req, res){ + console.log("Received delete request..."); + db.Students.remove( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }); +}); + +app.put('/students', function(req, res){ + console.log("Received update request"); + console.log(req.body); + db.Students.findAndModify({query: + {"_id": new mongojs.ObjectId(req.body._id)}, + update: {$set: {email: req.body.email, number: req.body.number}} + }, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/courses', function(req, res){ + console.log('Received get all request'); + db.Courses.find(function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/courses/:id', function(req, res){ + console.log('Received get request'); + db.Courses.findOne( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.post('/courses', function(req, res){ + console.log('Received add request'); + console.log(req.body); + db.Courses.insert(req.body, function(docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.delete('courses/:id', function(req, res){ + console.log("Received delete request..."); + db.Courses.remove( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }); +}); + +app.get('/sections', function(req, res){ + console.log('Received get all request'); + db.Sections.find(function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/sections/:id', function(req, res){ + console.log('Received get request'); + db.Sections.findOne( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.post('/sections', function(req, res){ + console.log('Received add request'); + console.log(req.body); + db.Sections.insert(req.body, function(docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.delete('/sections/:id', function(req, res){ + console.log("Received delete request..."); + db.Sections.remove( + {_id: new mongojs.ObjectId(req.params.id)}, function(err, docs){ + console.log(docs); + res.json(docs); + }); +}); + +app.put('/sections', function(req, res){ + console.log("Received update request"); + console.log(req.body); + db.Sections.findAndModify({query: + {"_id": new mongojs.ObjectId(req.body._id)}, + update: {$set: {students: req.body.students}} + }, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/professors', function(req, res){ + console.log('Received get all request'); + db.Professors.find(function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.get('/professors/:id', function(req, res){ + console.log('Received get request'); + db.Professors.findOne({_id: new mongojs.ObjectId(req.params.id)}, + function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.post('/professors', function(req, res){ + console.log('Received add request'); + console.log(req.body); + db.Professors.insert(req.body, function(docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.delete('/professors/:id', function(req, res){ + console.log("Received delete request..."); + db.Professors.remove({_id: new mongojs.ObjectId(req.params.id)}, + function(err, docs){ + console.log(docs); + res.json(docs); + }); +}); + +app.put('/professors', function(req, res){ + console.log("Received update request"); + console.log(req.body); + db.Professors.findAndModify({query: + {"_id": new mongojs.ObjectId(req.body._id)}, + update: {$set: {email: req.body.email, number: req.body.number}} + }, function(err, docs){ + console.log(docs); + res.json(docs); + }) +}); + +app.listen(3000); +console.log("server running on port 3000"); \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..04e9706 --- /dev/null +++ b/bower.json @@ -0,0 +1,44 @@ +{ + "name": "M.A.S.A App", + "description": "M.A.S.A Project", + "version": "1.0.0", + "homepage": "https://github.com/angular/angular-seed", + "license": "MIT", + "private": true, + "dependencies": { + "angular": "~1.4.0", + "angular-resource": "~1.4.0", + "angular-ui-router": "~0.2.15", + "angular-messages": "~1.4.0", + "ngstorage": "~0.3.4", + "angular-route": "1.4.0", + "angular-loader": "1.3.x", + "angular-mocks": "~1.3.x", + "html5-boilerplate": "~4.3.0", + "angular-bootstrap": "~0.13.0", + "bootstrap": "3.x", + "ui.bootstrap": "~0.13.0", + "angular-base64": "*", + "angular-locale_es-es": "*", + "crypto-js": "*", + "angular-animate": "*", + "font-awesome": "*", + "angular-drag-and-drop-lists": "*", + "jspdf": "*", + "ng-file-upload-shim": "*", + "ng-file-upload": "*", + "base64": "*", + "lodash": "*", + "angular-simple-logger": "*", + "angular-google-maps": "*", + "angular-translate": "^2.6.1", + "angular-translate-loader-static-files": "^2.6.1", + "angular-translate-storage-local": "^2.6.1", + "ng-scrollable": "~0.2.3", + "ng-scrollbar": "~0.0.8", + "angular-chart.js": "~0.8.8" + }, + "resolutions": { + "angular": "1.4.0" + } +} diff --git a/components/version/interpolate-filter.js b/components/version/interpolate-filter.js new file mode 100644 index 0000000..3d5c19c --- /dev/null +++ b/components/version/interpolate-filter.js @@ -0,0 +1,9 @@ +'use strict'; + +angular.module('sarcFront.version.interpolate-filter', []) + +.filter('interpolate', ['version', function(version) { + return function(text) { + return String(text).replace(/\%VERSION\%/mg, version); + }; +}]); diff --git a/components/version/interpolate-filter_test.js b/components/version/interpolate-filter_test.js new file mode 100644 index 0000000..c367814 --- /dev/null +++ b/components/version/interpolate-filter_test.js @@ -0,0 +1,15 @@ +'use strict'; + +describe('sarcFront.version module', function() { + beforeEach(module('sarcFront.version')); + + describe('interpolate filter', function() { + beforeEach(module(function($provide) { + $provide.value('version', 'TEST_VER'); + })); + + it('should replace VERSION', inject(function(interpolateFilter) { + expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); + })); + }); +}); diff --git a/components/version/version-directive.js b/components/version/version-directive.js new file mode 100644 index 0000000..34d98a2 --- /dev/null +++ b/components/version/version-directive.js @@ -0,0 +1,9 @@ +'use strict'; + +angular.module('sarcFront.version.version-directive', []) + +.directive('appVersion', ['version', function(version) { + return function(scope, elm, attrs) { + elm.text(version); + }; +}]); diff --git a/components/version/version-directive_test.js b/components/version/version-directive_test.js new file mode 100644 index 0000000..16d1450 --- /dev/null +++ b/components/version/version-directive_test.js @@ -0,0 +1,17 @@ +'use strict'; + +describe('sarcFront.version module', function() { + beforeEach(module('sarcFront.version')); + + describe('app-version directive', function() { + it('should print current version', function() { + module(function($provide) { + $provide.value('version', 'TEST_VER'); + }); + inject(function($compile, $rootScope) { + var element = $compile('')($rootScope); + expect(element.text()).toEqual('TEST_VER'); + }); + }); + }); +}); diff --git a/components/version/version.js b/components/version/version.js new file mode 100644 index 0000000..80f6039 --- /dev/null +++ b/components/version/version.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('sarcFront.version', [ + 'sarcFront.version.interpolate-filter', + 'sarcFront.version.version-directive' +]) + +.value('version', '0.1'); diff --git a/components/version/version_test.js b/components/version/version_test.js new file mode 100644 index 0000000..15aadb5 --- /dev/null +++ b/components/version/version_test.js @@ -0,0 +1,11 @@ +'use strict'; + +describe('sarcFront.version module', function() { + beforeEach(module('sarcFront.version')); + + describe('version service', function() { + it('should return current version', inject(function(version) { + expect(version).toEqual('0.1'); + })); + }); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..28d75f4 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "masa-front", + "version": "1.0.0", + "description": "Frontend for M.A.S.A. App.", + "main": "app/index.html", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@bitbucket.org:PosmaGroup/censys-front.git" + }, + "author": "Posma Group C.A.", + "license": "MIT", + "devDependencies": { + "karma": "^0.13.9" + }, + "dependencies": { + "express" : "latest", + "gulp":"latest" + } +}