commit
2dd65d9171
9 changed files with 717 additions and 137 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,8 @@
|
||||||
data/triggers/*.d
|
data/triggers/*.d
|
||||||
ssl/*.pem
|
ssl/*.pem
|
||||||
|
|
||||||
|
angular_app/node_modules/
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|
21
angular_app/Gruntfile.js
vendored
Normal file
21
angular_app/Gruntfile.js
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = function(grunt) {
|
||||||
|
grunt.initConfig({
|
||||||
|
i18nextract: {
|
||||||
|
default_options: {
|
||||||
|
src: ['*.html', 'js/*.js'],
|
||||||
|
lang: ['it_IT'],
|
||||||
|
dest: '../static/i18n'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
grunt.loadTasks('tasks');
|
||||||
|
grunt.loadNpmTasks('grunt-angular-translate');
|
||||||
|
|
||||||
|
grunt.registerTask('translate', ['i18nextract']);
|
||||||
|
grunt.registerTask('default', ['translate']);
|
||||||
|
};
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<script src="/static/js/angular-ui-router.min.js"></script>
|
<script src="/static/js/angular-ui-router.min.js"></script>
|
||||||
<script src="/static/js/angular-websocket.js"></script>
|
<script src="/static/js/angular-websocket.js"></script>
|
||||||
<script src="/static/js/angular-translate.js"></script>
|
<script src="/static/js/angular-translate.js"></script>
|
||||||
|
<script src="/static/js/angular-translate-loader-static-files.min.js"></script>
|
||||||
<script src="/static/js/eventman.js"></script>
|
<script src="/static/js/eventman.js"></script>
|
||||||
<script src="/js/app.js"></script>
|
<script src="/js/app.js"></script>
|
||||||
<script src="/js/i18n.js"></script>
|
<script src="/js/i18n.js"></script>
|
||||||
|
|
41
angular_app/js/controllers.js
vendored
41
angular_app/js/controllers.js
vendored
|
@ -62,20 +62,26 @@ eventManControllers.controller('ModalConfirmInstanceCtrl', ['$scope', '$modalIns
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$modal', '$log',
|
eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$modal', '$log', '$translate', '$rootScope',
|
||||||
function ($scope, Event, $modal, $log) {
|
function ($scope, Event, $modal, $log, $translate, $rootScope) {
|
||||||
$scope.events = Event.all();
|
$scope.events = Event.all();
|
||||||
$scope.personsOrderProp = 'name';
|
$scope.personsOrderProp = 'name';
|
||||||
$scope.eventsOrderProp = "'-begin-date'";
|
$scope.eventsOrderProp = "'-begin-date'";
|
||||||
|
|
||||||
|
$scope.confirm_delete = 'You really want to delete this event?';
|
||||||
|
$rootScope.$on('$translateChangeSuccess', function () {
|
||||||
|
$translate('You really want to delete this event?').then(function (translation) {
|
||||||
|
$scope.confirm_delete = translation;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$scope.remove = function(_id) {
|
$scope.remove = function(_id) {
|
||||||
var modalInstance = $modal.open({
|
var modalInstance = $modal.open({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
templateUrl: 'modal-confirm-action.html',
|
templateUrl: 'modal-confirm-action.html',
|
||||||
controller: 'ModalConfirmInstanceCtrl',
|
controller: 'ModalConfirmInstanceCtrl',
|
||||||
resolve: {
|
resolve: {
|
||||||
// XXX: must be converted in a i18n-able form.
|
message: function() { return $scope.confirm_delete; }
|
||||||
message: function() { return 'You really want to delete this event?'; }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
modalInstance.result.then(function() {
|
modalInstance.result.then(function() {
|
||||||
|
@ -90,8 +96,8 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$modal', '
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event', 'Person', 'EventUpdates', '$stateParams', 'Setting', '$log',
|
eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event', 'Person', 'EventUpdates', '$stateParams', 'Setting', '$log', '$translate',
|
||||||
function ($scope, $state, Event, Person, EventUpdates, $stateParams, Setting, $log) {
|
function ($scope, $state, Event, Person, EventUpdates, $stateParams, Setting, $log, $translate) {
|
||||||
$scope.personsOrder = ["name", "surname"];
|
$scope.personsOrder = ["name", "surname"];
|
||||||
$scope.countAttendees = 0;
|
$scope.countAttendees = 0;
|
||||||
$scope.message = {};
|
$scope.message = {};
|
||||||
|
@ -191,9 +197,12 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
|
||||||
$scope.allPersons = Person.all();
|
$scope.allPersons = Person.all();
|
||||||
}
|
}
|
||||||
$scope.newPerson = {};
|
$scope.newPerson = {};
|
||||||
// XXX: must be converted in a i18n-able form.
|
$translate('{{person_name}} {{person_surname}} successfully added to event {{event_title}}',
|
||||||
var msg = '' + person_data.name + ' ' + person_data.surname + ' successfully added to event ' + $scope.event.title;
|
{person_name: person_data.name, person_surname: person_data.surname, event_title: $scope.event.title}).then(
|
||||||
$scope.showMessage({message: msg});
|
function (translation) {
|
||||||
|
$scope.showMessage({message: translation});
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$scope.query = '';
|
$scope.query = '';
|
||||||
|
@ -264,13 +273,20 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
eventManControllers.controller('PersonsListCtrl', ['$scope', 'Person', 'Setting', '$modal',
|
eventManControllers.controller('PersonsListCtrl', ['$scope', 'Person', 'Setting', '$modal', '$translate', '$rootScope',
|
||||||
function ($scope, Person, Setting, $modal) {
|
function ($scope, Person, Setting, $modal, $translate, $rootScope) {
|
||||||
$scope.persons = Person.all();
|
$scope.persons = Person.all();
|
||||||
$scope.personsOrder = ["name", "surname"];
|
$scope.personsOrder = ["name", "surname"];
|
||||||
$scope.customFields = Setting.query({setting: 'person_custom_field',
|
$scope.customFields = Setting.query({setting: 'person_custom_field',
|
||||||
in_persons_list: true});
|
in_persons_list: true});
|
||||||
|
|
||||||
|
$scope.confirm_delete = 'You really want to delete this person?';
|
||||||
|
$rootScope.$on('$translateChangeSuccess', function () {
|
||||||
|
$translate('You really want to delete this person?').then(function (translation) {
|
||||||
|
$scope.confirm_delete = translation;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$scope.updateOrded = function(key) {
|
$scope.updateOrded = function(key) {
|
||||||
var new_order = [key];
|
var new_order = [key];
|
||||||
var inv_key;
|
var inv_key;
|
||||||
|
@ -303,8 +319,7 @@ eventManControllers.controller('PersonsListCtrl', ['$scope', 'Person', 'Setting'
|
||||||
templateUrl: 'modal-confirm-action.html',
|
templateUrl: 'modal-confirm-action.html',
|
||||||
controller: 'ModalConfirmInstanceCtrl',
|
controller: 'ModalConfirmInstanceCtrl',
|
||||||
resolve: {
|
resolve: {
|
||||||
// XXX: must be converted in a i18n-able form.
|
message: function() { return $scope.confirm_delete; }
|
||||||
message: function() { return 'You really want to delete this person?'; }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
modalInstance.result.then(function() {
|
modalInstance.result.then(function() {
|
||||||
|
|
17
angular_app/js/i18n.js
vendored
17
angular_app/js/i18n.js
vendored
|
@ -1,13 +1,16 @@
|
||||||
/* i18n for Event(man) */
|
/* i18n for Event(man) */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
eventManApp.config(['$translateProvider', function ($translateProvider) {
|
eventManApp.config(['$translateProvider', function ($translateProvider) {
|
||||||
$translateProvider.translations('it_IT', {
|
console.log($translateProvider);
|
||||||
'Events': 'Eventi',
|
$translateProvider.useStaticFilesLoader({
|
||||||
'Add event': 'Nuovo evento',
|
prefix: '/static/i18n/',
|
||||||
'Persons': 'Persone',
|
suffix: '.json'
|
||||||
'Add person': 'Nuova persona',
|
|
||||||
'Import persons': 'Importa persone',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$translateProvider.preferredLanguage('it_IT');
|
$translateProvider.useSanitizeValueStrategy('escaped');
|
||||||
|
//$translateProvider.preferredLanguage('it_IT');
|
||||||
|
//$translateProvider.fallbackLanguage('en_US');
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
58
static/i18n/it_IT.json
Normal file
58
static/i18n/it_IT.json
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"Info": "",
|
||||||
|
"New event": "",
|
||||||
|
"save": "",
|
||||||
|
"Title": "",
|
||||||
|
"begin date:": "",
|
||||||
|
"begin time:": "",
|
||||||
|
"End date:": "",
|
||||||
|
"End time:": "",
|
||||||
|
"Edit": "",
|
||||||
|
"Registered:": "",
|
||||||
|
"Attendees:": "",
|
||||||
|
"Persons": "",
|
||||||
|
"Search:": "",
|
||||||
|
"Name or email": "",
|
||||||
|
"Person": "",
|
||||||
|
"Name": "",
|
||||||
|
"Surname": "",
|
||||||
|
"Attended": "",
|
||||||
|
"Delete": "",
|
||||||
|
"Quick add": "",
|
||||||
|
"Email": "",
|
||||||
|
"name.surname@example.com": "",
|
||||||
|
"Company": "",
|
||||||
|
"Acme Corporation": "",
|
||||||
|
"Job": "",
|
||||||
|
"Evil Ruler": "",
|
||||||
|
"Add": "",
|
||||||
|
"Unregistered persons": "",
|
||||||
|
"Events": "",
|
||||||
|
"Add event": "",
|
||||||
|
"Event title": "",
|
||||||
|
"Title (descending)": "",
|
||||||
|
"Date": "",
|
||||||
|
"Date (descending)": "",
|
||||||
|
"Event": "",
|
||||||
|
"Begins:": "",
|
||||||
|
"Ends:": "",
|
||||||
|
"Import persons": "",
|
||||||
|
"Import persons from eventbrite CSV": "",
|
||||||
|
"CSV file": "",
|
||||||
|
"CSV exported from eventbrite": "",
|
||||||
|
"Associate users to this event": "",
|
||||||
|
"Import": "",
|
||||||
|
"logout": "",
|
||||||
|
"Confirm": "",
|
||||||
|
"Ok": "",
|
||||||
|
"Cancel": "",
|
||||||
|
"New person": "",
|
||||||
|
"Add to event:": "",
|
||||||
|
"Sort by:": "",
|
||||||
|
"Registered": "",
|
||||||
|
"Add person": "",
|
||||||
|
"Persons:": "",
|
||||||
|
"You really want to delete this event?": "",
|
||||||
|
"{{person_name}} {{person_surname}} successfully added to event {{event_title}}": "",
|
||||||
|
"You really want to delete this person?": ""
|
||||||
|
}
|
6
static/js/angular-translate-loader-static-files.min.js
vendored
Normal file
6
static/js/angular-translate-loader-static-files.min.js
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
/*!
|
||||||
|
* angular-translate - v2.7.0 - 2015-05-02
|
||||||
|
* http://github.com/angular-translate/angular-translate
|
||||||
|
* Copyright (c) 2015 ; Licensed MIT
|
||||||
|
*/
|
||||||
|
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){function a(a,b){"use strict";return function(c){if(!(c&&(angular.isArray(c.files)||angular.isString(c.prefix)&&angular.isString(c.suffix))))throw new Error("Couldn't load static files, no files and prefix or suffix specified!");c.files||(c.files=[{prefix:c.prefix,suffix:c.suffix}]);for(var d=function(d){if(!d||!angular.isString(d.prefix)||!angular.isString(d.suffix))throw new Error("Couldn't load static file, no prefix or suffix specified!");var e=a.defer();return b(angular.extend({url:[d.prefix,c.key,d.suffix].join(""),method:"GET",params:""},c.$http)).success(function(a){e.resolve(a)}).error(function(){e.reject(c.key)}),e.promise},e=a.defer(),f=[],g=c.files.length,h=0;g>h;h++)f.push(d({prefix:c.files[h].prefix,key:c.key,suffix:c.files[h].suffix}));return a.all(f).then(function(a){for(var b=a.length,c={},d=0;b>d;d++)for(var f in a[d])c[f]=a[d][f];e.resolve(c)},function(a){e.reject(a)}),e.promise}}return angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",a),a.$inject=["$q","$http"],a.displayName="$translateStaticFilesLoader","pascalprecht.translate"});
|
702
static/js/angular-translate.js
vendored
702
static/js/angular-translate.js
vendored
File diff suppressed because it is too large
Load diff
4
static/js/angular-translate.min.js
vendored
4
static/js/angular-translate.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue