Skip to content

Commit 92e8fb5

Browse files
committed
merge
2 parents 7b79f96 + 18f8bf8 commit 92e8fb5

File tree

24 files changed

+599
-236
lines changed

24 files changed

+599
-236
lines changed

avConfig.js

+18-9
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ var avConfigData = {
3030
theme: "default",
3131
baseUrl: "https://agora/elections/api/",
3232
freeAuthId: 1,
33-
33+
3434
// Webpage title
3535
webTitle: "Agora Voting",
36-
36+
3737
// Show 'Success Action' tab in admin agora_gui
3838
showSuccessAction: false,
3939

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

52+
// For admins:
53+
// Allow editing the json description of the election before creating it
54+
// Allowed values: true|false
55+
allowEditElectionJson: true,
56+
57+
// show the documentation links after successfully casting a vote
58+
// allowed values: true| false
59+
showDocOnVoteCast: false,
60+
5261
resourceUrlWhitelist: [
5362
// Allow same origin resource loads.
5463
'self',
@@ -135,7 +144,7 @@ var avConfigData = {
135144
136145
tlf: "-no tlf-"
137146
},
138-
147+
139148
// social networks footer links
140149
social: {
141150
facebook: "https://www.facebook.com/AgoraVoting",
@@ -145,7 +154,7 @@ var avConfigData = {
145154
youtube: "https://www.youtube.com/results?search_query=Agora+Voting",
146155
github: "https://github.com/agoravoting/"
147156
},
148-
157+
149158
// technology footer links
150159
technology: {
151160
aboutus: "https://agoravoting.com/#aboutus",
@@ -154,7 +163,7 @@ var avConfigData = {
154163
solutions: "https://agoravoting.com/solutions/",
155164
admin_manual: "https://bit.ly/avguiadeuso"
156165
},
157-
166+
158167
// legality footer links
159168
legal: {
160169
terms_of_service: "https://agoravoting.com/tos/",
@@ -163,16 +172,16 @@ var avConfigData = {
163172
security_contact: "https://agoravoting.com/security_contact/",
164173
community_website: "https://agoravoting.org"
165174
},
166-
175+
167176
documentation: {
168177
faq: 'https://nvotes.com/doc/en/',
169178
overview: 'https://agoravoting.com/overview/',
170179
technical: 'https://agoravoting.com/static/generic_tech_overview_20_08_15.pdf',
171180
security_contact: "https://agoravoting.com/security_contact/"
172181
},
173-
182+
174183
documentation_html_include: '',
175-
184+
176185
legal_html_include: '',
177186

178187
// Details pertaining to the organization that runs the software
@@ -184,7 +193,7 @@ var avConfigData = {
184193
// URL that the logo links to
185194
orgUrl: 'https://agoravoting.com'
186195
},
187-
196+
188197
verifier: {
189198
link: "",
190199
hash: ""

avRegistration/auth-method-service.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ angular.module('avRegistration')
240240
if (!page) {
241241
page = 1;
242242
}
243-
return $http.get(backendUrl + 'acl/mine/?object_type=AuthEvent&perm=edit&order=-pk&page='+page);
243+
return $http.get(backendUrl + 'acl/mine/?object_type=AuthEvent&perm=edit|view&order=-pk&page='+page);
244244
};
245245

246246
authmethod.sendAuthCodes = function(eid, election, user_ids, auth_method, extra) {

avRegistration/fields/code-field-directive/code-field-directive.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
autocomplete="off"
1212
ng-class="{'filled': form['input' + index].$viewValue.length > 0}"
1313
minlength="8"
14-
maxlength="8"
14+
maxlength="9"
1515
ng-pattern="codePattern"
1616
name="input{{index}}"
1717
ng-i18next="[placeholder]avRegistration.codePlaceholder"

avRegistration/fields/code-field-directive/code-field-directive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
angular.module('avRegistration')
1919
.directive('avrCodeField', function($state, Plugins) {
2020
function link(scope, element, attrs) {
21-
scope.codePattern = /[abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789]{8,8}/;
21+
scope.codePattern = /[abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789-]{8,9}/;
2222

2323
scope.showResendAuthCode = function ()
2424
{

avRegistration/login-directive/login-directive.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ angular.module('avRegistration')
100100
'captcha_code': Authmethod.captcha_code,
101101
};
102102
_.each(scope.login_fields, function (field) {
103-
data[field.name] = field.value;
104103
if (field.name === 'email') {
105104
scope.email = field.value;
105+
} else if ('code' === field.name) {
106+
field.value = field.value.trim().replace(/ |\n|\t|-|_/g,'').toUpperCase();
106107
}
108+
data[field.name] = field.value;
107109
});
108110

109111
scope.sendingData = true;
@@ -177,7 +179,7 @@ angular.module('avRegistration')
177179
el.value = scope.email;
178180
el.disabled = true;
179181
} else if (el.type === "code" && scope.code !== null) {
180-
el.value = scope.code.trim().toUpperCase();
182+
el.value = scope.code.trim().replace(/ |\n|\t|-|_/g,'').toUpperCase();
181183
el.disabled = true;
182184
} else if (el.type === "tlf" && scope.method === "sms") {
183185
if (scope.email !== null && scope.email.indexOf('@') === -1) {

avUi/documentation-directive/documentation-directive.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<h2 class="text-center text-av-secondary" ng-i18next="avDocumentation.documentation.title"></h2>
33
<p ng-i18next="avDocumentation.documentation.first_line"></p>
44
<ul>
5-
<li>
5+
<li ng-if="!!documentation.faq">
66
<a
77
href="{{documentation.faq}}"
88
target="_blank"
99
ng-i18next="avDocumentation.documentation.faq">
1010
</a>
1111
</li>
12-
<li>
12+
<li ng-if="!!documentation.overview">
1313
<a
1414
href="{{documentation.overview}}"
1515
target="_blank"
@@ -23,14 +23,14 @@ <h2 class="text-center text-av-secondary" ng-i18next="avDocumentation.documentat
2323
ng-i18next="avDocumentation.documentation.authorities">
2424
</a>
2525
</li>
26-
<li>
26+
<li ng-if="!!documentation.technical">
2727
<a
2828
href="{{documentation.technical}}"
2929
target="_blank"
3030
ng-i18next="avDocumentation.documentation.technical">
3131
</a>
3232
</li>
33-
<li>
33+
<li ng-if="!!documentation.security_contact">
3434
<a
3535
href="{{documentation.security_contact}}"
3636
target="_blank"

avUi/foot-directive/foot-directive.html

+33-22
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,72 @@
11
<div class="commonfoot">
22
<div class="container">
33
<div class="row">
4-
<div class="col-md-2 col-md-offset-1">
5-
<h3 ng-i18next="avCommon.foot.contact"></h3>
4+
<div
5+
class="col-md-2 col-md-offset-1"
6+
ng-if="!!contact.email||!!contact.sales||!!social.facebook||!!social.twitter||!!social.googleplus||!!social.youtube||!!social.github"
7+
>
8+
<h3 ng-i18next="avCommon.foot.contact">
9+
</h3>
610
<ul>
7-
<li><a href="mailto:{{contact.email}}" ng-i18next="avCommon.foot.contactsupport"></a></li>
8-
<li><a href="mailto:{{contact.sales}}" ng-i18next="avCommon.foot.contactsales"></a></li>
11+
<li ng-if="!!contact.email"><a href="mailto:{{contact.email}}" ng-i18next="avCommon.foot.contactsupport"></a></li>
12+
<li ng-if="!!contact.sales"><a href="mailto:{{contact.sales}}" ng-i18next="avCommon.foot.contactsales"></a></li>
913
</ul>
1014
<!-- social links -->
1115
<div class="social">
12-
<a href="{{social.facebook}}"><i class="fa fa-fw fa-lg fa-facebook"></i></a>
13-
<a href="{{social.twitter}}"><i class="fa fa-fw fa-lg fa-twitter"></i></a>
14-
<a href="{{social.googleplus}}"><i class="fa fa-fw fa-lg fa-google-plus"></i></a>
15-
<a href="{{social.youtube}}"><i class="fa fa-fw fa-lg fa-youtube-play"></i></a>
16-
<a href="{{social.github}}"><i class="fa fa-fw fa-lg fa-github"></i></a>
16+
<a href="{{social.facebook}}" ng-if="!!social.facebook"><i class="fa fa-fw fa-lg fa-facebook"></i></a>
17+
<a href="{{social.twitter}}" ng-if="!!social.twitter"><i class="fa fa-fw fa-lg fa-twitter"></i></a>
18+
<a href="{{social.googleplus}}" ng-if="!!social.googleplus"><i class="fa fa-fw fa-lg fa-google-plus"></i></a>
19+
<a href="{{social.youtube}}" ng-if="!!social.youtube"><i class="fa fa-fw fa-lg fa-youtube-play"></i></a>
20+
<a href="{{social.github}}" ng-if="!!social.github"><i class="fa fa-fw fa-lg fa-github"></i></a>
1721
</div>
1822
</div>
1923

20-
<div class="col-md-2">
21-
<h3 ng-i18next="avCommon.foot.technology"></h3>
24+
<div
25+
class="col-md-2"
26+
ng-if="!!technology.aboutus||!!technology.pricing||!!technology.overview||!!technology.solutions||!!technology.admin_manual"
27+
>
28+
<h3 ng-i18next="avCommon.foot.technology">
29+
</h3>
2230
<ul>
23-
<li><a href="{{technology.aboutus}}" ng-i18next="avCommon.foot.aboutus"></a></li>
24-
<li><a href="{{technology.pricing}}" ng-i18next="avCommon.foot.pricing"></a></li>
25-
<li><a href="{{technology.overview}}" ng-i18next="avCommon.foot.technology"></a></li>
26-
<li><a href="{{technology.solutions}}" ng-i18next="avCommon.foot.solutions"></a></li>
27-
<li><a href="{{technology.admin_manual}}" ng-i18next="avCommon.foot.adminManual"></a></li>
31+
<li ng-if="!!technology.aboutus"><a href="{{technology.aboutus}}" ng-i18next="avCommon.foot.aboutus"></a></li>
32+
<li ng-if="!!technology.pricing"><a href="{{technology.pricing}}" ng-i18next="avCommon.foot.pricing"></a></li>
33+
<li ng-if="!!technology.overview"><a href="{{technology.overview}}" ng-i18next="avCommon.foot.technology"></a></li>
34+
<li ng-if="!!technology.solutions"><a href="{{technology.solutions}}" ng-i18next="avCommon.foot.solutions"></a></li>
35+
<li ng-if="!!technology.admin_manual"><a href="{{technology.admin_manual}}" ng-i18next="avCommon.foot.adminManual"></a></li>
2836
</ul>
2937
</div>
3038

31-
<div class="col-md-2">
39+
<div
40+
class="col-md-2"
41+
ng-if="!!legal.terms_of_service||!!legal.cookies||!!legal.privacy||!!legal.security_contact||!!legal.community_website"
42+
>
3243
<h3 ng-i18next="avCommon.foot.legal"></h3>
3344
<ul>
34-
<li>
45+
<li ng-if="!!legal.terms_of_service">
3546
<a
3647
href="{{legal.terms_of_service}}"
3748
ng-i18next="avCommon.foot.tos">
3849
</a>
3950
</li>
40-
<li>
51+
<li ng-if="!!legal.cookies">
4152
<a
4253
href="{{legal.cookies}}"
4354
ng-i18next="avCommon.foot.cookies">
4455
</a>
4556
</li>
46-
<li>
57+
<li ng-if="!!legal.privacy">
4758
<a
4859
href="{{legal.privacy}}"
4960
ng-i18next="avCommon.foot.privacy">
5061
</a>
5162
</li>
52-
<li>
63+
<li ng-if="!!legal.security_contact">
5364
<a
5465
href="{{legal.security_contact}}"
5566
ng-i18next="avCommon.foot.securitycontact">
5667
</a>
5768
</li>
58-
<li>
69+
<li ng-if="!!legal.community_website">
5970
<a
6071
target="_blank"
6172
href="{{legal.community_website}}"

0 commit comments

Comments
 (0)