diff options
author | khai96_ <hvksmr1996@gmail.com> | 2019-04-26 06:04:16 +0000 |
---|---|---|
committer | khai96_ <hvksmr1996@gmail.com> | 2019-04-26 06:04:16 +0000 |
commit | 838d86655fb39b5cdf63b2d3823ce047e63afaf4 (patch) | |
tree | cf5306f1050108f872d6d7d020606f5dc5c90206 /src/renderer.rs | |
parent | Use rstest_parametrize for unit tests (diff) | |
parent | Use rstest test fixtures to cut down on code duplication in integration tests (diff) | |
download | miniserve-838d86655fb39b5cdf63b2d3823ce047e63afaf4.tar.gz miniserve-838d86655fb39b5cdf63b2d3823ce047e63afaf4.zip |
Merge remote-tracking branch 'mainrepo/master' into pullrequest.hashed-password
Diffstat (limited to 'src/renderer.rs')
-rw-r--r-- | src/renderer.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index c1dcdb2..b292e70 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -47,7 +47,7 @@ pub fn page( form id="file_submit" action={(upload_route) "?path=" (current_dir)} method="POST" enctype="multipart/form-data" { p { "Select a file to upload or drag it anywhere into the window" } div { - input#file-input type="file" name="file_to_upload" {} + input#file-input type="file" name="file_to_upload" required="" {} button type="submit" { "Upload file" } } } @@ -760,11 +760,10 @@ fn humanize_systemtime(src_time: Option<SystemTime>) -> Option<String> { .map(|duration| HumanTime::from(duration).to_text_en(Accuracy::Rough, Tense::Past)) } -/// Renders error page when file uploading fails -pub fn file_upload_error(error_description: &str, return_address: &str) -> Markup { +/// Renders an error on the webpage +pub fn render_error(error_description: &str, return_address: &str) -> Markup { html! { - h1 { "File uploading failed" } - p { (error_description) } + pre { (error_description) } a href=(return_address) { "Go back to file listing" } |