1
0
Fork 0

Rename template var

This commit is contained in:
Alex Kotov 2020-10-16 02:10:18 +05:00
parent 588260b5d1
commit bc64a4b9c6
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 7 additions and 5 deletions

View file

@ -9,7 +9,7 @@ use validator::Validate;
#[derive(Serialize)]
struct TemplateContext {
parent: &'static str,
layout: &'static str,
users: Option<Vec<models::User>>,
}
@ -22,7 +22,7 @@ fn index(db_conn: database::DbConn) -> Template {
let all_users = models::User::all(db_conn).unwrap();
let template_context = TemplateContext {
parent: "site",
layout: "site",
users: Some(all_users),
};
@ -32,7 +32,7 @@ fn index(db_conn: database::DbConn) -> Template {
#[get("/sign_up")]
fn sign_up_show() -> Template {
let template_context = TemplateContext {
parent: "site",
layout: "site",
users: None,
};

View file

@ -9,4 +9,5 @@
</ul>
</div>
{{/inline}}
{{~> (parent)~}}
{{~> (layout)~}}

View file

@ -17,4 +17,5 @@
</form>
</div>
{{/inline}}
{{~> (parent)~}}
{{~> (layout)~}}