Rename template var
This commit is contained in:
parent
588260b5d1
commit
bc64a4b9c6
3 changed files with 7 additions and 5 deletions
|
@ -9,7 +9,7 @@ use validator::Validate;
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct TemplateContext {
|
struct TemplateContext {
|
||||||
parent: &'static str,
|
layout: &'static str,
|
||||||
users: Option<Vec<models::User>>,
|
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 all_users = models::User::all(db_conn).unwrap();
|
||||||
|
|
||||||
let template_context = TemplateContext {
|
let template_context = TemplateContext {
|
||||||
parent: "site",
|
layout: "site",
|
||||||
users: Some(all_users),
|
users: Some(all_users),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ fn index(db_conn: database::DbConn) -> Template {
|
||||||
#[get("/sign_up")]
|
#[get("/sign_up")]
|
||||||
fn sign_up_show() -> Template {
|
fn sign_up_show() -> Template {
|
||||||
let template_context = TemplateContext {
|
let template_context = TemplateContext {
|
||||||
parent: "site",
|
layout: "site",
|
||||||
users: None,
|
users: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,4 +9,5 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{/inline}}
|
{{/inline}}
|
||||||
{{~> (parent)~}}
|
|
||||||
|
{{~> (layout)~}}
|
||||||
|
|
|
@ -17,4 +17,5 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{/inline}}
|
{{/inline}}
|
||||||
{{~> (parent)~}}
|
|
||||||
|
{{~> (layout)~}}
|
||||||
|
|
Reference in a new issue