diff --git a/recipes/templates/add-version.html b/recipes/templates/add-version.html deleted file mode 100644 index fb403db..0000000 --- a/recipes/templates/add-version.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends "base_main.html" %} -{% comment %} - Barn Web App - A collection of web-apps for my family's personal use, - including a recipe database. - Copyright © 2023 Benjamin Stadlbauer - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero - General Public License for more details. - - This program comes with a copy of the GNU Affero General Public License - file at the root of this project. -{% endcomment %} -{% 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-version.html b/recipes/templates/edit-version.html deleted file mode 100644 index 0659431..0000000 --- a/recipes/templates/edit-version.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends "base_main.html" %} -{% comment %} - Barn Web App - A collection of web-apps for my family's personal use, - including a recipe database. - Copyright © 2023 Benjamin Stadlbauer - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero - General Public License for more details. - - This program comes with a copy of the GNU Affero General Public License - file at the root of this project. -{% endcomment %} -{% block title %}{{ recipe.title }}{% endblock %} -{% block main %} -
{# TODO refactor with add-version.html#} - {%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/add-recipe.html b/recipes/templates/recipe-form.html similarity index 92% rename from recipes/templates/add-recipe.html rename to recipes/templates/recipe-form.html index f696794..0d3de9f 100644 --- a/recipes/templates/add-recipe.html +++ b/recipes/templates/recipe-form.html @@ -19,12 +19,12 @@ {% endcomment %} {% block title %}{{ recipe.title }}{% endblock %} {% block main %} -
+ {%csrf_token %} - {{ recipe_form.as_div }} - - {{ version_form.as_table }} -
+ {% if recipe_form %} + {{ recipe_form.as_div }} + {% endif %} + {{ version_form.as_div }} {{ ingredients_formset.management_form }} {% for ingredient_form in ingredients_formset %} {{ ingredient_form.as_div }} @@ -36,7 +36,7 @@