[OCaml] High Intensity Training Online
1
type page = Dream_html.node
2
3
val login :
4
Dream.request -> ?error:string -> ?registration_open:bool -> unit -> page
5
(** [registration_open] shows the "Register" link. Defaults to [false]. *)
6
7
val register : Dream.request -> ?error:string -> unit -> page
8
9
val choose_routine :
10
Dream.request ->
11
workout_started:int option ->
12
viewer:View_model.Viewer.t ->
13
routines:View_model.Routine_choice.t list ->
14
page
15
16
val home :
17
Dream.request -> viewer:View_model.Viewer.t -> home:View_model.Home.t -> page
18
19
val workout_in_progress :
20
Dream.request ->
21
viewer:View_model.Viewer.t ->
22
workout_started:int ->
23
workout_name:string ->
24
page
25
(** The Home card shown while a workout is in progress. Links to the current
26
workout so it stays one tap away. [workout_started] drives the nav timer. *)
27
28
val routine :
29
Dream.request ->
30
?workout_started:int ->
31
viewer:View_model.Viewer.t ->
32
View_model.Routine.t ->
33
page
34
35
val workout :
36
Dream.request ->
37
viewer:View_model.Viewer.t ->
38
?workout_started:int ->
39
record_id:string option ->
40
active_slot:int ->
41
View_model.Workout.t ->
42
page
43
(** Renders every prescribed slot as an accordion — one native [details] per
44
slot, sharing a [name] so the browser keeps exactly one open — with the
45
active slot open. Authenticated pages carry generic progressive-enhancement
46
markers. Current workouts additionally mark slot links and forms, while
47
saved-record edits use the generic authenticated form path. [active_slot] is
48
the slot that opens. A handler clamps a requested slot and falls back to the
49
first outstanding slot. [record_id] is [None] for the workout in progress
50
and [Some id] for a saved history record. [workout_started] drives the nav
51
timer: a live workout uses its own start, so it is ignored there; a
52
saved-record view passes the epoch of a separate workout in progress, if
53
any. A refused record or correction is reported through the flash message on
54
the post-redirect-get reload, not inline. *)
55
56
val feedback_factors : (string * string) list
57
(** Ordered factor codes and labels. Each is a radio group in the feedback form
58
and a series in the feedback graph. *)
59
60
val logbook :
61
Dream.request ->
62
?workout_started:int ->
63
viewer:View_model.Viewer.t ->
64
?calendar:View_model.Calendar.t ->
65
?selected_date:View_model.Selected_date.t ->
66
?suggest_feedback:bool ->
67
?feedback_open:bool ->
68
?delete_record:View_model.Recorded_workout.t ->
69
?tab:string ->
70
?progress_charts:View_model.Progress_page.chart list ->
71
unit ->
72
page
73
(** The logbook: the Calendar and Progress views under one endpoint. The [tab]
74
parameter selects the active view. The [progress_charts] parameter supplies
75
chart data for the Progress view. *)
76
77
val profile :
78
Dream.request ->
79
?workout_started:int ->
80
viewer:View_model.Viewer.t ->
81
import_open:bool ->
82
?username_error:string ->
83
?password_error:string ->
84
?notice:string ->
85
unit ->
86
page
87
(** The account profile page: rename the account and change the password, each
88
an independent form. [username_error] and [password_error] report a refused
89
change inline. [notice] confirms a successful one. *)
90
91
val settings :
92
Dream.request ->
93
?workout_started:int ->
94
viewer:View_model.Viewer.t ->
95
theme:string ->
96
unit ->
97
page
98
(** The session-scoped theme settings page. *)
99
100
val import_review :
101
Dream.request ->
102
viewer:View_model.Viewer.t ->
103
View_model.Import_review.t ->
104
page
105
(** The review of a provisional Hevy import batch. Lists the rows dropped on
106
parse, then each workout with its sets, blockers, and acknowledgement state.
107
Renders a mapping form per distinct source name, a normal-set confirmation
108
form, a per-workout promote form, and a batch promote form. Basic accessible
109
HTML: it names no core entity, only the view model. *)
110
111
val problem : title:string -> detail:string -> page
112
113
val error_page :
114
?viewer:View_model.Viewer.t ->
115
?request:Dream.request ->
116
status:int ->
117
unit ->
118
page
119
(** A branded page for an HTTP failure. It names only the class of failure, so
120
no server-supplied string leaks, and keeps the navigation affordances: top
121
on desktop, bottom on mobile. *)
122
123
val app_feedback :
124
Dream.request ->
125
?workout_started:int ->
126
viewer:View_model.Viewer.t ->
127
?tab:[ `Write | `Submitted ] ->
128
?error:string ->
129
View_model.App_feedback.t list ->
130
page
131
(** The authenticated application feedback page. One tab accepts a freeform
132
message. The other lists the trainee's submitted messages. *)
133