Various fixes

This commit is contained in:
Reynaldo Reyes
2016-05-20 23:00:34 -04:00
parent b220f21065
commit 48e8b73111
55 changed files with 714 additions and 690 deletions

View File

@@ -15,43 +15,28 @@
getRoutes.$inject = ['$stateProvider', '$urlRouterProvider'];
function getRoutes($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise('/CourseList');
$stateProvider
.state('CourseList', {
parent: 'index',
url: '/CourseList',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'SidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
'content@': {
templateUrl: 'partials/course/course_list.html',
controller: 'CourseListCtrl',
controllerAs: "vm"
}
}
})
.state('CourseCreate', {
parent:'index',
url: '/CourseCreate',
views: {
sidebar: {
templateUrl: 'partials/sidebar/sidebar.html',
controller: 'SidebarCtrl'
},
navbar: {
templateUrl: 'partials/sidebar/navbar.html'
},
content: {
'content@': {
templateUrl: 'partials/course/course_create.html',
controller: 'CourseCreateCtrl',
controllerAs: "vm"
}
}
})
};
})();

View File

@@ -7,6 +7,13 @@
courses.$inject = ['$resource','$rootScope'];
function courses($resource, $rootScope){
return $resource('http://'+$rootScope.domainUrl+'/professors/:id/courses', null);
return $resource('http://'+$rootScope.domainUrl+'/professors/:id/courses', {}, {
get: {
method: 'GET',
headers: {
Authorization: 'Bearer '+ authentication.getToken()
}
}
});
};
})();
})();

View File

@@ -6,11 +6,12 @@
.controller('CourseCreateCtrl', CourseCreateCtrl)
CourseCreateCtrl.$inject =
['$scope', '$rootScope', '$modal', '$state', 'professors'];
function CourseCreateCtrl($scope, $rootScope, $modal, $state, professors) {
['$scope', '$modal', '$state', 'professors', 'authentication'];
function CourseCreateCtrl($scope, $modal, $state, professors, authentication) {
var vm = this;
$scope.mensaje = "";
var professorid = $rootScope.professorId;
var user = authentication.currentUser();
var professorid = user._id;
professors.get({ id: professorid },
function (successResult){

View File

@@ -6,10 +6,11 @@
.controller('CourseListCtrl',CourseListCtrl)
CourseListCtrl.$inject =
['$scope', '$rootScope', '$state', 'professors', '$modal', 'profesorSeleccionado', 'selectedCourse'];
function CourseListCtrl($scope, $rootScope, $state, professors, $modal, profesorSeleccionado, selectedCourse) {
['$scope', '$state', 'professors', '$modal', 'profesorSeleccionado', 'selectedCourse', 'authentication'];
function CourseListCtrl($scope, $state, professors, $modal, profesorSeleccionado, selectedCourse, authentication) {
var vm = this;
var professorid = $rootScope.professorId;
var user = authentication.currentUser();
var professorid = user._id;
professors.get({ id: professorid },
function (successResult){

View File

@@ -8,28 +8,15 @@
<tr>
<th width="10%">
Código
<span ng-show="sortType == 'code' &&
!sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'code' &&
sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="20%">
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="10%">
Creditos
<span ng-show="sortType == 'credits' &&
!sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'credits' && sortReverse" class="fa fa-caret-up"></span>
</th>
<th width="40%" style="text-align: center">
Descripción
Descripción
</th>
<th width="10%" style="text-align: center">
Secciones
@@ -47,7 +34,7 @@
<td style="vertical-align:middle">{{ course.description }}</td>
<td style="text-align: center">
<span
title="Click aqui para ver Secciones"
title="Haga click para listar las secciones de esta materia"
class="glyphicon glyphicon-list"
aria-hidden="true"
ng-click="vm.listarSecciones($index)"
@@ -55,7 +42,7 @@
</td>
<td style="text-align: center">
<span
title="Click aqui para Eliminar la Materia"
title="Haga click para eliminar esta materia"
class="glyphicon glyphicon-remove"
aria-hidden="true"
ng-click="vm.eliminarMateriaModal($index)"