Commit 9f39988d authored by Stephane Glondu's avatar Stephane Glondu

Add a placeholder for warnings/announcements

parent 8dab7cde
Pipeline #46836 passed with stages
in 12 minutes and 2 seconds
......@@ -50,6 +50,7 @@
<default-group file="demo/groups/default.json"/>
<log file="_RUNDIR_/log/security.log"/>
<spool dir="_RUNDIR_/spool"/>
<warning file="demo/warning.html"/>
</eliom>
</host>
......
<div style="background: yellow;">This is the development version!</div>
......@@ -33,6 +33,7 @@ let server_mail = ref "noreply@example.org"
let return_path = ref None
let contact_uri = ref None
let gdpr_uri = ref ""
let warning_file = ref None
module LwtRandom = struct
......
......@@ -29,6 +29,7 @@ val server_mail : string ref
val return_path : string option ref
val contact_uri : string option ref
val gdpr_uri : string ref
val warning_file : string option ref
module LwtRandom : RANDOM with type 'a t = 'a Lwt.t
(** Lwt-compatible random number generation. *)
......
......@@ -78,6 +78,8 @@ let () =
set "return-path" (fun x -> return_path := Some x);
| Element ("spool", ["dir", dir], []) ->
spool_dir := Some dir
| Element ("warning", ["file", file], []) ->
warning_file := Some file
| Element ("rewrite-prefix", ["src", src; "dst", dst], []) ->
set_rewrite_prefix ~src ~dst
| Element ("auth", ["name", auth_instance],
......
......@@ -131,6 +131,12 @@ let base ~title ?login_box ~content ?(footer = div []) ?uuid () =
]
| Some x -> x
in
let%lwt warning = match !warning_file with
| None -> return @@ pcdata ""
| Some f -> match%lwt read_file f with
| None -> return @@ pcdata ""
| Some x -> return @@ Unsafe.data (String.concat "\n" x)
in
Lwt.return (html ~a:[a_dir `Ltr; a_xml_lang L.lang]
(head (Eliom_content.Html.F.title (pcdata title)) [
script (pcdata "window.onbeforeunload = function () {};");
......@@ -151,6 +157,7 @@ let base ~title ?login_box ~content ?(footer = div []) ?uuid () =
div ~a:[a_style "clear: both;"] [];
];
];
warning;
div ~a:[a_id "main"] content;
div ~a:[a_id "footer"; a_style "text-align: center;" ] [
div ~a:[a_id "bottom"] [
......
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