From 3e64ff48578d95000efda70ed74d72e4cd1b436a Mon Sep 17 00:00:00 2001 From: lew Date: Fri, 10 Apr 2026 02:27:55 +0100 Subject: [PATCH] feat: voice note recorder in form --- src/render.rs | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/src/render.rs b/src/render.rs index 28aacc6..55c0451 100644 --- a/src/render.rs +++ b/src/render.rs @@ -109,6 +109,70 @@ pub fn render_form(config: &Config) -> String { String::new() }; + let voice_note_section = if config.enable_voice_notes { + format!( + r##"add a voice note "##, + max_dur = config.voice_note_max_duration, + ) + } else { + String::new() + }; + format!( r#"{prompt}
@@ -118,7 +182,7 @@ pub fn render_form(config: &Config) -> String { {captcha_section} -{drawing_section} +{drawing_section}{voice_note_section}
"#, prompt = config.form_prompt, label_name = config.label_name, @@ -128,6 +192,7 @@ pub fn render_form(config: &Config) -> String { th = config.textarea_height, captcha_section = captcha_section, drawing_section = drawing_section, + voice_note_section = voice_note_section, button = config.button_text, ) } @@ -527,4 +592,22 @@ mod tests { assert!(html.contains("back")); assert!(html.contains("