diff --git a/angular_app/event-edit.html b/angular_app/event-edit.html index 648a4de..39b138c 100644 --- a/angular_app/event-edit.html +++ b/angular_app/event-edit.html @@ -27,7 +27,7 @@
{{'Title' | translate}} - +
{{'Tagline' | translate}} @@ -46,7 +46,7 @@
- + @@ -62,7 +62,7 @@
- + diff --git a/angular_app/events-list.html b/angular_app/events-list.html index 6700b25..7dfb6e8 100644 --- a/angular_app/events-list.html +++ b/angular_app/events-list.html @@ -44,8 +44,8 @@ {{event.title}} -

{{'Begins:' | translate}} {{event['begin-date'] | date:'fullDate'}} {{event['begin-time'] | date:'HH:mm'}}
- {{'Ends:' | translate}} {{event['end-date'] | date:'fullDate' }} {{event['end-time'] | date:'HH:mm'}}

+

{{'Begins:' | translate}} {{event['begin-date'] | date:'fullDate'}} {{event['begin-time'] | date:'HH:mm'}}
+ {{'Ends:' | translate}} {{event['end-date'] | date:'fullDate' }} {{event['end-time'] | date:'HH:mm'}}

{{attendeesNr}} / {{((event.tickets || []) | registeredFilter).length}} ({{((attendeesNr / ((event.tickets || []) | registeredFilter).length * 100) || 0).toFixed()}}%)

@@ -54,7 +54,7 @@ - + diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index d6433f1..c54ddcc 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -7,8 +7,8 @@ var eventManControllers = angular.module('eventManControllers', []); /* A controller that can be used to navigate. */ -eventManControllers.controller('NavigationCtrl', ['$scope', '$rootScope', '$location', 'Setting', 'Info', '$state', - function ($scope, $rootScope, $location, Setting, Info, $state) { +eventManControllers.controller('NavigationCtrl', ['$scope', '$rootScope', '$location', 'Setting', '$state', + function ($scope, $rootScope, $location, Setting, $state) { $scope.logo = {}; $scope.getLocation = function() { @@ -91,7 +91,7 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$uibModal' }); }); - $scope.remove = function(_id) { + $scope.deleteEvent = function(_id) { var modalInstance = $uibModal.open({ scope: $scope, templateUrl: 'modal-confirm-action.html', @@ -101,10 +101,9 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$uibModal' } }); modalInstance.result.then(function() { - Event.remove({'id': _id}, function() { + Event.delete({'id': _id}, function() { $scope.events = Event.all(); - } - ); + }); }); }; diff --git a/angular_app/js/i18n.js b/angular_app/js/i18n.js index ceb57ba..ba4af29 100644 --- a/angular_app/js/i18n.js +++ b/angular_app/js/i18n.js @@ -1,6 +1,5 @@ /* i18n for Event(man) */ - - +'use strict'; eventManApp.config(['$translateProvider', function ($translateProvider) { $translateProvider.useStaticFilesLoader({ diff --git a/angular_app/js/services.js b/angular_app/js/services.js index 6050fbb..3acb671 100644 --- a/angular_app/js/services.js +++ b/angular_app/js/services.js @@ -77,17 +77,6 @@ eventManServices.factory('Event', ['$resource', '$rootScope', eventManServices.factory('EventTicket', ['$resource', '$rootScope', function($resource, $rootScope) { return $resource('events/:id/tickets', {event_id: '@event_id', ticket_id: '@_id'}, { - - get: { - method: 'GET', - url: 'events/:id/tickets/:ticket_id', - interceptor : {responseError: $rootScope.errorHandler}, - transformResponse: function(data, headers) { - data = angular.fromJson(data); - return data.ticket; - } - }, - all: { method: 'GET', url: '/tickets', @@ -102,6 +91,16 @@ eventManServices.factory('EventTicket', ['$resource', '$rootScope', } }, + get: { + method: 'GET', + url: 'events/:id/tickets/:ticket_id', + interceptor : {responseError: $rootScope.errorHandler}, + transformResponse: function(data, headers) { + data = angular.fromJson(data); + return data.ticket; + } + }, + add: { method: 'POST', interceptor : {responseError: $rootScope.errorHandler}, @@ -143,7 +142,6 @@ eventManServices.factory('EventTicket', ['$resource', '$rootScope', eventManServices.factory('Setting', ['$resource', '$rootScope', function($resource, $rootScope) { return $resource('settings/', {}, { - query: { method: 'GET', interceptor : {responseError: $rootScope.errorHandler}, diff --git a/backend.py b/backend.py index 1d22ae8..16ceb5d 100644 --- a/backend.py +++ b/backend.py @@ -2,8 +2,8 @@ Classes and functions used to manage events and attendees database. -Copyright 2015 Davide Alberani - RaspiBO +Copyright 2015-2016 Davide Alberani + RaspiBO Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -43,13 +43,6 @@ def convert_obj(obj): return ObjectId(obj) except: pass - try: - i_obj = int(obj) - if i_obj > 2**64 - 1: - return obj - return i_obj - except: - pass return obj diff --git a/eventman_server.py b/eventman_server.py index 8d5be26..607898a 100755 --- a/eventman_server.py +++ b/eventman_server.py @@ -980,10 +980,14 @@ def run(): if options.debug: logger.setLevel(logging.DEBUG) + ssl_options = {} + if os.path.isfile(options.ssl_key) and os.path.isfile(options.ssl_cert): + ssl_options = dict(certfile=options.ssl_cert, keyfile=options.ssl_key) + # database backend connector db_connector = backend.EventManDB(url=options.mongo_url, dbName=options.db_name) init_params = dict(db=db_connector, data_dir=options.data_dir, listen_port=options.port, - authentication=options.authentication, logger=logger) + authentication=options.authentication, logger=logger, ssl_options=ssl_options) # If not present, we store a user 'admin' with password 'eventman' into the database. if not db_connector.query('users', {'username': 'admin'}): @@ -1025,9 +1029,6 @@ def run(): cookie_secret='__COOKIE_SECRET__', login_url='/login', debug=options.debug) - ssl_options = {} - if os.path.isfile(options.ssl_key) and os.path.isfile(options.ssl_cert): - ssl_options = dict(certfile=options.ssl_cert, keyfile=options.ssl_key) http_server = tornado.httpserver.HTTPServer(application, ssl_options=ssl_options or None) logger.info('Start serving on %s://%s:%d', 'https' if ssl_options else 'http', options.address if options.address else '127.0.0.1', @@ -1038,7 +1039,7 @@ def run(): ws_application = tornado.web.Application([_ws_handler], debug=options.debug) ws_http_server = tornado.httpserver.HTTPServer(ws_application) ws_http_server.listen(options.port+1, address='127.0.0.1') - logger.debug('Starting WebSocket on ws://127.0.0.1:%d', options.port+1) + logger.debug('Starting WebSocket on %s://127.0.0.1:%d', 'wss' if ssl_options else 'ws', options.port+1) tornado.ioloop.IOLoop.instance().start()