View raw

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 logging:bool -> 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 -> viewer:View_model.Viewer.t -> workout_name:string -> page 21 (** The Home card shown while a workout is in progress. Links to the current 22 workout so it stays one tap away. *) 23 24 val routine : 25 Dream.request -> 26 ?logging:bool -> 27 viewer:View_model.Viewer.t -> 28 View_model.Routine.t -> 29 page 30 31 val workout : 32 Dream.request -> 33 viewer:View_model.Viewer.t -> 34 ?errors:(string * string) list -> 35 ?editing:int -> 36 ?logging:bool -> 37 record_id:string option -> 38 active_slot:int -> 39 View_model.Workout.t -> 40 page 41 (** Renders one prescribed slot at a time under a dropdown that selects the 42 exercise. Authenticated pages carry generic progressive-enhancement markers. 43 Current workouts additionally mark slot links and forms, while saved-record 44 edits use the generic authenticated form path. [active_slot] is the slot the 45 view opens on. A handler clamps a requested slot and falls back to the first 46 outstanding slot. [record_id] is [None] for the workout in progress and 47 [Some id] for a saved history record. [logging] sets the middle navigation 48 action. It defaults to a live workout view (true when [record_id] is 49 [None]). *) 50 51 type feedback_flow = { step : int; answers : (string * string) list } 52 53 val feedback_factors : (string * string) list 54 (** Ordered factor codes and labels used by the sequential feedback flow. *) 55 56 val logbook : 57 Dream.request -> 58 ?logging:bool -> 59 viewer:View_model.Viewer.t -> 60 ?feedback:View_model.Feedback.report list -> 61 ?suggest_feedback:bool -> 62 ?feedback_flow:feedback_flow -> 63 ?feedback_open:bool -> 64 View_model.Logbook_entry.t list -> 65 page 66 (** The logbook: recorded workouts and a modal sequential subjective feedback 67 flow. [feedback] lists past reports, most recent first. [suggest_feedback] 68 shows a prompt inviting feedback, set after a workout finishes. *) 69 70 val profile : 71 Dream.request -> 72 ?logging:bool -> 73 viewer:View_model.Viewer.t -> 74 ?username_error:string -> 75 ?password_error:string -> 76 ?notice:string -> 77 unit -> 78 page 79 (** The account profile page: rename the account and change the password, each 80 an independent form. [username_error] and [password_error] report a refused 81 change inline. [notice] confirms a successful one. *) 82 83 val settings : 84 Dream.request -> 85 ?logging:bool -> 86 viewer:View_model.Viewer.t -> 87 theme:string -> 88 unit -> 89 page 90 (** The session-scoped theme settings page. *) 91 92 val import_review : 93 Dream.request -> 94 viewer:View_model.Viewer.t -> 95 View_model.Import_review.t -> 96 page 97 (** The review of a provisional Hevy import batch. Lists the rows dropped on 98 parse, then each workout with its sets, blockers, and acknowledgement state. 99 Renders a mapping form per distinct source name, a normal-set confirmation 100 form, a per-workout promote form, and a batch promote form. Basic accessible 101 HTML: it names no core entity, only the view model. *) 102 103 val problem : title:string -> detail:string -> page 104 105 val error_page : 106 ?viewer:View_model.Viewer.t -> 107 ?request:Dream.request -> 108 status:int -> 109 unit -> 110 page 111 (** A branded page for an HTTP failure. It names only the class of failure, so 112 no server-supplied string leaks, and keeps the navigation affordances: top 113 on desktop, bottom on mobile. *) 114 115 val app_feedback : 116 Dream.request -> 117 ?logging:bool -> 118 viewer:View_model.Viewer.t -> 119 ?tab:[ `Write | `Submitted ] -> 120 ?error:string -> 121 View_model.App_feedback.t list -> 122 page 123 (** The authenticated application feedback page. One tab accepts a freeform 124 message. The other lists the trainee's submitted messages. *) 125