From c1b976edd0c27fdc488da7ff4c1b7551df0323cd Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 3 Nov 2024 15:50:08 +0100 Subject: view: Implement favorite recipes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This marks favorite recipes with a `⭐` emoticon. The favorite flag value can be set on the recipe edit page. Favorite recipes are listed first on the recipe list view. Furthermore as a second priority the created time stamp is used in the recipe list so that more recent recipes are listed first. --- view/html/recipe-edit.html | 1 + view/html/recipe.html | 3 ++- view/html/recipes.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'view/html') diff --git a/view/html/recipe-edit.html b/view/html/recipe-edit.html index 9a18e75..14258f3 100644 --- a/view/html/recipe-edit.html +++ b/view/html/recipe-edit.html @@ -13,6 +13,7 @@ +

diff --git a/view/html/recipe.html b/view/html/recipe.html index b2fe773..b8fd130 100644 --- a/view/html/recipe.html +++ b/view/html/recipe.html @@ -12,7 +12,8 @@

{{ if ne .Recipe.Notes "" }} -

{{.Recipe.Notes}}

{{end}}{{ if ne .Recipe.Portions "" }} +

{{.Recipe.Notes}}

{{end}} +

Is favorite: {{if .Recipe.IsFavorite}}Yes{{else}}No{{end}}

{{ if ne .Recipe.Portions "" }}

Portions: {{.Recipe.Portions}}

{{end}}{{ if ne .Recipe.Url "" }}

Original recipe: {{.Recipe.Url}}

{{end}}{{if .HasIngredients}}

Ingredient summary:

diff --git a/view/html/recipes.html b/view/html/recipes.html index d9e720b..35059f7 100644 --- a/view/html/recipes.html +++ b/view/html/recipes.html @@ -12,7 +12,7 @@ {{if ne (len .) 0}}

{{else}}

No recipes available.

{{end}} -- cgit v1.2.3-70-g09d2