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("