This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
SA3/hw5/Claudio_Maggioni/views/favourite_partial.dust
2019-11-01 15:06:59 +01:00

28 lines
850 B
Text

{! vim: set ts=2 sw=2 et tw=120: !}
<h3>{name}</h3>
<img src="{dataURL}" alt="{name}">
{?b}
<p>
<strong>Bookmarked</strong>
</p>
{/b}
{?details}
<a href="/favorites/{_id}">Details</a>
{:else}
<form method="POST" action="/favorites/{_id}?_method=PUT">
<input type="hidden" name="dataURL" value="{dataURL}">
<label for="name">Name:</label>
<input type="text" name="name" placeholder="Name" value="{name}"><br>
<button>Update</button><br>
<button formaction="/favorites/{_id}?_method=DELETE">Delete</button><br>
{?b}
<button name="bookmarked" value="false"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Remove bookmark</button>
{:else}
<button name="bookmarked" value="true"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Add bookmark</button>
{/b}
</form>
<a href="/favorites">Favourites list</a>
{/details}