about summary refs log tree commit diff
path: root/src/handlers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index c31cdf679bb7..3af8a8c40929 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -81,6 +81,15 @@ pub fn forum_thread(state: State<AppState>, thread_id: Path<i32>) -> ConverseRes
         .responder()
 }
 
+/// This handler presents the user with the "New Thread" form.
+pub fn new_thread(state: State<AppState>) -> Result<HttpResponse> {
+    let ctx = tera::Context::new();
+    let body = state.tera.render("new-thread.html", &ctx)?;
+    Ok(HttpResponse::Ok()
+       .content_type("text/html")
+       .body(body))
+}
+
 #[derive(Deserialize)]
 pub struct NewThreadForm {
     pub title: String,