diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-20 16:11:50 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-02-20 16:15:08 +0100 |
| commit | 73a5c7fae9ffbe9ada721148c8c454a643aceebe (patch) | |
| tree | c8fad013ed9b5dd589add87f8d45cf02bbfc6e91 /public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html | |
| parent | b01239fbdcc5bbc5921f73ec0e8fee7bedd5c8e8 (diff) | |
chore!: restructure repo
I separated public files from the config/dev files. It improves repo
readability.
I also moved dotenv helper to public/inc directory and extract the
Matomo tracker in the same directory.
Diffstat (limited to 'public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html')
| -rw-r--r-- | public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html b/public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html new file mode 100644 index 0000000..53b0d07 --- /dev/null +++ b/public/projects/angular-small-apps/apps/recipes/src/app/components/search-results/search-results.component.html @@ -0,0 +1,61 @@ +<ng-container + *ngIf="recipes && recipes.length > 0; then recipesList; else notFound" +></ng-container> +<ng-template #recipesList> + <ul class="recipes-list"> + <li *ngFor="let recipe of recipes" class="recipes-list__item"> + <article class="card"> + <header class="card__header"> + <img + src="{{ recipe.strMealThumb }}" + alt="{{ recipe.strMeal }} picture" + class="card__thumb" + /> + <h2 class="card__title">{{ recipe.strMeal }}</h2> + </header> + <div *ngIf="recipe.strInstructions" class="card__body"> + {{ + recipe.strInstructions.length > 120 + ? (recipe.strInstructions | slice: 0:120) + "…" + : recipe.strInstructions + }} + </div> + <footer class="card__footer"> + <dl class="meta"> + <div class="meta__item" *ngIf="recipe.strCategory"> + <dt class="meta__term">Category:</dt> + <dd class="meta__description">{{ recipe.strCategory }}</dd> + </div> + <div class="meta__item" *ngIf="recipe.strTags"> + <dt class="meta__term">Tags:</dt> + <dd class="meta__description"> + {{ recipe.strTags | formatComma }} + </dd> + </div> + </dl> + <a + [routerLink]="['/recipe/', recipe.strMeal | slugify]" + [state]="{ id: recipe.idMeal }" + class="btn" + > + Read more + <span class="btn__icon"> →</span> + </a> + </footer> + </article> + </li> + </ul> + <a routerLink="" class="btn"> + <span class="btn__icon">← </span>Back to recipes + </a> +</ng-template> +<ng-template #notFound> + <div class="not-found"> + <div class="not-found__result"> + No recipe match your query: {{ query }}. + </div> + <a routerLink="" class="btn"> + <span class="btn__icon">← </span>Back to your recipes + </a> + </div> +</ng-template> |
