Compare commits

..

No commits in common. "aa0e153f6517ff22ba98a21852a2318c2936ea4e" and "1f43f408cc62c95cf29422ea289d14ddeb187b36" have entirely different histories.

5 changed files with 3 additions and 101 deletions

View File

@ -1,26 +0,0 @@
<?php
namespace Lycoreco\Apps\Recipes\Controllers;
use Lycoreco\Apps\Recipes\Models\RecipeModel;
use Lycoreco\Includes\BaseController;
define('FAVORITES_MAX_RECIPES', 20);
class FavoritesController extends BaseController
{
protected $template_name = APPS_PATH . '/Recipes/Templates/favorites.php';
public function get_context_data()
{
$context = parent::get_context_data();
$context['recipes'] = RecipeModel::filter(
[],
['-obj.created_at'],
FAVORITES_MAX_RECIPES
);
return $context;
}
}

View File

@ -1,31 +0,0 @@
<?php
require_once APPS_PATH . '/Recipes/components.php';
the_header(
'Favorites',
'Here are your favorite recipes. Enjoy cooking!',
'favorites-page',
[
['keywords', 'favorites, recipes, cooking, food'],
]
);
?>
<div class="container">
<div class="favorites">
<div class="favorites-items">
<?php
for( $i = 0; $i < 5; $i++) {
foreach ($context['recipes'] as $recipe) {
the_product_item($recipe);
}
}
?>
</div>
</div>
</div>
<?php
the_footer();
?>

View File

@ -8,5 +8,4 @@ $recipes_urls = [
new Path('/recipe/[:int]/export-pdf', new Controllers\ExportPdfController(), 'export-pdf'), new Path('/recipe/[:int]/export-pdf', new Controllers\ExportPdfController(), 'export-pdf'),
new Path('/catalog', new Controllers\CatalogController(), 'catalog'), new Path('/catalog', new Controllers\CatalogController(), 'catalog'),
new Path('/daily-meals', new Controllers\DailyMealsController, 'daily-meals'), new Path('/daily-meals', new Controllers\DailyMealsController, 'daily-meals'),
new Path('/favorites', new Controllers\FavoritesController(), 'favorites'),
]; ];

View File

@ -734,11 +734,8 @@ input[type="checkbox"]{
} }
.catalog-recipe { .catalog-recipe {
display: flex; display: block;
flex-direction: column; width: 200px;
align-items: center;
justify-content: center;
width: 100%;
} }
.catalog-recipe__image { .catalog-recipe__image {
@ -1066,23 +1063,6 @@ label {
margin-top: 46px; margin-top: 46px;
} }
.favorites-items a {
text-decoration: none;
}
.favorites{
margin-top: 46px;
display: flex;
}
.favorites-items{
width: 100%;
display: grid;
grid-template-columns: repeat(4, 1fr);
column-gap: 25px;
row-gap: 40px;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.catalog-items { .catalog-items {
@ -1091,8 +1071,6 @@ label {
margin-right: 0; margin-right: 0;
} }
.welcome__inner { .welcome__inner {
flex-direction: column; flex-direction: column;
} }
@ -1260,11 +1238,6 @@ label {
grid-template-rows: repeat(6, 100px); grid-template-rows: repeat(6, 100px);
} }
.favorites-items {
width: 100%;
grid-template-columns: repeat(2, 1fr);
}
} }
@ -1299,13 +1272,6 @@ label {
padding: 5px; padding: 5px;
} }
.favorites-items {
margin-right: 0;
justify-items: center;
align-items: center;
padding: 5px;
}
.catalog-recipe { .catalog-recipe {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -1332,10 +1298,4 @@ label {
grid-template-columns: 1fr; grid-template-columns: 1fr;
margin-right: 0; margin-right: 0;
} }
.favorites-items {
width: 100%;
grid-template-columns: 1fr;
margin-right: 0;
}
} }

View File

@ -55,7 +55,7 @@
<li class="nav-item"><a href="<?php the_permalink("index:home") ?>" class="nav-link">HOME</a> <li class="nav-item"><a href="<?php the_permalink("index:home") ?>" class="nav-link">HOME</a>
</li> </li>
<li class="nav-item"><a href="<?php the_permalink("recipes:catalog") ?>" class="nav-link">RECIPES</a></li> <li class="nav-item"><a href="<?php the_permalink("recipes:catalog") ?>" class="nav-link">RECIPES</a></li>
<li class="nav-item"><a href="<?php the_permalink("recipes:favorites")?>" class="nav-link">FAVORITES</a></li> <li class="nav-item"><a href="#" class="nav-link">FAVORITES</a></li>
<li class="nav-item"><a href="<?php the_permalink("recipes:daily-meals") ?>" class="nav-link">MEAL A DAY</a></li> <li class="nav-item"><a href="<?php the_permalink("recipes:daily-meals") ?>" class="nav-link">MEAL A DAY</a></li>
<li class="nav-item"><a href="#" class="nav-link">SUBMIT RECIPE</a></li> <li class="nav-item"><a href="#" class="nav-link">SUBMIT RECIPE</a></li>
</ul> </ul>