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)] #[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,
}; };

View file

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

View file

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