Commit a22d1533 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Drop WEB_ELECTION_RO

parent 5c63d973
...@@ -475,15 +475,11 @@ module type WEB_PARAMS = sig ...@@ -475,15 +475,11 @@ module type WEB_PARAMS = sig
val dir : string val dir : string
end end
module type WEB_ELECTION_RO = sig module type WEB_ELECTION = sig
include ELECTION_DATA include ELECTION_DATA
include WEB_PARAMS include WEB_PARAMS
module E : ELECTION with type elt = G.t module E : ELECTION with type elt = G.t
module S : ELECTION_SERVICES module S : ELECTION_SERVICES
end
module type WEB_ELECTION = sig
include WEB_ELECTION_RO
module B : WEB_BALLOT_BOX module B : WEB_BALLOT_BOX
module H : AUTH_HANDLERS_PUBLIC module H : AUTH_HANDLERS_PUBLIC
end end
...@@ -560,11 +556,11 @@ end ...@@ -560,11 +556,11 @@ end
module type TEMPLATES = sig module type TEMPLATES = sig
val home : val home :
featured:(module WEB_ELECTION_RO) list -> featured:(module WEB_ELECTION) list ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val admin : val admin :
elections:(module WEB_ELECTION_RO) list -> elections:(module WEB_ELECTION) list ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val new_election : val new_election :
...@@ -593,7 +589,7 @@ module type TEMPLATES = sig ...@@ -593,7 +589,7 @@ module type TEMPLATES = sig
[> `Html ] Eliom_content.Html5.F.elt Lwt.t [> `Html ] Eliom_content.Html5.F.elt Lwt.t
module Login (S : AUTH_SERVICES) : LOGIN_TEMPLATES module Login (S : AUTH_SERVICES) : LOGIN_TEMPLATES
module Election (W : WEB_ELECTION_RO) : ELECTION_TEMPLATES module Election (W : WEB_ELECTION) : ELECTION_TEMPLATES
end end
......
...@@ -417,10 +417,7 @@ module Make (C : CONFIG) : SITE = struct ...@@ -417,10 +417,7 @@ module Make (C : CONFIG) : SITE = struct
| None -> | None ->
lwt featured = lwt featured =
Ocsipersist.get featured >>= Ocsipersist.get featured >>=
Lwt_list.map_p (fun x -> Lwt_list.map_p (fun x -> return @@ SMap.find x !election_table)
let module W = (val SMap.find x !election_table : WEB_ELECTION) in
return (module W : WEB_ELECTION_RO)
)
in in
T.home ~featured () >>= Html5.send T.home ~featured () >>= Html5.send
| Some x -> | Some x ->
...@@ -439,7 +436,7 @@ module Make (C : CONFIG) : SITE = struct ...@@ -439,7 +436,7 @@ module Make (C : CONFIG) : SITE = struct
SMap.fold (fun _ w accu -> SMap.fold (fun _ w accu ->
let module W = (val w : WEB_ELECTION) in let module W = (val w : WEB_ELECTION) in
if W.metadata.e_owner = Some u then ( if W.metadata.e_owner = Some u then (
(module W : WEB_ELECTION_RO) :: accu w :: accu
) else ( ) else (
accu accu
) )
......
...@@ -103,7 +103,7 @@ module Make (S : SITE_SERVICES) : TEMPLATES = struct ...@@ -103,7 +103,7 @@ module Make (S : SITE_SERVICES) : TEMPLATES = struct
])) ]))
let format_election kind election = let format_election kind election =
let module W = (val election : WEB_ELECTION_RO) in let module W = (val election : WEB_ELECTION) in
let e = W.election.e_params in let e = W.election.e_params in
let service = let service =
match kind with match kind with
...@@ -495,7 +495,7 @@ module Make (S : SITE_SERVICES) : TEMPLATES = struct ...@@ -495,7 +495,7 @@ module Make (S : SITE_SERVICES) : TEMPLATES = struct
let login_box = pcdata "" in let login_box = pcdata "" in
base ~title ~login_box ~content base ~title ~login_box ~content
module Election (W : WEB_ELECTION_RO) = struct module Election (W : WEB_ELECTION) = struct
let election_login_box = let election_login_box =
let auth = (module W.S : AUTH_SERVICES) in let auth = (module W.S : AUTH_SERVICES) in
......
Supports Markdown
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