[OCaml] High Intensity Training Online
fix render the import note as a paragraph above the table
A table <caption> under the mobile block layout collapsed to a narrow box and wrapped one word per line. Render the note as a plain paragraph before the table instead, so it lays out on one line and wraps naturally.
Changed files
lib/presenter/pages_logbook.ml
@@ -301,11 +301,10 @@
301
301
(fun (e : View_model.Logbook_entry.t) -> e.imported)
302
302
records
303
303
in
304
Removed:
tag "table"
305
Removed:
[ class_ "logbook-table" ]
304
Added:
tag "div" []
306
305
((if has_imports then
307
306
[
308
Removed:
tag "caption"
307
Added:
tag "p"
309
308
[ class_ "logbook-caption" ]
310
309
[
311
310
tag "em" [] [ txt "Italic" ]; txt " titles were imported.";
@@ -313,56 +312,62 @@
313
312
]
314
313
else [])
315
314
@ [
316
Removed:
tag "thead" []
315
Added:
tag "table"
316
Added:
[ class_ "logbook-table" ]
317
317
[
318
Removed:
tag "tr" []
318
Added:
tag "thead" []
319
319
[
320
Removed:
tag "th"
321
Removed:
[ Dream_html.string_attr "scope" "col" ]
322
Removed:
[ txt "Date" ];
323
Removed:
tag "th"
324
Removed:
[ Dream_html.string_attr "scope" "col" ]
325
Removed:
[ txt "Workout" ];
326
Removed:
tag "th"
327
Removed:
[ Dream_html.string_attr "scope" "col" ]
328
Removed:
[ txt "Duration" ];
329
Removed:
tag "th"
330
Removed:
([ class_ "logbook-actions-heading" ]
331
Removed:
@ [ Dream_html.string_attr "scope" "col" ])
332
Removed:
[ tag "span" [ class_ "sr-only" ] [ txt "Actions" ] ];
320
Added:
tag "tr" []
321
Added:
[
322
Added:
tag "th"
323
Added:
[ Dream_html.string_attr "scope" "col" ]
324
Added:
[ txt "Date" ];
325
Added:
tag "th"
326
Added:
[ Dream_html.string_attr "scope" "col" ]
327
Added:
[ txt "Workout" ];
328
Added:
tag "th"
329
Added:
[ Dream_html.string_attr "scope" "col" ]
330
Added:
[ txt "Duration" ];
331
Added:
tag "th"
332
Added:
([ class_ "logbook-actions-heading" ]
333
Added:
@ [ Dream_html.string_attr "scope" "col" ])
334
Added:
[
335
Added:
tag "span" [ class_ "sr-only" ] [ txt "Actions" ];
336
Added:
];
337
Added:
];
333
338
];
334
Removed:
];
335
Removed:
tag "tbody" []
336
Removed:
(List.map
337
Removed:
(fun (entry : View_model.Logbook_entry.t) ->
338
Removed:
(* An imported workout's name is set in italics; the caption
339
Added:
tag "tbody" []
340
Added:
(List.map
341
Added:
(fun (entry : View_model.Logbook_entry.t) ->
342
Added:
(* An imported workout's name is set in italics; the caption
339
343
explains that. The three-dot menu carries the colour-coded
340
344
per-exercise progress, plus Edit/Delete for a native
341
345
record. *)
342
Removed:
let name_cell =
343
Removed:
if entry.imported then
344
Removed:
tag "td" []
346
Added:
let name_cell =
347
Added:
if entry.imported then
348
Added:
tag "td" []
349
Added:
[
350
Added:
tag "em"
351
Added:
[ class_ "logbook-imported-title" ]
352
Added:
[ txt "%s" entry.workout_name ];
353
Added:
]
354
Added:
else tag "td" [] [ txt "%s" entry.workout_name ]
355
Added:
in
356
Added:
let menu =
357
Added:
if entry.imported then imported_menu entry
358
Added:
else native_menu request entry
359
Added:
in
360
Added:
tag "tr" []
345
361
[
346
Removed:
tag "em"
347
Removed:
[ class_ "logbook-imported-title" ]
348
Removed:
[ txt "%s" entry.workout_name ];
349
Removed:
]
350
Removed:
else tag "td" [] [ txt "%s" entry.workout_name ]
351
Removed:
in
352
Removed:
let menu =
353
Removed:
if entry.imported then imported_menu entry
354
Removed:
else native_menu request entry
355
Removed:
in
356
Removed:
tag "tr" []
357
Removed:
[
358
Removed:
tag "td" [] [ txt "%s" entry.date ];
359
Removed:
name_cell;
360
Removed:
tag "td"
361
Removed:
[ class_ "logbook-duration" ]
362
Removed:
[ txt "%s" entry.duration ];
363
Removed:
tag "td" [ class_ "logbook-actions" ] [ menu ];
364
Removed:
])
365
Removed:
records);
362
Added:
tag "td" [] [ txt "%s" entry.date ];
363
Added:
name_cell;
364
Added:
tag "td"
365
Added:
[ class_ "logbook-duration" ]
366
Added:
[ txt "%s" entry.duration ];
367
Added:
tag "td" [ class_ "logbook-actions" ] [ menu ];
368
Added:
])
369
Added:
records);
370
Added:
];
366
371
]));
367
372
tag "section"
368
373
[ class_ "feedback-section" ]
lib/web/assets/hito.css
@@ -692,11 +692,9 @@
692
692
font-style: italic;
693
693
}
694
694
.logbook-caption {
695
Removed:
caption-side: top;
696
Removed:
margin-bottom: 0.5rem;
695
Added:
margin: 0 0 0.75rem;
697
696
color: var(--muted-ink);
698
697
font-size: var(--font-size-small);
699
Removed:
text-align: left;
700
698
}
701
699
702
700
.confirm-dialog button.danger {