Push photo below preparation text
This commit is contained in:
		
							parent
							
								
									1247a53278
								
							
						
					
					
						commit
						45de848cbe
					
				
					 2 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -49,3 +49,6 @@ class Composition(models.Model):
 | 
			
		|||
    ingredient = models.ForeignKey(Ingredient, on_delete=models.PROTECT)
 | 
			
		||||
    quantite = models.DecimalField(max_digits=6, decimal_places=3, null=True, blank=True)
 | 
			
		||||
    unite = models.ForeignKey(Unite, null=True, blank=True, on_delete=models.PROTECT)
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return "%s %s %s" % (self.quantite, self.unite.nom, self.ingredient.nom)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,19 +3,21 @@
 | 
			
		|||
{% block content %}
 | 
			
		||||
<h1>{{ recette.nom }}</h1>
 | 
			
		||||
 | 
			
		||||
{% if recette.photo %}
 | 
			
		||||
<div class="photo"><img src="{{ recette.photo.url }}"></div>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
<div>{{ recette.prep|linebreaksbr }}</div>
 | 
			
		||||
 | 
			
		||||
{% if recette.ingredients.count %}
 | 
			
		||||
<div class="ingredients">
 | 
			
		||||
<h2>Ingrédients</h2>
 | 
			
		||||
<ul>
 | 
			
		||||
    {% for comp in recette.ingredients.all %}
 | 
			
		||||
    <li>{{ comp }}</li>
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
</ul>
 | 
			
		||||
</div>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% if recette.photo %}
 | 
			
		||||
<div class="photo"><img src="{{ recette.photo.url }}"></div>
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue