Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit f8fc4517 authored by Stephane Glondu's avatar Stephane Glondu

Add config option for "contact us" link on admin login page

parent 369595dc
......@@ -38,6 +38,7 @@
</site>
<eliom module="_build/src/web/server.cma">
<maxmailsatonce value="1000"/>
<!-- <contact uri="mailto:contact@example.org"/> -->
<server mail="noreply@belenios.org"/>
<auth name="demo"><dummy/></auth>
<auth name="local"><password db="demo/password_db.csv"/></auth>
......
......@@ -28,6 +28,7 @@ open Web_serializable_j
let spool_dir = ref "."
let server_mail = ref "noreply@belenios.org"
let contact_uri = ref None
module LwtRandom = struct
......
......@@ -24,6 +24,7 @@ open Web_serializable_t
val spool_dir : string ref
val server_mail : string ref
val contact_uri : string option ref
module LwtRandom : RANDOM with type 'a t = 'a Lwt.t
(** Lwt-compatible random number generation. *)
......
......@@ -49,6 +49,8 @@ let () =
source_file := Some file
| Element ("maxmailsatonce", ["value", limit], []) ->
Web_site.maxmailsatonce := int_of_string limit
| Element ("contact", ["uri", uri], []) ->
Web_common.contact_uri := Some uri
| Element ("server", ["mail", mail], []) ->
if is_email mail then
server_mail := mail
......
......@@ -166,16 +166,28 @@ let format_election election =
a ~service [pcdata e.e_name] (e.e_uuid, ());
]
let unsafe_a uri text =
Printf.ksprintf Unsafe.data "<a href=\"%s\">%s</a>" uri text
let admin ~elections () =
let title = site_title ^ " — Administration" in
match elections with
| None ->
let contact = match !contact_uri with
| None -> pcdata ""
| Some uri ->
div [
pcdata "If you do not have any account, you may ";
unsafe_a uri "contact us";
pcdata ".";
]
in
let content = [
div [
pcdata "To administer an election, you need to ";
a ~service:site_login [pcdata "log in"] None;
pcdata ". If you do not have an account, ";
pcdata "please send an email to contact@belenios.org.";
pcdata "To administer an election, you need to log in using one";
pcdata " of the authentication methods available in the upper";
pcdata " right corner of this page.";
contact;
]
] in
let%lwt login_box = site_login_box () in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment