pub fn progress_bar(id: &str, percent: i64, label: &str) -> StringExpand description
A progress bar with the element id id: a <progress> at percent
(clamped to 0-100) and a label (escaped), as HTML.
Render it in a page, then broadcast a new one with the same id to
move it: htmx’s WebSocket extension replaces the element that has the
id (ocre::realtime::broadcast; ocre g external_job --realtime does it).
Style it with the progress-bar class.
§Examples
assert_eq!(
ocre::helpers::progress_bar("upload_1", 40, "Encoding <4K>"),
"<div id=\"upload_1\" class=\"progress-bar\"><progress max=\"100\" value=\"40\">40%</progress> <span>Encoding <4K></span></div>"
);
assert!(ocre::helpers::progress_bar("x", 140, "").contains("value=\"100\""));