Added indexed lists and link edition in tunes
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<li id="tema-link-{{ link.id }}">
|
||||
<form class="flex flex-row items-start">
|
||||
{% include "fragments/tema/link_icon.html" %}
|
||||
<div class="grow my-2">
|
||||
<p class="text-sm text-beige">
|
||||
<select id="tema-link-{{ link.id }}-content-type"
|
||||
name="content_type"
|
||||
value="{{ link.content_type.value.capitalize() }}"
|
||||
class="border border-yellow-50 focus:outline-none
|
||||
rounded
|
||||
text-yellow-50 text-center
|
||||
bg-brown p-0 m-0">
|
||||
<option value="{{ link.content_type.value }}">
|
||||
{{ link.content_type.value.capitalize() }}
|
||||
</option>
|
||||
{% for ct in ContentType %}
|
||||
{% if ct != link.content_type %}
|
||||
<option value="{{ ct.value }}">
|
||||
{{ ct.value.capitalize() }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<input name="title"
|
||||
placeholder="Títol de l'enllaç"
|
||||
value="{{ link.title }}"
|
||||
class="border border-beige focus:outline-none
|
||||
rounded w-full
|
||||
bg-brown p-1 my-1"
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<input name="url"
|
||||
placeholder="URL de l'enllaç"
|
||||
value="{{ link.url }}"
|
||||
class="border border-beige focus:outline-none
|
||||
rounded w-full
|
||||
bg-brown p-1 my-1"
|
||||
hx-get="/api/tema/{{ tema.id }}/link/{{ link_id }}/icon"
|
||||
hx-trigger="keyup delay:500ms changed"
|
||||
hx-target="#link-icon-{{ link.id }}"
|
||||
hx-include="[name='content_type']"
|
||||
hx-swap="outerHTML"
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div class="m-2 text-sm text-beige">
|
||||
<button title="Desa els canvis"
|
||||
class="mx-1"
|
||||
hx-put="/api/tema/{{ tema.id }}/link/{{ link.id }}"
|
||||
hx-target="#tema-link-{{ link.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-check" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button title="Descarta els canvis"
|
||||
class="mx-1"
|
||||
hx-get="/api/tema/{{ tema.id }}/link/{{ link.id }}"
|
||||
hx-target="#tema-link-{{ link.id }}"
|
||||
hx-swap="outerHTML">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
Reference in New Issue
Block a user