From faa0708e75ecac0466fc573299fdf4daefe371eb Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 11 Mar 2023 19:18:01 +0100 Subject: [PATCH] Add HTML templates --- recipes/templates/add-recipe.html | 41 +++++++++++++++++++++++++++++ recipes/templates/add-version.html | 40 ++++++++++++++++++++++++++++ recipes/templates/edit-recipe.html | 10 +++++++ recipes/templates/edit-version.html | 40 ++++++++++++++++++++++++++++ recipes/templates/recipe.html | 12 +++++++++ recipes/templates/recipes.html | 11 ++++++++ recipes/templates/version.html | 17 ++++++++++++ 7 files changed, 171 insertions(+) create mode 100644 recipes/templates/add-recipe.html create mode 100644 recipes/templates/add-version.html create mode 100644 recipes/templates/edit-recipe.html create mode 100644 recipes/templates/edit-version.html create mode 100644 recipes/templates/recipe.html create mode 100644 recipes/templates/recipes.html create mode 100644 recipes/templates/version.html diff --git a/recipes/templates/add-recipe.html b/recipes/templates/add-recipe.html new file mode 100644 index 0000000..bd8968c --- /dev/null +++ b/recipes/templates/add-recipe.html @@ -0,0 +1,41 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +
+ {%csrf_token %} + {{ recipe_form.as_div }} + + {{ version_form.as_table }} +
+ {{ ingredients_formset.management_form }} + {% for ingredient_form in ingredients_formset %} + {{ ingredient_form.as_div }} + {% endfor %} + + +
+ + + +{% endblock %} diff --git a/recipes/templates/add-version.html b/recipes/templates/add-version.html new file mode 100644 index 0000000..e67d86b --- /dev/null +++ b/recipes/templates/add-version.html @@ -0,0 +1,40 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +
+ {%csrf_token %} + + {{ version_form.as_table }} +
+ {{ ingredients_formset.management_form }} + {% for ingredient_form in ingredients_formset %} + {{ ingredient_form.as_div }} + {% endfor %} + + +
+ + + +{% endblock %} diff --git a/recipes/templates/edit-recipe.html b/recipes/templates/edit-recipe.html new file mode 100644 index 0000000..09bc18e --- /dev/null +++ b/recipes/templates/edit-recipe.html @@ -0,0 +1,10 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +
+ {%csrf_token %} + {{ form.as_div }} + +
+ +{% endblock %} diff --git a/recipes/templates/edit-version.html b/recipes/templates/edit-version.html new file mode 100644 index 0000000..e3fa642 --- /dev/null +++ b/recipes/templates/edit-version.html @@ -0,0 +1,40 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +
+ {%csrf_token %} + + {{ version_form.as_table }} +
+ {{ ingredients_formset.management_form }} + {% for ingredient_form in ingredients_formset %} + {{ ingredient_form.as_div }} + {% endfor %} + + +
+ + + +{% endblock %} diff --git a/recipes/templates/recipe.html b/recipes/templates/recipe.html new file mode 100644 index 0000000..08d20d9 --- /dev/null +++ b/recipes/templates/recipe.html @@ -0,0 +1,12 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +

{{ recipe.title }}

+

Edit recipe name

+

Add version

+ +{% endblock %} diff --git a/recipes/templates/recipes.html b/recipes/templates/recipes.html new file mode 100644 index 0000000..faee634 --- /dev/null +++ b/recipes/templates/recipes.html @@ -0,0 +1,11 @@ +{% extends "base_main.html" %} +{% block title %}Recipes{% endblock %} +{% block main %} +

Recipes

+

Add recipe

+ +{% endblock %} diff --git a/recipes/templates/version.html b/recipes/templates/version.html new file mode 100644 index 0000000..00ad0ff --- /dev/null +++ b/recipes/templates/version.html @@ -0,0 +1,17 @@ +{% extends "base_main.html" %} +{% block title %}{{ recipe.title }}{% endblock %} +{% block main %} +

{{ version.recipe.title }}{% if has_multiple_versions %} ({{ version.label }}){% endif %}

+{% if has_multiple_versions %} +

Show all versions

+{% endif %} +

Edit recipe name

+

Add version

+

Edit Version

+ +

{{ version.body }}

+{% endblock %}