moved from files home/view, recipe/search, recipe/view
This commit is contained in:
parent
f030eff9c9
commit
9750af7839
@ -1,14 +1,16 @@
|
|||||||
<img src="static/img/bandeau.jpg" alt="Cook">
|
<img src="static/img/bandeau.jpg" alt="Cook">
|
||||||
|
|
||||||
<?php View::show("common/category_list") ?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<section>
|
<?php View::show("common/category_list") ?>
|
||||||
<h1> Nos idées recettes: </h1>
|
<article>
|
||||||
<?php
|
<section>
|
||||||
foreach ($A_view as $recipe){
|
<h1> Nos idées recettes: </h1>
|
||||||
View::show("common/recipe", $recipe);
|
<?php
|
||||||
}
|
foreach ($A_view as $recipe){
|
||||||
?>
|
View::show("common/recipe", $recipe);
|
||||||
</section>
|
}
|
||||||
|
?>
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@ -3,28 +3,30 @@
|
|||||||
$has_query = $A_view["QUERY"] !== null;
|
$has_query = $A_view["QUERY"] !== null;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php View::show("common/category_list") ?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<!-- Inclure les catégories -->
|
<?php View::show("common/category_list") ?>
|
||||||
<form method="GET" action="/recipe/search">
|
<article>
|
||||||
<label for="query">Saisissez les termes à rechercher</label>
|
<!-- Inclure les catégories -->
|
||||||
<input id="query" type="text" name="query" placeholder="<?= $has_query ? $A_view["QUERY"] : "Votre recherche" ?>">
|
<form method="GET" action="/recipe/search">
|
||||||
<input type="submit" value="Rechercher">
|
<label for="query">Saisissez les termes à rechercher</label>
|
||||||
</form>
|
<input id="query" type="text" name="query" placeholder="<?= $has_query ? $A_view["QUERY"] : "Votre recherche" ?>">
|
||||||
<section>
|
<input type="submit" value="Rechercher">
|
||||||
<?php
|
</form>
|
||||||
if ($has_query) {
|
<section>
|
||||||
$search_results = $A_view["RESULTS"];
|
<?php
|
||||||
if (empty($search_results)) {
|
if ($has_query) {
|
||||||
echo '<h2 class="no_results">Aucun résultat</h2>';
|
$search_results = $A_view["RESULTS"];
|
||||||
echo '<p class="no_results_description">Assurez-vous d\'avoir rentré correctement vos termes de recherche ou essayez des mots clefs différents.</p>';
|
if (empty($search_results)) {
|
||||||
} else {
|
echo '<h2 class="no_results">Aucun résultat</h2>';
|
||||||
foreach ($search_results as $key => $value) {
|
echo '<p class="no_results_description">Assurez-vous d\'avoir rentré correctement vos termes de recherche ou essayez des mots clefs différents.</p>';
|
||||||
View::show("common/recipe", $value);
|
} else {
|
||||||
|
foreach ($search_results as $key => $value) {
|
||||||
|
View::show("common/recipe", $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
?>
|
||||||
?>
|
</section>
|
||||||
</section>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@ -1,41 +1,42 @@
|
|||||||
<?php View::show("common/category_list") ?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
<?php View::show("common/category_list") ?>
|
||||||
|
<article>
|
||||||
|
<img src="<?= $A_view["IMG_LINK"] ?>" alt="Image d'illustration de la recette">
|
||||||
|
|
||||||
<img src="<?= $A_view["IMG_LINK"] ?>" alt="Image d'illustration de la recette">
|
<section class="infosRecette">
|
||||||
|
<header>
|
||||||
|
<h1><?= $A_view["NAME"] ?></h1>
|
||||||
|
<p><?= $A_view["TIME"] ?> — <?= $A_view["DIFFICULTY_NAME"] ?></p>
|
||||||
|
</header>
|
||||||
|
<p><?= $A_view["DESC"] ?></p>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="infosRecette">
|
<section class="ingredientsRecette">
|
||||||
<header>
|
<h2>Ingrédients</h2>
|
||||||
<h1><?= $A_view["NAME"] ?></h1>
|
<ul>
|
||||||
<p><?= $A_view["TIME"] ?> — <?= $A_view["DIFFICULTY_NAME"] ?></p>
|
<?php
|
||||||
</header>
|
foreach($A_view["INGREDIENTS"] as $ingredient)
|
||||||
<p><?= $A_view["DESC"] ?></p>
|
echo "<li> {$ingredient["NAME"]}: {$ingredient["QUANTITY"]} </li>";
|
||||||
</section>
|
?>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="ingredientsRecette">
|
<section>
|
||||||
<h2>Ingrédients</h2>
|
<h2>Préparation</h2>
|
||||||
<ul>
|
<ol>
|
||||||
<?php
|
<?php
|
||||||
foreach($A_view["INGREDIENTS"] as $ingredient)
|
foreach(explode("\n", $A_view["RECIPE"]) as $instructions)
|
||||||
echo "<li> {$ingredient["NAME"]}: {$ingredient["QUANTITY"]} </li>";
|
echo "<li>".$instructions."</li>";
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<p>By <?= $A_view["AUTHOR_USERNAME"] ?></p>
|
||||||
<h2>Préparation</h2>
|
|
||||||
<ol>
|
|
||||||
<?php
|
|
||||||
foreach(explode("\n", $A_view["RECIPE"]) as $instructions)
|
|
||||||
echo "<li>".$instructions."</li>";
|
|
||||||
?>
|
|
||||||
</ol>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<p>By <?= $A_view["AUTHOR_USERNAME"] ?></p>
|
<?php
|
||||||
|
View::show("appreciations/view_all", $A_view)
|
||||||
<?php
|
?>
|
||||||
View::show("appreciations/view_all", $A_view)
|
</article>
|
||||||
?>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user