Files
recipes/cookbook/templates/recipe_view.html
vabene1111 9a22c37862 comments
2019-11-14 10:06:51 +01:00

55 lines
1.3 KiB
HTML

{% extends "base.html" %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load custom_tags %}
{% block title %}{% trans 'View' %}{% endblock %}
{% block content %}
<h3>{{ recipe.name }} <a href="{% url 'edit_recipe' recipe.pk %}"><i class="fas fa-pencil-alt"></i></a></h3>
{% if recipe.all_tags %}
{{ recipe.all_tags }}
<br/>
{% endif %}
<br/>
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">{% trans 'Ingredients' %}</h5>
{% for i in ingredients %}
{{ i.amount }} {{ i.unit }} {{ i.ingredient.name }} <br/>
{% endfor %}
</div>
</div>
<br/>
<br/>
{{ recipe.instructions | markdown | safe }}
<br/>
<br/>
<h5>{% trans 'Comments' %}</h5>
<form method="POST" class="post-form">
{% csrf_token %}
{{ form|crispy }}
<input type="submit" value="Submit" class="btn btn-success">
</form>
{% for c in comments %}
<div class="card">
<div class="card-body">
<small class="card-title">{{ c.updated_at }} {% trans 'by' %} {{ c.created_by.username }}</small> <br/>
{{ c.text }}
</div>
<br/>
</div>
{% endfor %}
{% endblock %}