Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
belenios
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
belenios
belenios
Commits
b25cce17
Commit
b25cce17
authored
May 16, 2018
by
Stephane Glondu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change logic in setting contact info
We consider the contact empty if it is set to the default value.
parent
5df632f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
src/web/web_common.ml
src/web/web_common.ml
+2
-0
src/web/web_common.mli
src/web/web_common.mli
+2
-0
src/web/web_site.ml
src/web/web_site.ml
+6
-2
src/web/web_templates.ml
src/web/web_templates.ml
+1
-1
No files found.
src/web/web_common.ml
View file @
b25cce17
...
...
@@ -258,3 +258,5 @@ let write_file ?uuid x lines =
Lwt_list
.
iter_s
(
write_line
oc
)
lines
)
)
let
default_contact
=
"Name <user@example.org>"
src/web/web_common.mli
View file @
b25cce17
...
...
@@ -105,3 +105,5 @@ val is_email : string -> bool
val
read_file
:
?
uuid
:
uuid
->
string
->
string
list
option
Lwt
.
t
val
write_file
:
?
uuid
:
uuid
->
string
->
string
list
->
unit
Lwt
.
t
val
default_contact
:
string
src/web/web_site.ml
View file @
b25cce17
...
...
@@ -384,7 +384,7 @@ let create_new_election owner cred auth =
e_cred_authority
;
e_trustees
=
None
;
e_languages
=
Some
[
"en"
;
"fr"
];
e_contact
=
Some
"Name <user@example.org>"
;
e_contact
=
None
;
}
in
let
question
=
{
q_answers
=
[
|
"Answer 1"
;
"Answer 2"
;
"Answer 3"
|
];
...
...
@@ -531,7 +531,11 @@ let () =
Any
.
register
~
service
:
election_setup_contact
(
fun
uuid
contact
->
with_setup_election
uuid
(
fun
se
->
let
contact
=
if
contact
=
""
then
None
else
Some
contact
in
let
contact
=
if
contact
=
""
||
contact
=
default_contact
then
None
else
Some
contact
in
se
.
se_metadata
<-
{
se
.
se_metadata
with
e_contact
=
contact
...
...
src/web/web_templates.ml
View file @
b25cce17
...
...
@@ -404,7 +404,7 @@ let election_setup uuid se () =
let
value
=
match
se
.
se_metadata
.
e_contact
with
|
Some
x
->
x
|
None
->
""
|
None
->
default_contact
in
string_input
~
name
:
contact
~
input_type
:
`Text
~
value
()
;
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment