Refactor tag crud operations
This commit is contained in:
@@ -91,9 +91,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% with person_id=None, tags=tags %}
|
||||
{% include 'partials/tags.html' %}
|
||||
{% endwith %}
|
||||
|
||||
{{ render_partial('partials/tags.html',person_id=None, tags=tags) }}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -5,18 +5,18 @@
|
||||
class="[word-wrap: break-word] my-[5px] mr-4 flex h-[32px] cursor-pointer items-center justify-between rounded-[16px] border border-[#9fa6b2] bg-[#eceff1] bg-[transparent] py-0 px-[12px] text-[13px] font-normal normal-case leading-loose text-[#4f4f4f] shadow-none transition-[opacity] duration-300 ease-linear hover:border-[#9fa6b2] hover:!shadow-none dark:text-neutral-200"
|
||||
data-te-ripple-color="dark">
|
||||
<span hx-get="{{ url_for('goto_tag') }}" {% if person_id %}
|
||||
hx-vals='{"filter": "{{ t["TagFilter"] }}", "person_id": "{{ person_id }}"}' {% else %}
|
||||
hx-vals='{"filter": "{{ t["TagFilter"] }}"}' {% endif%} hx-target="#container" hx-push-url="true">{{
|
||||
t['TagName'] }}</span>
|
||||
hx-vals='{"filter": "{{ t["tag_filter"] }}", "person_id": "{{ person_id }}"}' {% else %}
|
||||
hx-vals='{"filter": "{{ t["tag_filter"] }}"}' {% endif%} hx-target="#container" hx-push-url="true">{{
|
||||
t['tag_name'] }}</span>
|
||||
|
||||
|
||||
<span
|
||||
class="float-right w-4 cursor-pointer pl-[8px] text-[16px] text-[#afafaf] opacity-[.53] transition-all duration-200 ease-in-out hover:text-[#8b8b8b] dark:text-neutral-400 dark:hover:text-neutral-100"
|
||||
hx-get="{{ url_for('delete_tag', tag_id=t['TagId']) }}" {% if person_id %}
|
||||
hx-vals='{"filter": "{{ t["TagFilter"] }}", "person_id": "{{ person_id }}"}' {% else %}
|
||||
hx-vals='{"filter": "{{ t["TagFilter"] }}"}' {% endif%} hx-target="#container" hx-push-url="true" _="on htmx:confirm(issueRequest)
|
||||
hx-get="{{ url_for('delete_tag', tag_id=t['tag_id']) }}" {% if person_id %}
|
||||
hx-vals='{"filter": "{{ t["tag_filter"] }}", "person_id": "{{ person_id }}"}' {% else %}
|
||||
hx-vals='{"filter": "{{ t["tag_filter"] }}"}' {% endif%} hx-target="#container" hx-push-url="true" _="on htmx:confirm(issueRequest)
|
||||
halt the event
|
||||
call Swal.fire({title: 'Confirm', text:'Are you sure you want to delete {{ t['TagName'] }} tag?'})
|
||||
call Swal.fire({title: 'Confirm', text:'Are you sure you want to delete {{ t['tag_name'] }} tag?'})
|
||||
if result.isConfirmed issueRequest()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="h-3 w-3">
|
||||
|
||||
@@ -98,9 +98,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% with person_id=person['PersonId'], tags=tags %}
|
||||
{% include 'partials/tags.html' %}
|
||||
{% endwith %}
|
||||
{{ render_partial('partials/tags.html',person_id=person['PersonId'], tags=tags) }}
|
||||
|
||||
<div class="flex flex-col mt-3 w-screen sm:w-full overflow-auto">
|
||||
<div class="overflow-x-auto rounded-lg">
|
||||
|
||||
Reference in New Issue
Block a user