Commit db9fb44c authored by Stephane Glondu's avatar Stephane Glondu

List available languages in setup page

parent ded21ff2
......@@ -228,11 +228,11 @@ let split_identity x =
with Not_found ->
x, x
let langs = ["en"; "fr"; "de"]
let available_languages = ["en"; "fr"; "de"]
let get_languages xs =
match xs with
| None -> langs
| None -> available_languages
| Some xs -> xs
let string_of_languages xs =
......
......@@ -104,6 +104,7 @@ val send_email : string -> string -> string -> unit Lwt.t
val split_identity : string -> string * string
val available_languages : string list
val get_languages : string list option -> string list
val string_of_languages : string list option -> string
val languages_of_string : string -> string list option
......@@ -368,6 +368,9 @@ let election_setup uuid se () =
pcdata "Languages: ";
string_input ~name:languages ~input_type:`Text
~value:(string_of_languages se.se_metadata.e_languages) ();
pcdata " (Available languages: ";
pcdata (string_of_languages (Some available_languages));
pcdata ")";
];
div [
pcdata "(This is a space-separated list of languages that will be used in emails sent by the server.)";
......@@ -1213,7 +1216,7 @@ let election_home w state () =
div ~a:[a_class ["languages"]]
(list_concat (pcdata " ") @@ List.map (fun lang ->
a ~service:set_language [pcdata lang] lang
) (get_languages None))
) available_languages)
in
let%lwt scd = Eliom_reference.get Web_state.show_cookie_disclaimer in
let cookie_disclaimer =
......
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