aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-08-01 13:38:35 +0200
committerHarald Eilertsen <haraldei@anduin.net>2018-08-01 13:38:35 +0200
commit3ef15d64c60d943b64d998449ed0eaa1dee0ac3e (patch)
treea5446f8020e10fc1b0b9662dec04303dd2cdf74d /src/utils
parentd285d0525f86160a61067942346fb40f2bc5c797 (diff)
downloadrocket-blog-3ef15d64c60d943b64d998449ed0eaa1dee0ac3e.tar.gz
rocket-blog-3ef15d64c60d943b64d998449ed0eaa1dee0ac3e.tar.bz2
rocket-blog-3ef15d64c60d943b64d998449ed0eaa1dee0ac3e.zip
Fix display of flash messages.
Pass full flash to template, and style according to flash name/type.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 57975bc..5392224 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -14,7 +14,7 @@ pub fn init_db_pool<'a>(dburl: &'a str) -> Pool {
use std::ops::Deref;
use rocket::http::Status;
-use rocket::request::{self, FromRequest};
+use rocket::request::{self, FlashMessage, FromRequest};
use rocket::{Request, State, Outcome};
// Connection request guard type: a wrapper around an r2d2 pooled connection.
@@ -44,11 +44,11 @@ impl Deref for DbConn {
}
}
-#[derive(BartDisplay, Serialize)]
+#[derive(BartDisplay)]
#[template = "templates/layout.html"]
pub struct Page<T: Display> {
pub title: String,
- pub flash: Option<String>,
+ pub flash: Option<FlashMessage>,
pub content: T
}