Translation of the recipe edit page

This commit is contained in:
Greg Burri 2025-01-06 19:51:19 +01:00
parent f059d3c61f
commit 8b4b788562
7 changed files with 112 additions and 53 deletions

View file

@ -7,7 +7,6 @@ use crate::{
consts,
data::model,
hash::{hash, verify_password},
services::user,
};
#[derive(Debug)]

View file

@ -10,14 +10,14 @@ pub struct User {
pub lang: String,
}
#[derive(FromRow)]
#[derive(Debug, FromRow)]
pub struct UserLoginInfo {
pub last_login_datetime: DateTime<Utc>,
pub ip: String,
pub user_agent: String,
}
#[derive(FromRow)]
#[derive(Debug, FromRow)]
pub struct Recipe {
pub id: i64,
pub user_id: i64,
@ -36,7 +36,7 @@ pub struct Recipe {
pub groups: Vec<Group>,
}
#[derive(FromRow)]
#[derive(Debug, FromRow)]
pub struct Group {
pub id: i64,
pub name: String,
@ -46,7 +46,7 @@ pub struct Group {
pub steps: Vec<Step>,
}
#[derive(FromRow)]
#[derive(Debug, FromRow)]
pub struct Step {
pub id: i64,
pub action: String,
@ -55,7 +55,7 @@ pub struct Step {
pub ingredients: Vec<Ingredient>,
}
#[derive(FromRow)]
#[derive(Debug, FromRow)]
pub struct Ingredient {
pub id: i64,
pub name: String,

View file

@ -44,6 +44,8 @@ pub async fn edit_recipe(
current_id: Some(recipe_id),
};
dbg!(&recipe);
Ok(RecipeEditTemplate {
user: Some(user),
tr,

View file

@ -80,6 +80,31 @@ pub enum Sentence {
RecipeNotAllowedToEdit,
RecipeNotAllowedToView,
RecipeNotFound,
RecipeTitle,
RecipeDescription,
RecipeServings,
RecipeEstimatedTime,
RecipeDifficulty,
RecipeDifficultyEasy,
RecipeDifficultyMedium,
RecipeDifficultyHard,
RecipeTags,
RecipeLanguage,
RecipeIsPublished,
RecipeDelete,
RecipeAddAGroup,
RecipeRemoveGroup,
RecipeGroupName,
RecipeGroupComment,
RecipeAddAStep,
RecipeRemoveStep,
RecipeStepAction,
RecipeAddAnIngredient,
RecipeRemoveIngredient,
RecipeIngredientName,
RecipeIngredientQuantity,
RecipeIngredientUnit,
RecipeIngredientComment,
}
#[derive(Clone)]