Commit c7c72d54 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !87
parents 7dc70531 2318d91d
......@@ -2,6 +2,7 @@
'use strict';
angular.module('admin.lesson', [
'gettext',
'admin.lesson.controllers',
'admin.lesson.services',
'admin.lesson.directives',
......@@ -22,4 +23,15 @@
'ui.tinymce',
'shared',
]);
angular.module('admin.lesson').run(['gettextCatalog', 'UserLocalStorage', function (gettextCatalog, UserLocalStorage) {
let defaultLanguage = UserLocalStorage.get('currentLanguage') || 'en';
gettextCatalog.setCurrentLanguage(defaultLanguage);
UserLocalStorage.set('currentLanguage', defaultLanguage);
// UserLocalStorage.set('currentLanguage', 'es');
gettextCatalog.setStrings('es', {"(minimum width: 845px)":"(ancho mínimo: 845px)","Activity":"Actividad","Activity unit":"Unidad de actividad","Cancel":"Cancelar","Change thumbnail":"Cambiar thumbnail","Change video":"Cambiar video","Chat Room:":"Sala de chat:","Delete this unit":"Eliminar esta unidad","Insert":"Insertar","Select a thumbnail for this lesson":"Seleccione un thumbnail para esta lección","Select the language for this lesson":"Seleccione el idioma para esta lección","Step Notes":"Notas de los pasos","The text below will be shown to users when they complete the activity correctly":"El texto a continuación se mostrará a los usuarios cuando completen la actividad correctamente","Unit video":"Video de la unidad","Unit:":"Unidad:","Video":"Video"});
gettextCatalog.setStrings('pt_br', {"(minimum width: 845px)":"(largura mínima: 845px)","Activity":"Atividade","Activity unit":"Unidade de atividade","Cancel":"Cancelar","Change thumbnail":"Alterar thumbnail","Change video":"Mudar o vídeo","Chat Room:":"Sala de bate-papo:","Delete this unit":"Exclua esta unidade","Insert":"Inserir","Select a thumbnail for this lesson":"Selecione um thumbnail para esta lição","Select the language for this lesson":"Selecione o idioma para esta lição","Step Notes":"Notas de Etapa","The text below will be shown to users when they complete the activity correctly":"O texto abaixo será mostrado aos usuários quando eles concluírem a atividade corretamente","Unit video":"Vídeo da unidade","Unit:":"Unidade:","Video":"Vídeo"});
}]);
})(window.angular);
......@@ -5,6 +5,8 @@
app.controller('EditLessonController', [
'$scope',
'$location',
'SetLanguage',
'$window',
'Course',
'CourseProfessor',
'SimpleLesson',
......@@ -16,7 +18,7 @@
'waitingScreen',
'Forum',
'FormUpload',
function($scope, $location, Course, CourseProfessor, Lesson, LessonUpdate, Unit, VideoData, youtubePlayerApi,
function($scope, $location, SetLanguage, $window, Course, CourseProfessor, Lesson, LessonUpdate, Unit, VideoData, youtubePlayerApi,
MarkdownDirective, waitingScreen, Forum, FormUpload) {
$scope.errors = {};
var httpErrors = {
......@@ -24,6 +26,11 @@
'403': 'Você não tem permissão para ver conteúdo nesta página.',
'404': 'Este curso não existe!'
};
$scope.setLanguage = function(language) {
SetLanguage(language);
$window.location.reload();
$scope.language = language;
}
// load youtube
$scope.playerReady = false;
......
......@@ -3,6 +3,7 @@
angular.module('new-course', [
'new-course.directives',
'gettext',
'django',
'timtec-models',
'directive.alertPopup',
......@@ -17,4 +18,16 @@
'ui.bootstrap',
'shared',
]);
angular.module('new-course').run(['gettextCatalog', 'UserLocalStorage', function (gettextCatalog, UserLocalStorage) {
let defaultLanguage = UserLocalStorage.get('currentLanguage') || 'en';
gettextCatalog.setCurrentLanguage(defaultLanguage);
UserLocalStorage.set('currentLanguage', defaultLanguage);
// UserLocalStorage.set('currentLanguage', 'es');
gettextCatalog.setStrings('es', {"(minimum width: 845px)":"(ancho mínimo: 845px)","Cancel":"Cancelar","Change thumbnail":"Cambiar thumbnail","Change video":"Cambiar video","Choose language":"Seleccione el idioma ","Datasheet":"Ficha técnica","Delete":"Eliminar","Delete course":"Eliminar curso","Draft":"Sequía","Drag left or right. Minimum 50%.":"Arrastra hacia la izquierda o hacia la derecha. Mínimo 50%.","Export":"Exportar","Export course":"Curso de exportación","Home thumbnail":"thumbnail de inicio","Insert":"Insertar","Insert step":"Insertar paso","Introduction video":"Video de introducción","Presentation":"Presentation","Public":"Público","Save":"Salvar","Save course":"Guardar curso","Stages":"Etapas","Start date":"Fecha de inicio","Step name":"Nombre del paso","This course is":"Este curso es","Thumbnail":"Thumbnail","Units":"Unidades","Video":"Video","What content will we have here?":"¿Qué contenido tendremos aquí?","What do I need to know?":"¿Qué necesito saber?","What is the best option to present this course?":"¿Cuál es la mejor opción para presentar este curso?","Who is here?":"¿Quién está aquí?","delete step":"eliminar paso","edit step":"editar paso","{% verbatim %}{{ lesson.countActivities() }}{% endverbatim %} activities":"{% verbatim %}{{ lesson.countActivities() }}{% endverbatim %} actividades","videos":"videos"}
);
gettextCatalog.setStrings('pt_br', {"(minimum width: 845px)":"(largura mínima: 845px)","Cancel":"Cancelar","Change thumbnail":"Alterar thumbnail","Change video":"Mudar o vídeo","Choose language":"Escolha o idioma","Datasheet":"Ficha técnica","Delete":"Excluir","Delete course":"Excluir curso","Draft":"Rascunho","Drag left or right. Minimum 50%.":"Arraste para a esquerda ou direita. Mínimo 50%.","Export":"Exportar","Export course":"Curso de exportação","Home thumbnail":"thumbnail da home","Insert":"Inserir","Insert step":"Inserir etapa","Introduction video":"Vídeo de introdução","Presentation":"Apresentação","Public":"Público","Save":"Salvar","Save course":"Salvar curso","Stages":"Estágios","Start date":"Data de início","Step name":"Nome da etapa","This course is":"Este curso é","Thumbnail":"Thumbnail","Units":"Unidades:","Video":"Vídeo","What content will we have here?":"Que conteúdo teremos aqui?","What do I need to know?":"O que eu preciso saber?","What is the best option to present this course?":"Qual a melhor opção para apresentar este curso?","Who is here?":"Quem está aqui?","delete step":"excluir etapa","edit step":"editar etapa","{% verbatim %}{{ lesson.countActivities() }}{% endverbatim %} activities":"{% verbatim %}{{ lesson.countActivities() }}{% endverbatim %} atividades","videos":"videos"});
}]);
})(window.angular);
......@@ -338,6 +338,17 @@
return vd;
}]);
app.factory('SetLanguage', ['$http', function($http){
return function(language){
$http({
method:'POST',
url: API_URL + '/i18n/setlang/',
data: 'language=' + language,
headers:{'Content-Type':'application/x-www-form-urlencoded'}
});
};
}]);
app.factory('UserAccess', function($resource){
return $resource(API_URL + '/stats/user-access', {}, {'save': {'method': 'POST', 'ignoreLoadingBar': true}});
});
......
......@@ -2,6 +2,7 @@
'use strict';
angular.module('course-permissions', [
'gettext',
'course-permissions.controllers',
'course-permissions.services',
'ui.bootstrap',
......@@ -14,4 +15,16 @@
'directive.alertPopup',
'shared',
]);
angular.module('course-permissions').run(['gettextCatalog', 'UserLocalStorage', function (gettextCatalog, UserLocalStorage) {
let defaultLanguage = UserLocalStorage.get('currentLanguage') || 'en';
gettextCatalog.setCurrentLanguage(defaultLanguage);
UserLocalStorage.set('currentLanguage', defaultLanguage);
// UserLocalStorage.set('currentLanguage', 'es');
gettextCatalog.setStrings('es', {"Access Groups":"Grupos de acceso","Actions":"Acciones","Assistant Professor":"Profesor asistente","Cancel":"Cancelar","Close":"Cerrar","Coordinating Professor":"Profesor coordinador","Course Permissions":"Permisos del curso","Email":"Email","Full name":"Nombre completo","Insert User":"Insertar usuario","Insert Users":"Insertar usuarios","Office":"Oficina","Save":"Salvar","Save course":"Guardar curso","Saved successfully!":"¡Guardado exitosamente!","Search":"Buscar","Search for a User":"Buscar un usuario","User":"Usuario"});
gettextCatalog.setStrings('pt_br', {"Access Groups":"Acesso a Grupos","Actions":"Ações","Assistant Professor":"Professor Assistente","Cancel":"Cancelar","Close":"Fechar","Coordinating Professor":"Professor Coordenador","Course Permissions":"Permissões de curso","Email":"Email","Full name":"Nome completo","Insert User":"Inserir usuário","Insert Users":"Inserir usuários","Office":"Cargo","Save":"Salvar","Search for a User":"Pesquisar um usuário","User":"Usuário"});
}]);
})(angular);
......@@ -2,6 +2,7 @@
'use strict';
angular.module('courseMaterial', [
'gettext',
'courseMaterial.controllers',
'courseMaterial.services',
'courseMaterial.filters',
......@@ -11,4 +12,15 @@
'shared',
]);
angular.module('courseMaterial').run(['gettextCatalog', 'UserLocalStorage', function (gettextCatalog, UserLocalStorage) {
let defaultLanguage = UserLocalStorage.get('currentLanguage') || 'en';
gettextCatalog.setCurrentLanguage(defaultLanguage);
UserLocalStorage.set('currentLanguage', defaultLanguage);
// UserLocalStorage.set('currentLanguage', 'es');
gettextCatalog.setStrings('es', {"Additional Materials":"Materiales adicionales","Write here the text that students will see in the area of additional materials.":"Escriba aquí el texto que los estudiantes verán en el área de materiales adicionales.","cancel":"cancelar","create text":"crear texto","delete material":"eliminar material","edit":"editar"});
gettextCatalog.setStrings('pt_br', {"Write here the text that students will see in the area of additional materials.":"Escreva aqui o texto que os alunos verão na área de materiais adicionais.","cancel":"Cancelar","create text":"criar texto","delete material":"excluir material","edit":"editar"});
}]);
})(angular);
......@@ -4,10 +4,23 @@
// Declare app level module which depends on filters, and services
angular.module('reports', [
'gettext',
'reports.controllers',
'reports.services',
'timtec-models',
'ui.bootstrap',
'shared',
]);
angular.module('reports').run(['gettextCatalog', 'UserLocalStorage', function (gettextCatalog, UserLocalStorage) {
let defaultLanguage = UserLocalStorage.get('currentLanguage') || 'en';
gettextCatalog.setCurrentLanguage(defaultLanguage);
UserLocalStorage.set('currentLanguage', defaultLanguage);
// UserLocalStorage.set('currentLanguage', 'es');
gettextCatalog.setStrings('es', {"All classes in this course":"Todas las clases de este curso","Average student progress per class":"Progreso promedio de los estudiantes por clase","Classes of other teachers":"Turma de otros maestros","Clean":"Limpiar","Courses Report":"Informe de cursos","Done":"Hecho","Filter by Keywords:":"Filtrar por palabras clave:","Filter by classes:":"Filtrar por clases:","Loading progress report...":"Cargando informe de progreso ...","Loading steps report...":"Cargando informe de pasos ...","Loading student reports...":"Cargando informes de estudiantes ...","My classes":"Mis clases","Not done":"No hecho","Number of students currently displayed:":"Número de estudiantes que se muestran actualmente:","Search":"Buscar","Select the language":"Seleccione el idioma","Show Steps":"Mostrar pasos","Student progress":"Progreso del estudiante","Total number of students:<span>{% verbatim %}{{ user_reports_total_items }}{% endverbatim %}</span>":"Número total de estudiantes:<span>{% verbatim %}{{ user_reports_total_items }}{% endverbatim %}</span>"});
gettextCatalog.setStrings('pt_br', {"All classes in this course":"Todas as aulas neste curso","Average student progress per class":"Progresso médio dos alunos por classe","Classes of other teachers":"Turmas de outros professores","Clean":"Limpar","Courses Report":"Relatório de Cursos","Done":"Feito","Filter by Keywords:":"Filtrar por palavras-chave:","Filter by classes:":"Filtrar por classes:","Loading progress report...":"Carregando relatório de progresso ...","Loading steps report...":"Carregando relatório de etapas ...","Loading student reports...":"Carregando relatórios de alunos ...","My classes":"Minhas aulas","Not done":"Não feito","Number of students currently displayed:":"Número de alunos exibidos atualmente:","Search":"Buscar","Select the language":"Selecione o idioma","Show Steps":"Mostrar etapas","Student progress":"Progresso do aluno","Total number of students:<span>{% verbatim %}{{ user_reports_total_items }}{% endverbatim %}</span>":"Número total de alunos:<span>{% verbatim %}{{ user_reports_total_items }}{% endverbatim %}</span>"});
}]);
})(angular);
......@@ -3,8 +3,8 @@
/* Controllers */
var app = angular.module('reports.controllers', []);
app.controller('ReportsCtrl', ['$scope', '$location', '$sce', '$window', 'CourseUserReport', 'LessonsUserProgress', 'BasicClass', 'CourseStats', 'CourseProfessor',
function($scope, $location, $sce, $window, CourseUserReport, LessonsUserProgress, BasicClass, CourseStats, CourseProfessor, ) {
app.controller('ReportsCtrl', ['$scope', '$location', '$sce', 'SetLanguage', '$window', 'CourseUserReport', 'LessonsUserProgress', 'BasicClass', 'CourseStats', 'CourseProfessor',
function($scope, $location, $sce, SetLanguage, $window, CourseUserReport, LessonsUserProgress, BasicClass, CourseStats, CourseProfessor, ) {
$scope.course_id = parseInt($window.course_id, 10);
var current_user_id = parseInt($window.user_id, 10);
......@@ -20,6 +20,12 @@
textsearch: ''
}
$scope.setLanguage = function(language) {
SetLanguage(language);
$window.location.reload();
$scope.language = language;
}
// Pagination Controls
$scope.pagination = {
report_pages_max_number: 100,
......
......@@ -42,5 +42,14 @@
}).factory('RoleParticipationReport', function($resource){
return $resource(COURSES_BASE_API_URL + '/iat/role-participation-report/', {}, {
});
})
}).factory('SetLanguage', ['$http', function($http){
return function(language){
$http({
method:'POST',
url: API_URL + '/i18n/setlang/',
data: 'language=' + language,
headers:{'Content-Type':'application/x-www-form-urlencoded'}
});
};
}]);
})(angular);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment