Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
9807c176
Commit
9807c176
authored
Mar 19, 2015
by
Stephane Glondu
Browse files
Fix indentation in Web_templates
parent
21ce63f9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/web/web_templates.ml
View file @
9807c176
...
...
@@ -75,7 +75,7 @@ let make_login_box style auth links =
)
let
site_login_box
=
let
site_login_box
=
let
auth
=
(
module
Web_site_auth
:
AUTH_SERVICES
)
in
let
module
L
=
struct
let
login
x
=
Eliom_service
.
preapply
site_login
x
...
...
@@ -84,7 +84,7 @@ let make_login_box style auth links =
let
links
=
(
module
L
:
AUTH_LINKS
)
in
fun
()
->
make_login_box
admin_background
auth
links
let
base
~
title
~
login_box
~
content
?
(
footer
=
div
[]
)
()
=
let
base
~
title
~
login_box
~
content
?
(
footer
=
div
[]
)
()
=
Lwt
.
return
(
html
~
a
:
[
a_dir
`Ltr
;
a_xml_lang
"en"
]
(
head
(
Eliom_content
.
Html5
.
F
.
title
(
pcdata
title
))
[
script
(
pcdata
"window.onbeforeunload = function () {};"
);
...
...
@@ -115,7 +115,7 @@ let make_login_box style auth links =
]]
]))
let
format_election
kind
election
=
let
format_election
kind
election
=
let
module
W
=
(
val
election
:
WEB_ELECTION
)
in
let
e
=
W
.
election
.
e_params
in
let
service
=
...
...
@@ -130,7 +130,7 @@ let make_login_box style auth links =
p
[
pcdata
e
.
e_description
];
]
let
home
~
featured
()
=
let
home
~
featured
()
=
let
featured_box
=
match
featured
with
|
_
::_
->
div
[
...
...
@@ -151,7 +151,7 @@ let make_login_box style auth links =
let
login_box
=
pcdata
""
in
base
~
title
:
site_title
~
login_box
~
content
()
let
admin
~
elections
()
=
let
admin
~
elections
()
=
let
title
=
site_title
^
" — Administration"
in
let
elections
=
match
elections
with
...
...
@@ -169,7 +169,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
module
Login
(
S
:
AUTH_SERVICES
)
(
L
:
AUTH_LINKS
)
:
LOGIN_TEMPLATES
=
struct
module
Login
(
S
:
AUTH_SERVICES
)
(
L
:
AUTH_LINKS
)
:
LOGIN_TEMPLATES
=
struct
let
login_box
=
let
auth
=
(
module
S
:
AUTH_SERVICES
)
in
...
...
@@ -262,18 +262,18 @@ let make_login_box style auth links =
lwt
login_box
=
login_box
()
in
base
~
title
:
"Log in"
~
login_box
~
content
()
end
end
let
format_date
=
Platform
.
format_datetime
"%a, %d %b %Y %T %z"
let
format_date
=
Platform
.
format_datetime
"%a, %d %b %Y %T %z"
let
make_button
~
service
contents
=
let
make_button
~
service
contents
=
let
uri
=
Eliom_uri
.
make_string_uri
~
service
()
in
Printf
.
ksprintf
Unsafe
.
data
(* FIXME: unsafe *)
"<button onclick=
\"
location.href='%s';
\"
style=
\"
font-size:35px;
\"
>%s</button>"
uri
contents
let
new_election
()
=
let
new_election
()
=
let
title
=
"Create new election"
in
lwt
body
=
let
form
=
post_form
~
service
:
new_election_post
...
...
@@ -321,7 +321,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
new_election_failure
reason
()
=
let
new_election_failure
reason
()
=
let
title
=
"Create new election"
in
let
reason
=
match
reason
with
...
...
@@ -337,7 +337,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
election_setup_index
uuids
()
=
let
election_setup_index
uuids
()
=
let
service
=
election_setup
in
let
title
=
"Elections being prepared"
in
let
uuids
=
...
...
@@ -356,7 +356,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
generic_error_page
message
()
=
let
generic_error_page
message
()
=
let
title
=
"Error"
in
let
content
=
[
p
[
pcdata
message
];
...
...
@@ -364,7 +364,7 @@ let make_login_box style auth links =
let
login_box
=
pcdata
""
in
base
~
title
~
login_box
~
content
()
let
election_setup
uuid
se
()
=
let
election_setup
uuid
se
()
=
let
title
=
"Preparation of election "
^
Uuidm
.
to_string
uuid
in
let
make_form
?
a
service
value
title
=
post_form
?
a
~
service
...
...
@@ -441,7 +441,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
election_setup_questions
uuid
se
()
=
let
election_setup_questions
uuid
se
()
=
let
title
=
"Questions for election "
^
Uuidm
.
to_string
uuid
in
let
form
=
let
value
=
string_of_template
se
.
se_questions
in
...
...
@@ -477,7 +477,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
election_setup_credentials
token
uuid
se
()
=
let
election_setup_credentials
token
uuid
se
()
=
let
title
=
"Credentials for election "
^
uuid
in
let
form_textarea
=
post_form
...
...
@@ -544,7 +544,7 @@ let make_login_box style auth links =
let
login_box
=
pcdata
""
in
base
~
title
~
login_box
~
content
()
let
election_setup_trustee
token
uuid
se
()
=
let
election_setup_trustee
token
uuid
se
()
=
let
title
=
"Trustee for election "
^
uuid
in
let
form
=
let
value
=
!
(
List
.
assoc
token
se
.
se_public_keys
)
in
...
...
@@ -591,7 +591,7 @@ let make_login_box style auth links =
base
~
title
~
login_box
~
content
()
let
election_login_box
w
=
let
election_login_box
w
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
let
auth
=
(
module
W
.
S
:
AUTH_SERVICES
)
in
let
module
L
=
struct
...
...
@@ -607,13 +607,13 @@ let make_login_box style auth links =
let
links
=
(
module
L
:
AUTH_LINKS
)
in
fun
()
->
make_login_box
""
auth
links
let
file
w
x
=
let
file
w
x
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
Eliom_service
.
preapply
election_dir
(
W
.
election
.
e_params
.
e_uuid
,
x
)
let
election_home
w
state
()
=
let
election_home
w
state
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
lwt
user
=
W
.
S
.
get_user
()
in
let
params
=
W
.
election
.
e_params
and
m
=
W
.
metadata
in
...
...
@@ -738,7 +738,7 @@ let make_login_box style auth links =
lwt
login_box
=
election_login_box
w
()
in
base
~
title
:
params
.
e_name
~
login_box
~
content
~
footer
()
let
election_admin
w
~
is_featured
state
()
=
let
election_admin
w
~
is_featured
state
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
let
title
=
W
.
election
.
e_params
.
e_name
^
" — Administration"
in
let
feature_form
=
post_form
~
service
:
election_set_featured
...
...
@@ -776,7 +776,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
~
login_box
~
content
()
let
update_credential
w
()
=
let
update_credential
w
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
let
params
=
W
.
election
.
e_params
in
let
form
=
post_form
~
service
:
election_update_credential_post
...
...
@@ -817,7 +817,7 @@ let make_login_box style auth links =
lwt
login_box
=
site_login_box
()
in
base
~
title
:
params
.
e_name
~
login_box
~
content
()
let
cast_raw
w
()
=
let
cast_raw
w
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
let
params
=
W
.
election
.
e_params
in
let
form_rawballot
=
post_form
~
service
:
election_cast_post
...
...
@@ -850,7 +850,7 @@ let make_login_box style auth links =
lwt
login_box
=
election_login_box
w
()
in
base
~
title
:
params
.
e_name
~
login_box
~
content
()
let
cast_confirmation
w
~
can_vote
hash
()
=
let
cast_confirmation
w
~
can_vote
hash
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
lwt
user
=
W
.
S
.
get_user
()
in
let
params
=
W
.
election
.
e_params
in
...
...
@@ -912,7 +912,7 @@ let make_login_box style auth links =
lwt
login_box
=
election_login_box
w
()
in
base
~
title
:
name
~
login_box
~
content
()
let
cast_confirmed
w
~
result
()
=
let
cast_confirmed
w
~
result
()
=
let
module
W
=
(
val
w
:
WEB_ELECTION_
)
in
let
params
=
W
.
election
.
e_params
in
let
name
=
params
.
e_name
in
...
...
Write
Preview
Supports
Markdown
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