Add forms for adding recipes and versions

This commit is contained in:
Benjamin 2023-01-06 14:48:46 +01:00
parent b898bc3ba5
commit 6853be4ed5
3 changed files with 11 additions and 2 deletions

View file

@ -2,6 +2,9 @@
{% block title %}{{ recipe.title }}{% endblock %}
{% block main %}
<h1>{{ recipe.title }}</h1>
{% if perms.recipes.add_recipe %}
<p><a href="#">Add version</a></p>
{% endif %}
<ul>
{% for v in versions %}
<li><a href="{{ v.get_absolute_url }}">{{ v.label }}</a></li>

View file

@ -2,6 +2,9 @@
{% block title %}Recipes{% endblock %}
{% block main %}
<h1>Recipes</h1>
{% if perms.recipes.add_recipe %}
<p><a href="#">Add recipe</a></p>
{% endif %}
{% if perms.recipes.view_recipe %}
<ul>
{% for recipe in recipes %}

View file

@ -1,9 +1,12 @@
{% extends "base_main.html" %}
{% block title %}{{ recipe.title }}{% endblock %}
{% block main %}
<h1>{{ version.recipe.title }} ({{ version.label }})</h1>
<h1>{{ version.recipe.title }}{% if has_multiple_versions %} ({{ version.label }}){% endif %}</h1>
{% if has_multiple_versions %}
<aside><a href="{{ recipe.get_absolute_url }}">Show all versions</a></aside>
<p><a href="{{ recipe.get_absolute_url }}">Show all versions</a></p>
{% endif %}
{% if perms.recipes.add_recipe %}
<p><a href="#">Add version</a></p>
{% endif %}
<ul>
{% for i in ingredients %}