diff --git a/src/main/java/fyloz/trial/ColorRecipesExplorer/web/controller/creators/RecipeCreatorController.java b/src/main/java/fyloz/trial/ColorRecipesExplorer/web/controller/creators/RecipeCreatorController.java index c34cb84..9a39729 100644 --- a/src/main/java/fyloz/trial/ColorRecipesExplorer/web/controller/creators/RecipeCreatorController.java +++ b/src/main/java/fyloz/trial/ColorRecipesExplorer/web/controller/creators/RecipeCreatorController.java @@ -34,9 +34,9 @@ public class RecipeCreatorController { * @return La page à afficher. */ @GetMapping(CREATOR_RECIPE) - public String showCreationPage(Model model) { + public String showCreationPage(Model model, Recipe recipe) { model.addAttribute(COMPANIES, companyService.getAll()); - + model.addAttribute(RECIPE, recipe == null ? new Recipe() : recipe); return CREATOR_RECIPE; } @@ -64,7 +64,7 @@ public class RecipeCreatorController { return CREATOR_RECIPE_SUCCESS; } else { model.addAttribute(RESPONSE_ERROR, ERROR_SAVING); - return showCreationPage(model); + return showCreationPage(model, recipe); } } } diff --git a/src/main/resources/lang/messages_en.properties b/src/main/resources/lang/messages_en.properties index e99518c..94047a7 100644 --- a/src/main/resources/lang/messages_en.properties +++ b/src/main/resources/lang/messages_en.properties @@ -67,4 +67,8 @@ mix.edit.title=Editing a mix mix.edit.subtitle=Editing a mix for the recipe {0} ({1}) password.ask=What is your password? password.notValid=Your password is not valid -error.serverError=An error occurred while sending data to the server. \ No newline at end of file +error.serverError=An error occurred while sending data to the server. +recipe.add.title=Add a recipe +recipe.sucess.saved=The recipe {0} has been saved. You can now add ingredients. +keyword.continue=Continue +recipe.edit.title=Editing {0} \ No newline at end of file diff --git a/src/main/resources/lang/messages_fr.properties b/src/main/resources/lang/messages_fr.properties index fd28aa4..72b30c2 100644 --- a/src/main/resources/lang/messages_fr.properties +++ b/src/main/resources/lang/messages_fr.properties @@ -68,3 +68,7 @@ mix.edit.subtitle=Modifier un mélange pour la recette {0} ({1}) password.ask=Quel est votre mot de passe? password.notValid=Votre mot de passe n'est pas valide error.serverError=Une erreur est survenue lors de l'envoie des informations vers le serveur. +recipe.add.title=Ajout d'une recette +recipe.sucess.saved=La recette {0} à été enregistrée. Vous pouvez maintenant ajouter les ingrédients. +keyword.continue=Continuer +recipe.edit.title=Modification de {0} diff --git a/src/main/resources/templates/recipe/created.html b/src/main/resources/templates/recipe/created.html index 992a9a6..b647cec 100644 --- a/src/main/resources/templates/recipe/created.html +++ b/src/main/resources/templates/recipe/created.html @@ -2,7 +2,7 @@ - Ajout d'une recette + @@ -14,9 +14,9 @@

-

Ajout d'une recette

-

- +

+

+
diff --git a/src/main/resources/templates/recipe/creator.html b/src/main/resources/templates/recipe/creator.html index 6882500..5643cbc 100644 --- a/src/main/resources/templates/recipe/creator.html +++ b/src/main/resources/templates/recipe/creator.html @@ -1,8 +1,7 @@ - - Ajout d'une recette + @@ -14,44 +13,43 @@

-

Ajout d'une recette

+

-
+ - - + + - - + - - + + - - + + - - + + - - + +
- + - +
diff --git a/src/main/resources/templates/recipe/edit.html b/src/main/resources/templates/recipe/edit.html index 244e699..af43d98 100644 --- a/src/main/resources/templates/recipe/edit.html +++ b/src/main/resources/templates/recipe/edit.html @@ -1,10 +1,8 @@ - - + -