feat: modal component, edit functionality

This commit is contained in:
Per Stark
2025-02-11 13:46:17 +01:00
parent aa8574f4ce
commit f92e97e541
9 changed files with 171 additions and 10 deletions

View File

@@ -0,0 +1,31 @@
{% extends "modal_base.html" %}
{% block form_attributes %}
hx-patch="/knowledge-entity/{{entity.id}}"
hx-target="#entity-list"
hx-swap="outerHTML"
{% endblock %}
{% block modal_content %}
<h3 class="text-lg font-bold mb-4">Edit Entity</h3>
<div class="form-control">
<label class="label">
<span class="label-text">Entity Name</span>
</label>
<input type="text" name="name" value="{{ entity.name }}" class="input input-bordered">
</div>
<div class="form-control mt-4">
<label class="label">
<span class="label-text">Description</span>
</label>
<textarea name="description" class="textarea textarea-bordered h-32">{{ entity.description }}</textarea>
</div>
{% endblock %}
{% block primary_actions %}
<button type="submit" class="btn btn-primary">
Save Changes
</button>
{% endblock %}