diff --git a/Gruntfile.js b/Gruntfile.js index 23ca7d56..a3499d8b 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,7 +19,7 @@ 'use strict'; var pkg = require('./package.json'); -var AV_CONFIG_VERSION = '103111.3'; +var AV_CONFIG_VERSION = '103111.4'; //Using exclusion patterns slows down Grunt significantly //instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**' @@ -192,10 +192,10 @@ module.exports = function (grunt) { options: { remove: ['script[data-remove!="false"]','link[data-remove!="false"]'], append: [ - {selector:'body',html:''}, + {selector:'body',html:''}, {selector:'body',html:''}, - {selector:'body',html:''}, - {selector:'body',html:''}, + {selector:'body',html:''}, + {selector:'body',html:''}, {selector:'head',html:''} ] }, @@ -225,9 +225,9 @@ module.exports = function (grunt) { 'temp/libnocompat.js': ['<%= dom_munger.data.libnocompatjs %>'], 'temp/lib.js': ['<%= dom_munger.data.libjs %>'], 'temp/app.js': ['<%= dom_munger.data.appjs %>','<%= ngtemplates.main.dest %>'], - 'dist/avConfig-v103111.3.js': ['avConfig.js'], - 'dist/avThemes-v103111.3.js': ['avThemes.js'], - 'dist/avPlugins-v103111.3.js': ['plugins/**/*.js'] + 'dist/avConfig-v103111.4.js': ['avConfig.js'], + 'dist/avThemes-v103111.4.js': ['avThemes.js'], + 'dist/avPlugins-v103111.4.js': ['plugins/**/*.js'] } } }, @@ -259,10 +259,10 @@ module.exports = function (grunt) { beautify: true }, files: { - 'dist/appCommon-v103111.3.js': 'temp/app.js', - 'dist/libCommon-v103111.3.js': 'temp/lib.js', - 'dist/libnocompat-v103111.3.js': 'temp/libnocompat.js', - 'dist/libcompat-v103111.3.js': 'temp/libcompat.js', + 'dist/appCommon-v103111.4.js': 'temp/app.js', + 'dist/libCommon-v103111.4.js': 'temp/lib.js', + 'dist/libnocompat-v103111.4.js': 'temp/libnocompat.js', + 'dist/libcompat-v103111.4.js': 'temp/libcompat.js', 'dist/avWidgets.js': 'avWidgets.js', "dist/locales/moment/es.js": "bower_components/moment/lang/es.js", diff --git a/avConfig.js b/avConfig.js index 0094df92..8d1dee78 100644 --- a/avConfig.js +++ b/avConfig.js @@ -20,7 +20,7 @@ * in this same file, which you might want to edit and tune if needed. */ -var AV_CONFIG_VERSION = '103111.3'; +var AV_CONFIG_VERSION = '103111.4'; var avConfigData = { // the base url path for ajax requests, for example for sending ballots or diff --git a/avRegistration/auth-method-service.js b/avRegistration/auth-method-service.js index 01582350..e6f19f00 100644 --- a/avRegistration/auth-method-service.js +++ b/avRegistration/auth-method-service.js @@ -58,6 +58,38 @@ angular.module('avRegistration') var eid = authevent || authId; return $http.post(backendUrl + 'auth-event/'+eid+'/register/', data); }; + + authmethod.getUserInfoExtra = function() { + if (!authmethod.isLoggedIn()) { + var data = { + success: function () { return data; }, + error: function (func) { + setTimeout(function() { + func({message:"not-logged-in"}); + }, 0); + return data; + } + }; + return data; + } + return $http.get(backendUrl + 'user/extra/', {}); + }; + + authmethod.updateUserExtra = function (extra) { + if (!authmethod.isLoggedIn()) { + var data = { + success: function () { return data; }, + error: function (func) { + setTimeout(function() { + func({message:"not-logged-in"}); + }, 0); + return data; + } + }; + return data; + } + return $http.post(backendUrl + 'user/extra/', extra); + }; authmethod.getUserInfo = function(userid) { if (!authmethod.isLoggedIn()) { @@ -156,7 +188,14 @@ angular.module('avRegistration') }; authmethod.getRegisterFields = function (viewEventData) { - var fields = angular.copy(viewEventData.extra_fields); + var fields = _.filter( + angular.copy(viewEventData.extra_fields), + function (item) { + if (true === item.required_when_registered) { + return false; + } + return true; + }); if (!fields) { fields = []; } var found = false; diff --git a/bower.json b/bower.json index 05f9a6e5..d78b7527 100755 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "avCommon", - "version" : "103111.3", + "version" : "103111.4", "main": "index.html", "ignore": [ "tests", diff --git a/dist/appCommon-v103111.3.js b/dist/appCommon-v103111.4.js similarity index 98% rename from dist/appCommon-v103111.3.js rename to dist/appCommon-v103111.4.js index 63f2b108..51f0384c 100644 --- a/dist/appCommon-v103111.3.js +++ b/dist/appCommon-v103111.4.js @@ -14,6 +14,40 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C }, authmethod.signup = function(data, authevent) { var eid = authevent || authId; return $http.post(backendUrl + "auth-event/" + eid + "/register/", data); + }, authmethod.getUserInfoExtra = function() { + if (!authmethod.isLoggedIn()) { + var data = { + success: function() { + return data; + }, + error: function(func) { + return setTimeout(function() { + func({ + message: "not-logged-in" + }); + }, 0), data; + } + }; + return data; + } + return $http.get(backendUrl + "user/extra/", {}); + }, authmethod.updateUserExtra = function(extra) { + if (!authmethod.isLoggedIn()) { + var data = { + success: function() { + return data; + }, + error: function(func) { + return setTimeout(function() { + func({ + message: "not-logged-in" + }); + }, 0), data; + } + }; + return data; + } + return $http.post(backendUrl + "user/extra/", extra); }, authmethod.getUserInfo = function(userid) { if (!authmethod.isLoggedIn()) { var data = { @@ -82,7 +116,9 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C params: params }) : $http.get(backendUrl + "auth-event/" + id + "/census/"); }, authmethod.getRegisterFields = function(viewEventData) { - var fields = angular.copy(viewEventData.extra_fields); + var fields = _.filter(angular.copy(viewEventData.extra_fields), function(item) { + return !0 !== item.required_when_registered; + }); fields || (fields = []); var found = !1; _.each(fields, function(field) { diff --git a/dist/avConfig-v103111.3.js b/dist/avConfig-v103111.4.js similarity index 99% rename from dist/avConfig-v103111.3.js rename to dist/avConfig-v103111.4.js index 0094df92..8d1dee78 100644 --- a/dist/avConfig-v103111.3.js +++ b/dist/avConfig-v103111.4.js @@ -20,7 +20,7 @@ * in this same file, which you might want to edit and tune if needed. */ -var AV_CONFIG_VERSION = '103111.3'; +var AV_CONFIG_VERSION = '103111.4'; var avConfigData = { // the base url path for ajax requests, for example for sending ballots or diff --git a/dist/avPlugins-v103111.3.js b/dist/avPlugins-v103111.4.js similarity index 100% rename from dist/avPlugins-v103111.3.js rename to dist/avPlugins-v103111.4.js diff --git a/dist/avThemes-v103111.3.js b/dist/avThemes-v103111.4.js similarity index 100% rename from dist/avThemes-v103111.3.js rename to dist/avThemes-v103111.4.js diff --git a/dist/index.html b/dist/index.html index c14a7e06..e080cd25 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,2 +1,2 @@ Agora Voting
Page is taking some time to load, wait a moment please. If it takes too long, please check that you have javascript activated, try with another browser or contact us.
For security reasons, your browser is unsupported. Please use a newer web browser (if you are using Internet Explorer, use version 9 or newer).
\ No newline at end of file + so in the compiled app e2e tests are not expected work. -->
Page is taking some time to load, wait a moment please. If it takes too long, please check that you have javascript activated, try with another browser or contact us.
For security reasons, your browser is unsupported. Please use a newer web browser (if you are using Internet Explorer, use version 9 or newer).
\ No newline at end of file diff --git a/dist/libCommon-v103111.3.js b/dist/libCommon-v103111.4.js similarity index 100% rename from dist/libCommon-v103111.3.js rename to dist/libCommon-v103111.4.js diff --git a/dist/libcompat-v103111.3.js b/dist/libcompat-v103111.4.js similarity index 100% rename from dist/libcompat-v103111.3.js rename to dist/libcompat-v103111.4.js diff --git a/dist/libnocompat-v103111.3.js b/dist/libnocompat-v103111.4.js similarity index 100% rename from dist/libnocompat-v103111.3.js rename to dist/libnocompat-v103111.4.js diff --git a/package.json b/package.json index afc9c831..d92b2b42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agora-gui-common", - "version" : "103111.3.0", + "version" : "103111.4.0", "devDependencies": { "grunt": "~0.4", "grunt-angular-templates": "~0.5", @@ -19,7 +19,7 @@ "grunt-contrib-watch": "~0.6", "grunt-dom-munger": "~3.4", "grunt-karma": "~0.8.3", - "grunt-merge-json": "^0.9.5", + "grunt-merge-json": "0.9.5", "grunt-ng-annotate": "^0.9.2", "grunt-protractor-runner": "^1.1.4", "karma": "~0.12.6",