Skip to content

Commit

Permalink
Merge pull request #31 from agoravoting/release-3-4
Browse files Browse the repository at this point in the history
Release 3 4
  • Loading branch information
Findeton authored Dec 2, 2016
2 parents 0dc55e6 + 150e855 commit 9f8b300
Show file tree
Hide file tree
Showing 48 changed files with 1,804 additions and 1,079 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 = '3.3.0';
var AV_CONFIG_VERSION = '3.4.0';

//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-v3.0.1.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v3.0.1.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v3.0.1.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--[if lte IE 8]><script src="/libcompat-v3.4.0.js"></script><![endif]--><!--[if gte IE 9]><script src="/libnocompat-v3.4.0.js"></script><![endif]--><!--[if !IE]><!--><script src="/libnocompat-v3.4.0.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-v3.0.1.js"></script>'},
{selector:'body',html:'<script src="/avPlugins-v3.0.1.js"></script>'},
{selector:'body',html:'<script src="/appCommon-v3.4.0.js"></script>'},
{selector:'body',html:'<script src="/avPlugins-v3.4.0.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-v3.0.1.js': ['avConfig.js'],
'dist/avThemes-v3.0.1.js': ['avThemes.js'],
'dist/avPlugins-v3.0.1.js': ['plugins/**/*.js']
'dist/avConfig-v3.4.0.js': ['avConfig.js'],
'dist/avThemes-v3.4.0.js': ['avThemes.js'],
'dist/avPlugins-v3.4.0.js': ['plugins/**/*.js']
}
}
},
Expand Down Expand Up @@ -259,10 +259,10 @@ module.exports = function (grunt) {
beautify: true
},
files: {
'dist/appCommon-v3.0.1.js': 'temp/app.js',
'dist/libCommon-v3.0.1.js': 'temp/lib.js',
'dist/libnocompat-v3.0.1.js': 'temp/libnocompat.js',
'dist/libcompat-v3.0.1.js': 'temp/libcompat.js',
'dist/appCommon-v3.4.0.js': 'temp/app.js',
'dist/libCommon-v3.4.0.js': 'temp/lib.js',
'dist/libnocompat-v3.4.0.js': 'temp/libnocompat.js',
'dist/libcompat-v3.4.0.js': 'temp/libcompat.js',
'dist/avWidgets.js': 'avWidgets.js',

"dist/locales/moment/es.js": "bower_components/moment/lang/es.js",
Expand Down
29 changes: 19 additions & 10 deletions 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 = '3.3.0';
var AV_CONFIG_VERSION = '3.4.0';

var avConfigData = {
// the base url path for ajax requests, for example for sending ballots or
Expand All @@ -30,10 +30,10 @@ var avConfigData = {
theme: "default",
baseUrl: "https://agora/elections/api/",
freeAuthId: 1,

// Webpage title
webTitle: "Agora Voting",

// Show 'Success Action' tab in admin agora_gui
showSuccessAction: false,

Expand All @@ -49,6 +49,15 @@ var avConfigData = {
authorities: ['local-auth2'],
director: "local-auth1",

// For admins:
// Allow editing the json description of the election before creating it
// Allowed values: true|false
allowEditElectionJson: true,

// show the documentation links after successfully casting a vote
// allowed values: true| false
showDocOnVoteCast: false,

resourceUrlWhitelist: [
// Allow same origin resource loads.
'self',
Expand Down Expand Up @@ -135,7 +144,7 @@ var avConfigData = {
sales: "[email protected]",
tlf: "-no tlf-"
},

// social networks footer links
social: {
facebook: "https://www.facebook.com/AgoraVoting",
Expand All @@ -145,7 +154,7 @@ var avConfigData = {
youtube: "https://www.youtube.com/results?search_query=Agora+Voting",
github: "https://github.com/agoravoting/"
},

// technology footer links
technology: {
aboutus: "https://agoravoting.com/#aboutus",
Expand All @@ -154,7 +163,7 @@ var avConfigData = {
solutions: "https://agoravoting.com/solutions/",
admin_manual: "https://bit.ly/avguiadeuso"
},

// legality footer links
legal: {
terms_of_service: "https://agoravoting.com/tos/",
Expand All @@ -163,16 +172,16 @@ var avConfigData = {
security_contact: "https://agoravoting.com/security_contact/",
community_website: "https://agoravoting.org"
},

documentation: {
faq: 'https://nvotes.com/doc/en/',
overview: 'https://agoravoting.com/overview/',
technical: 'https://agoravoting.com/static/generic_tech_overview_20_08_15.pdf',
security_contact: "https://agoravoting.com/security_contact/"
},

documentation_html_include: '',

legal_html_include: '',

// Details pertaining to the organization that runs the software
Expand All @@ -184,7 +193,7 @@ var avConfigData = {
// URL that the logo links to
orgUrl: 'https://agoravoting.com'
},

verifier: {
link: "",
hash: ""
Expand Down
26 changes: 21 additions & 5 deletions avRegistration/auth-method-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,28 @@ angular.module('avRegistration')

authmethod.getRegisterFields = function (viewEventData) {
var fields = angular.copy(viewEventData.extra_fields);

if (!fields) { fields = []; }
if (viewEventData.auth_method === "sms") {
var found = false;
_.each(fields, function(field) {
if (viewEventData.auth_method === "sms" && field.name === 'tlf') {
if (field.type === 'text') {
field.type = 'tlf';
}
found = true;
} else if (viewEventData.auth_method === "email" && field.name === 'email') {
found = true;
}
});

if (viewEventData.auth_method === "sms" && !found) {
fields.push({
"name": "tlf",
"type": "tlf",
"required": true,
"required_on_authentication": true
});
} else if (viewEventData.auth_method === "email") {
} else if (viewEventData.auth_method === "email" && !found) {
fields.push({
"name": "email",
"type": "email",
Expand Down Expand Up @@ -240,21 +253,24 @@ angular.module('avRegistration')
if (!page) {
page = 1;
}
return $http.get(backendUrl + 'acl/mine/?object_type=AuthEvent&perm=edit&order=-pk&page='+page);
return $http.get(backendUrl + 'acl/mine/?object_type=AuthEvent&perm=edit|view&order=-pk&page='+page);
};

authmethod.sendAuthCodes = function(eid, election, user_ids, extra) {
authmethod.sendAuthCodes = function(eid, election, user_ids, auth_method, extra) {
var url = backendUrl + 'auth-event/'+eid+'/census/send_auth/';
var data = {};
if (angular.isDefined(election)) {
data.msg = election.census.config.msg;
if (election.census.auth_method === 'email') {
if ('email' === auth_method) {
data.subject = election.census.config.subject;
}
}
if (angular.isDefined(user_ids)) {
data["user-ids"] = user_ids;
}
if (angular.isDefined(auth_method)) {
data["auth-method"] = auth_method;
}
if (extra) {
data["extra"] = extra;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
autocomplete="off"
ng-class="{'filled': form['input' + index].$viewValue.length > 0}"
minlength="8"
maxlength="8"
maxlength="9"
ng-pattern="codePattern"
name="input{{index}}"
ng-i18next="[placeholder]avRegistration.codePlaceholder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
angular.module('avRegistration')
.directive('avrCodeField', function($state, Plugins) {
function link(scope, element, attrs) {
scope.codePattern = /[abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789]{8,8}/;
scope.codePattern = /[abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789-]{8,9}/;

scope.showResendAuthCode = function ()
{
Expand Down
6 changes: 4 additions & 2 deletions avRegistration/login-directive/login-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ angular.module('avRegistration')
'captcha_code': Authmethod.captcha_code,
};
_.each(scope.login_fields, function (field) {
data[field.name] = field.value;
if (field.name === 'email') {
scope.email = field.value;
} else if ('code' === field.name) {
field.value = field.value.trim().replace(/ |\n|\t|-|_/g,'').toUpperCase();
}
data[field.name] = field.value;
});

scope.sendingData = true;
Expand Down Expand Up @@ -177,7 +179,7 @@ angular.module('avRegistration')
el.value = scope.email;
el.disabled = true;
} else if (el.type === "code" && scope.code !== null) {
el.value = scope.code.trim().toUpperCase();
el.value = scope.code.trim().replace(/ |\n|\t|-|_/g,'').toUpperCase();
el.disabled = true;
} else if (el.type === "tlf" && scope.method === "sms") {
if (scope.email !== null && scope.email.indexOf('@') === -1) {
Expand Down
8 changes: 8 additions & 0 deletions avRegistration/login-directive/login-directive.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
display: block;
min-height: 38px;
}

.btn-success {
background-color: @av-primary-contrast;
}

.btn-success:hover {
background-color: darken(@av-secondary-contrast, 25%);
}
}

.form-horizontal {
Expand Down
2 changes: 1 addition & 1 deletion avUi/change-lang-directive/change-lang-directive.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
padding-left: 8px;

&:hover {
background-color: #3E5771;
background-color: @av-primary-contrast;
}

> a:hover {
Expand Down
8 changes: 4 additions & 4 deletions avUi/documentation-directive/documentation-directive.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<h2 class="text-center text-av-secondary" ng-i18next="avDocumentation.documentation.title"></h2>
<p ng-i18next="avDocumentation.documentation.first_line"></p>
<ul>
<li>
<li ng-if="!!documentation.faq">
<a
href="{{documentation.faq}}"
target="_blank"
ng-i18next="avDocumentation.documentation.faq">
</a>
</li>
<li>
<li ng-if="!!documentation.overview">
<a
href="{{documentation.overview}}"
target="_blank"
Expand All @@ -23,14 +23,14 @@ <h2 class="text-center text-av-secondary" ng-i18next="avDocumentation.documentat
ng-i18next="avDocumentation.documentation.authorities">
</a>
</li>
<li>
<li ng-if="!!documentation.technical">
<a
href="{{documentation.technical}}"
target="_blank"
ng-i18next="avDocumentation.documentation.technical">
</a>
</li>
<li>
<li ng-if="!!documentation.security_contact">
<a
href="{{documentation.security_contact}}"
target="_blank"
Expand Down
55 changes: 33 additions & 22 deletions avUi/foot-directive/foot-directive.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,72 @@
<div class="commonfoot">
<div class="container">
<div class="row">
<div class="col-md-2 col-md-offset-1">
<h3 ng-i18next="avCommon.foot.contact"></h3>
<div
class="col-md-2 col-md-offset-3"
ng-if="!!contact.email||!!contact.sales||!!social.facebook||!!social.twitter||!!social.googleplus||!!social.youtube||!!social.github"
>
<h3 ng-i18next="avCommon.foot.contact">
</h3>
<ul>
<li><a href="mailto:{{contact.email}}" ng-i18next="avCommon.foot.contactsupport"></a></li>
<li><a href="mailto:{{contact.sales}}" ng-i18next="avCommon.foot.contactsales"></a></li>
<li ng-if="!!contact.email"><a href="mailto:{{contact.email}}" ng-i18next="avCommon.foot.contactsupport"></a></li>
<li ng-if="!!contact.sales"><a href="mailto:{{contact.sales}}" ng-i18next="avCommon.foot.contactsales"></a></li>
</ul>
<!-- social links -->
<div class="social">
<a href="{{social.facebook}}"><i class="fa fa-fw fa-lg fa-facebook"></i></a>
<a href="{{social.twitter}}"><i class="fa fa-fw fa-lg fa-twitter"></i></a>
<a href="{{social.googleplus}}"><i class="fa fa-fw fa-lg fa-google-plus"></i></a>
<a href="{{social.youtube}}"><i class="fa fa-fw fa-lg fa-youtube-play"></i></a>
<a href="{{social.github}}"><i class="fa fa-fw fa-lg fa-github"></i></a>
<a href="{{social.facebook}}" ng-if="!!social.facebook"><i class="fa fa-fw fa-lg fa-facebook"></i></a>
<a href="{{social.twitter}}" ng-if="!!social.twitter"><i class="fa fa-fw fa-lg fa-twitter"></i></a>
<a href="{{social.googleplus}}" ng-if="!!social.googleplus"><i class="fa fa-fw fa-lg fa-google-plus"></i></a>
<a href="{{social.youtube}}" ng-if="!!social.youtube"><i class="fa fa-fw fa-lg fa-youtube-play"></i></a>
<a href="{{social.github}}" ng-if="!!social.github"><i class="fa fa-fw fa-lg fa-github"></i></a>
</div>
</div>

<div class="col-md-2">
<h3 ng-i18next="avCommon.foot.technology"></h3>
<div
class="col-md-2"
ng-if="!!technology.aboutus||!!technology.pricing||!!technology.overview||!!technology.solutions||!!technology.admin_manual"
>
<h3 ng-i18next="avCommon.foot.technology">
</h3>
<ul>
<li><a href="{{technology.aboutus}}" ng-i18next="avCommon.foot.aboutus"></a></li>
<li><a href="{{technology.pricing}}" ng-i18next="avCommon.foot.pricing"></a></li>
<li><a href="{{technology.overview}}" ng-i18next="avCommon.foot.technology"></a></li>
<li><a href="{{technology.solutions}}" ng-i18next="avCommon.foot.solutions"></a></li>
<li><a href="{{technology.admin_manual}}" ng-i18next="avCommon.foot.adminManual"></a></li>
<li ng-if="!!technology.aboutus"><a href="{{technology.aboutus}}" ng-i18next="avCommon.foot.aboutus"></a></li>
<li ng-if="!!technology.pricing"><a href="{{technology.pricing}}" ng-i18next="avCommon.foot.pricing"></a></li>
<li ng-if="!!technology.overview"><a href="{{technology.overview}}" ng-i18next="avCommon.foot.technology"></a></li>
<li ng-if="!!technology.solutions"><a href="{{technology.solutions}}" ng-i18next="avCommon.foot.solutions"></a></li>
<li ng-if="!!technology.admin_manual"><a href="{{technology.admin_manual}}" ng-i18next="avCommon.foot.adminManual"></a></li>
</ul>
</div>

<div class="col-md-2">
<div
class="col-md-2"
ng-if="!!legal.terms_of_service||!!legal.cookies||!!legal.privacy||!!legal.security_contact||!!legal.community_website"
>
<h3 ng-i18next="avCommon.foot.legal"></h3>
<ul>
<li>
<li ng-if="!!legal.terms_of_service">
<a
href="{{legal.terms_of_service}}"
ng-i18next="avCommon.foot.tos">
</a>
</li>
<li>
<li ng-if="!!legal.cookies">
<a
href="{{legal.cookies}}"
ng-i18next="avCommon.foot.cookies">
</a>
</li>
<li>
<li ng-if="!!legal.privacy">
<a
href="{{legal.privacy}}"
ng-i18next="avCommon.foot.privacy">
</a>
</li>
<li>
<li ng-if="!!legal.security_contact">
<a
href="{{legal.security_contact}}"
ng-i18next="avCommon.foot.securitycontact">
</a>
</li>
<li>
<li ng-if="!!legal.community_website">
<a
target="_blank"
href="{{legal.community_website}}"
Expand Down
Loading

0 comments on commit 9f8b300

Please sign in to comment.