diff --git a/src/frontend/item.rs b/src/frontend/item.rs index 0bb40c9..6473731 100644 --- a/src/frontend/item.rs +++ b/src/frontend/item.rs @@ -58,8 +58,8 @@ async fn show_item( page_title: Some(Box::new(item_name.clone())), page_actions: vec![ (templates::helpers::PageAction { - href: &format!("/item/{}/edit", item.id), - name: "Edit", + href: format!("/item/{}/edit", item.id), + name: "Edit".to_string(), }), ], ..Default::default() @@ -138,8 +138,8 @@ async fn list_items(pool: web::Data) -> actix_web::Result) -> actix_web::Result { - pub href: &'a str, - pub name: &'a str, +pub struct PageAction { + pub href: String, + pub name: String, } -impl Render for PageAction<'_> { +impl Render for PageAction { fn render(&self) -> Markup { html! { a .btn.btn-primary href=(self.href) { (self.name) } diff --git a/src/frontend/templates/mod.rs b/src/frontend/templates/mod.rs index 465d2f5..e9cf786 100644 --- a/src/frontend/templates/mod.rs +++ b/src/frontend/templates/mod.rs @@ -53,7 +53,7 @@ pub struct TemplateConfig<'a> { pub path: &'a str, pub title: Option<&'a str>, pub page_title: Option>, - pub page_actions: Vec>, + pub page_actions: Vec, pub extra_css: Vec>, pub extra_js: Vec>, }