Skip to content

Commit

Permalink
Merge pull request #61 from agoravoting/go-v4
Browse files Browse the repository at this point in the history
Go v4
  • Loading branch information
Findeton committed Sep 6, 2017
2 parents 27e93d7 + f202a8a commit 82574d9
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 19 deletions.
22 changes: 11 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/**'
Expand Down Expand Up @@ -192,10 +192,10 @@ module.exports = function (grunt) {
options: {
remove: ['script[data-remove!="false"]','link[data-remove!="false"]'],
append: [
{selector:'body',html:'<!--[if lte IE 8]><script src="/libcompat-v103111.3.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v103111.3.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v103111.3.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--[if lte IE 8]><script src="/libcompat-v103111.4.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v103111.4.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v103111.4.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--All the source code of this program under copyright. Take a look at the license details at https://github.com/agoravoting/agora-core-view/blob/master/README.md -->'},
{selector:'body',html:'<script src="/appCommon-v103111.3.js"></script>'},
{selector:'body',html:'<script src="/avPlugins-v103111.3.js"></script>'},
{selector:'body',html:'<script src="/appCommon-v103111.4.js"></script>'},
{selector:'body',html:'<script src="/avPlugins-v103111.4.js"></script>'},
{selector:'head',html:'<link rel="stylesheet" id="theme" href="/themes/default/app.min.css">'}
]
},
Expand Down Expand Up @@ -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']
}
}
},
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion avConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 40 additions & 1 deletion avRegistration/auth-method-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "avCommon",
"version" : "103111.3",
"version" : "103111.4",
"main": "index.html",
"ignore": [
"tests",
Expand Down
38 changes: 37 additions & 1 deletion dist/appCommon-v103111.3.js → dist/appCommon-v103111.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/avConfig-v103111.3.js → dist/avConfig-v103111.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html><html id="ng-app" ng-app="agora-gui-common"><head><title>Agora Voting</title><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><base href="/"><meta charset="utf-8"><link rel="stylesheet" id="theme" href="/themes/default/app.min.css"></head><body><!-- Livereload script for development only (stripped during dist build) --><!-- IE8 bind workaround (needed for less) --><!-- JS from Bower Components --><!-- Add New Bower Component JS Above --><!-- JS from Vendor Components --><!-- Add New Vendor Component JS Above --><!-- Configuration file JS --><!-- Themes JS --><!-- Main App JS --><!-- registration --><!-- ui --><!-- for security, we do not include the dynamic directive in the app,
so in the compiled app e2e tests are not expected work. --><!-- IE10 viewport hack for Surface/desktop Windows 8 bug --><!-- IE9 console workaround --><!-- Add New Component JS Above --><div id="no-js">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.</div><div id="unsupported-browser">For security reasons, your browser is unsupported. Please use a newer web browser (if you are using Internet Explorer, use version 9 or newer).</div><div><!-- Shown while loading --><div id="angular-preloading" class="avb-start-loading"></div><!-- Main content --><div id="content"><!-- This is where angular injects its content --><div ui-view=""></div></div></div><!--[if lte IE 8]><script src="/libcompat-v103111.3.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v103111.3.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v103111.3.js"></script><!--<![endif]--><!--All the source code of this program under copyright. Take a look at the license details at https://github.com/agoravoting/agora-core-view/blob/master/README.md --><script src="/appCommon-v103111.3.js"></script><script src="/avPlugins-v103111.3.js"></script></body></html>
so in the compiled app e2e tests are not expected work. --><!-- IE10 viewport hack for Surface/desktop Windows 8 bug --><!-- IE9 console workaround --><!-- Add New Component JS Above --><div id="no-js">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.</div><div id="unsupported-browser">For security reasons, your browser is unsupported. Please use a newer web browser (if you are using Internet Explorer, use version 9 or newer).</div><div><!-- Shown while loading --><div id="angular-preloading" class="avb-start-loading"></div><!-- Main content --><div id="content"><!-- This is where angular injects its content --><div ui-view=""></div></div></div><!--[if lte IE 8]><script src="/libcompat-v103111.4.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v103111.4.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v103111.4.js"></script><!--<![endif]--><!--All the source code of this program under copyright. Take a look at the license details at https://github.com/agoravoting/agora-core-view/blob/master/README.md --><script src="/appCommon-v103111.4.js"></script><script src="/avPlugins-v103111.4.js"></script></body></html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 82574d9

Please sign in to comment.