Add the app version to the home index template context
This commit is contained in:
parent
0cf8335184
commit
ee0d056d18
|
@ -5,6 +5,7 @@ use super::super::ListStore;
|
|||
|
||||
#[derive(Serialize)]
|
||||
struct IndexTemplateContext<'a> {
|
||||
app_version: &'a str,
|
||||
lists: Vec<HashMap<&'a str, &'a str>>
|
||||
}
|
||||
|
||||
|
@ -18,7 +19,10 @@ fn index(lists: State<ListStore>) -> Template {
|
|||
list_kv.insert("name", list.name.as_ref());
|
||||
list_kvs.push(list_kv);
|
||||
}
|
||||
let context = IndexTemplateContext { lists: list_kvs };
|
||||
let context = IndexTemplateContext {
|
||||
app_version: env!("CARGO_PKG_VERSION"),
|
||||
lists: list_kvs
|
||||
};
|
||||
Template::render("index", &context)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue