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/hw7/Claudio_Maggioni/views/favourite_partial.dust

44 lines
1.5 KiB
Text
Raw Normal View History

2019-11-11 15:58:06 +00:00
{! vim: set ts=2 sw=2 et tw=120: !}
<h3>{name}</h3>
<img src="{dataURL}" alt="{name}">
{?b}
<p>
2019-11-13 10:04:39 +00:00
<strong>Bookmarked</strong>
2019-11-11 15:58:06 +00:00
</p>
{/b}
{?details}
<a href="/favorites/{_id}">Details</a>
{:else}
<form class="data" id="favourite{_id}" method="POST" action="/favorites/{_id}?_method=PUT">
2019-11-13 10:04:39 +00:00
<input type="hidden" name="dataURL" value="{dataURL}">
<label for="name">Name:</label>
<input type="text" name="name" placeholder="Name" value="{name}"><br>
<button type="button" class="imgur">Imgur options</button><hr>
2019-11-13 10:04:39 +00:00
<button data-update>Update</button><br>
<button data-delete formaction="/favorites/{_id}?_method=DELETE">Delete</button><br>
{?bookmarked}
<button data-del-bookmark name="bookmarked" value="false"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Remove bookmark</button>
{:else}
<button data-bookmark name="bookmarked" value="true"
formaction="/favorites/{_id}/bookmarked?_method=PUT">Add bookmark</button>
{/bookmarked}
2019-11-11 15:58:06 +00:00
</form>
<form class="favorites hidden">
<hr>
<input type="hidden" name="dataURL" value="{dataURL}">
<input type="text" name="album" placeholder="Imgur album name"><br>
<input type="text" name="tags" placeholder="Imgur tags"><br>
<label for="favorites">Add in favorites</label>
2019-11-14 14:27:51 +00:00
<input type="checkbox" name="favorites"><br>
<label for="favorites">Replace an image</label>
<input type="checkbox" name="replace"><br>
<div class="replace hidden">
2019-11-14 15:08:52 +00:00
<input type="text" name="old_name" placeholder="Imgur image name to replace"><br>
2019-11-14 14:27:51 +00:00
</div>
2019-11-14 15:08:52 +00:00
<button type="submit">Submit to Imgur</button>
2019-11-14 15:26:10 +00:00
<div class="details"></div>
</form>
2019-11-11 15:58:06 +00:00
{/details}