about summary refs log tree commit diff
path: root/src/frontend/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/templates')
-rw-r--r--src/frontend/templates/mod.rs38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs
index c21d30b..364a716 100644
--- a/src/frontend/templates/mod.rs
+++ b/src/frontend/templates/mod.rs
@@ -1,7 +1,7 @@
 use crate::database::MicropubChannel;
 use crate::frontend::IndiewebEndpoints;
 use ellipse::Ellipse;
-use http_types::StatusCode;
+use warp::http::StatusCode;
 use log::error;
 
 /// Return a pretty location specifier from a geo: URI.
@@ -397,12 +397,12 @@ markup::define! {
         @Feed { feed }
     }
     ErrorPage(code: StatusCode, msg: Option<String>) {
-        h1 { @format!("HTTP {} {}", code, code.canonical_reason()) }
-        @match code {
-            StatusCode::Unauthorized => {
+        h1 { @format!("HTTP {}", code) }
+        @match *code {
+            StatusCode::UNAUTHORIZED => {
                 p { "Looks like you need to authenticate yourself before seeing this page. Try logging in with IndieAuth using the Login button above!" }
             }
-            StatusCode::Forbidden => {
+            StatusCode::FORBIDDEN => {
                 p { "Looks like you're forbidden from viewing this page." }
                 p {
                     "This might've been caused by being banned from viewing my website"
@@ -410,16 +410,16 @@ markup::define! {
                     "like a private post that's not intended for you. It's ok, it happens."
                 }
             }
-            StatusCode::Gone => {
+            StatusCode::GONE => {
                 p { "Looks like the page you're trying to find is gone and is never coming back." }
             }
-            StatusCode::UnavailableForLegalReasons => {
+            StatusCode::UNAVAILABLE_FOR_LEGAL_REASONS => {
             p { "The page is there, but I can't legally provide it to you because the censorship said so." }
             }
-            StatusCode::NotFound => {
+            StatusCode::NOT_FOUND => {
                 p { "Looks like there's no such page. Maybe you or someone else mistyped a URL or my database experienced data loss." }
             }
-            StatusCode::ImATeapot => {
+            StatusCode::IM_A_TEAPOT => {
                 p { "Wait, do you seriously expect my website to brew you coffee? It's not a coffee machine!" }
 
                 p {
@@ -433,16 +433,18 @@ markup::define! {
                     }
                 }
             }
-            StatusCode::BadRequest => {
-                @if msg.is_none() {
-                    p {
-                        "There was an undescribed error in your request. "
-                        "Please try again later or with a different request."
+            StatusCode::BAD_REQUEST => {
+                @match msg {
+                    None => {
+                        p {
+                            "There was an undescribed error in your request. "
+                            "Please try again later or with a different request."
+                        }
                     }
-                } else {
-                    p {
-                        "There was a following error in your request: "
-                        @msg.as_ref().unwrap()
+                    Some(msg) => {
+                        p {
+                            "There was a following error in your request: " @msg
+                        }
                     }
                 }
             }