diff --git a/filed/src/web/pages.rs b/filed/src/web/pages.rs index c9d0453..eb5037c 100644 --- a/filed/src/web/pages.rs +++ b/filed/src/web/pages.rs @@ -68,6 +68,17 @@ pub struct TOSPage { pub env: Env } + +#[derive(Template)] +#[template( path = "error.html" )] +#[allow(dead_code)] +pub struct ErrorPage { + pub env: Env, + pub error_text: String, + pub link: Option, + pub link_text: Option +} + pub async fn uploaded(query: HashMap, state: SharedState) -> Result, Rejection> { if ! query.contains_key("file") { diff --git a/filed/templates/error.html b/filed/templates/error.html new file mode 100644 index 0000000..93a5880 --- /dev/null +++ b/filed/templates/error.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} + +{% block body %} + +
+

Error

+ +

+ + + +

+

{{ error_text }}

+ {% match link %} + {% when Some with (lnk) %} + + {% match link_text %} + {% when Some with (text) %} + {{ text }} + {% when None %} + Go to {{ lnk }} + {% endmatch %} + + {% when None -%} + {% endmatch %} +
+ +{% endblock %} \ No newline at end of file