Split db::Connection implementation in submodules (db::user and db::recipe).
This commit is contained in:
parent
4248d11aa9
commit
fce4eade73
17 changed files with 1307 additions and 1234 deletions
|
|
@ -1,22 +1,17 @@
|
|||
use askama::Template;
|
||||
|
||||
use crate::model;
|
||||
use crate::data::model;
|
||||
|
||||
pub struct Recipes {
|
||||
pub list: Vec<(i64, String)>,
|
||||
pub current_id: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "home.html")]
|
||||
pub struct HomeTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Vec<(i64, String)>,
|
||||
pub current_recipe_id: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "view_recipe.html")]
|
||||
pub struct ViewRecipeTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Vec<(i64, String)>,
|
||||
pub current_recipe_id: Option<i64>,
|
||||
pub current_recipe: model::Recipe,
|
||||
pub recipes: Recipes,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
|
|
@ -91,3 +86,19 @@ pub struct ProfileTemplate {
|
|||
pub message_email: String,
|
||||
pub message_password: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "recipe_view.html")]
|
||||
pub struct RecipeViewTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Recipes,
|
||||
pub recipe: model::Recipe,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "recipe_edit.html")]
|
||||
pub struct RecipeEditTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Recipes,
|
||||
pub recipe: model::Recipe,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue