From 654e10d8effcfb5648172189e2deb8d7ceaf43b7 Mon Sep 17 00:00:00 2001 From: boc-the-git Date: Mon, 21 Oct 2024 20:55:48 +1100 Subject: [PATCH 1/7] Add summary to recipe instructions --- ...4631_add_summary_to_recipe_instructions.py | 34 +++++++++++ .../RecipePageInstructions.vue | 59 +++++++++++++++++-- .../Domain/Recipe/RecipePrintView.vue | 2 +- frontend/lang/messages/en-US.json | 3 + mealie/db/models/recipe/instruction.py | 3 +- mealie/schema/recipe/recipe_step.py | 3 +- 6 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 alembic/versions/2024-10-20-09.47.46_3897397b4631_add_summary_to_recipe_instructions.py diff --git a/alembic/versions/2024-10-20-09.47.46_3897397b4631_add_summary_to_recipe_instructions.py b/alembic/versions/2024-10-20-09.47.46_3897397b4631_add_summary_to_recipe_instructions.py new file mode 100644 index 00000000000..f5b6d73ba00 --- /dev/null +++ b/alembic/versions/2024-10-20-09.47.46_3897397b4631_add_summary_to_recipe_instructions.py @@ -0,0 +1,34 @@ +"""'Add summary to recipe instructions' + +Revision ID: 3897397b4631 +Revises: 86054b40fd06 +Create Date: 2024-10-20 09:47:46.844436 + +""" + +import sqlalchemy as sa + +import mealie.db.migration_types +from alembic import op + +# revision identifiers, used by Alembic. +revision = "3897397b4631" +down_revision: str | None = "86054b40fd06" +branch_labels: str | tuple[str, ...] | None = None +depends_on: str | tuple[str, ...] | None = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table("recipe_instructions", schema=None) as batch_op: + batch_op.add_column(sa.Column("summary", sa.String(), nullable=True)) + + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table("recipe_instructions", schema=None) as batch_op: + batch_op.drop_column("summary") + + # ### end Alembic commands ### diff --git a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue index 592a2cf0019..df5aaf21d47 100644 --- a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue +++ b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue @@ -112,6 +112,30 @@ > + + + +
+ {{ $t('recipe.summary-overview', { default: $t("recipe.step-index", { step: index + 1 }) }) }} +
+ +
+
+
{{ $globals.icons.arrowUpDown }} - {{ $t("recipe.step-index", { step: index + 1 }) }} + {{ step.summary ? step.summary : $t("recipe.step-index", { step: index + 1 }) }}