{! 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>
{?bookmarked}
<button name="bookmarked" value="false"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Remove bookmark</button>
<button name="bookmarked" value="true"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Add bookmark</button>
{/bookmarked}
</form>
<a href="/favorites">Favourites list</a>
{/details}