Start an actual design

This commit is contained in:
Bat
2018-05-10 21:31:52 +01:00
parent d3319493d9
commit a74215ef07
9 changed files with 165 additions and 39 deletions
+5 -3
View File
@@ -5,14 +5,16 @@ use std::collections::HashMap;
use BASE_URL;
use db_conn::DbConn;
use models::users::User;
use models::instance::*;
#[get("/")]
fn index(conn: DbConn) -> Template {
fn index(conn: DbConn, user: Option<User>) -> Template {
match Instance::get_local(&*conn) {
Some(inst) => {
Template::render("instance/index", json!({
"instance": inst
"instance": inst,
"account": user
}))
}
None => {
@@ -25,7 +27,7 @@ fn index(conn: DbConn) -> Template {
#[get("/configure")]
fn configure() -> Template {
Template::render("instance/configure", HashMap::<String, i32>::new())
Template::render("instance/configure", json!({}))
}
#[derive(FromForm)]