Initial commit
This commit is contained in:
commit
aa48b6411f
17 changed files with 322 additions and 0 deletions
19
templates/base.html
Normal file
19
templates/base.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<title>Recettes {% block title %}page title{% endblock %}</title>
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/main.css">
|
||||
{% block extrahead %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<hr>
|
||||
<div style="text-align: right;"><a href="{% url 'admin:index' %}">Gestion</a></div>
|
||||
</body>
|
||||
</html>
|
||||
16
templates/index.html
Normal file
16
templates/index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Recettes</h1>
|
||||
|
||||
<form method="POST">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button>Rechercher</button>
|
||||
</form>
|
||||
|
||||
<ul>
|
||||
{% for recette in recettes %}
|
||||
<li><a href="{{ recette.get_absolute_url }}">{{ recette.nom }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
17
templates/recette.html
Normal file
17
templates/recette.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ recette.nom }}</h1>
|
||||
|
||||
<div style="float:right;"><img src="{{ recette.photo }}"></div>
|
||||
|
||||
<div>{{ recette.preparation }}</div>
|
||||
|
||||
{% if recette.ingredients.count %}
|
||||
<ul>
|
||||
{% for comp in recette.ingredients.all %}
|
||||
<li>{{ comp }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue