Skip to content

Commit

Permalink
manage: show ingredients in recipe list
Browse files Browse the repository at this point in the history
  • Loading branch information
kassner committed Oct 9, 2023
1 parent 87acac5 commit e429779
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/main/js/manage/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ h1 {
@apply hover:bg-zinc-100 dark:hover:bg-gray-800;
}

td.name {
p {
font-size: 1rem;
font-weight: bold;
}

ul {
margin-top: 5px;
display: flex;
flex-wrap: wrap;
gap: 3px;

font-size: 0.75rem;
line-height: 1rem;

li {
@apply border-zinc-200 bg-zinc-50 border rounded-md p-1 text-zinc-500;
display: inline-block;
}
}
}

td.actions {
@apply flex flex-col space-y-1 sm:flex-row sm:space-x-2 sm:space-y-0;

Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/templates/recipe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ <h1 class="flex-grow">Manage recipes</h1>
<tbody>
<tr th:each="recipe: ${recipes}">
<td th:text="${recipe.getId()}"></td>
<td th:text="${recipe.getName()}"></td>
<td class="name">
<p th:text="${recipe.getName()}"></p>
<ul>
<li th:each="ingredient: ${recipe.getIngredients()}" th:text="${ingredient.getName()}"></li>
</ul>
</td>
<td class="actions">
<a class="btn-edit" th:href="@{/manage/recipe/{id}/edit(id=${recipe.getId()})}">Edit</a>
<form th:action="@{/manage/recipe/{id}/delete(id=${recipe.getId()})}" method="POST" th:data-recipe-name="${recipe.getName()}">
Expand Down

0 comments on commit e429779

Please sign in to comment.