Skip to content

Commit 83e9ee0

Browse files
committed
add template for opener button
1 parent 388b56a commit 83e9ee0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/argus/htmx/modals.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Modal(RenderableMixin, BaseModel):
1313

1414
model_config = {"arbitrary_types_allowed": True}
1515

16+
opener_button_template_name: str = "htmx/_base_form_modal_opener_button.html"
1617
template_name: str = "htmx/_base_form_modal_experimental.html"
1718

1819
# needed by template

src/argus/htmx/templates/htmx/_base_form_modal_experimental.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<button class="btn {{ modal.button_class }}"
2-
type="button"
3-
onclick="htmx.find('#{{ modal.dialog_id }}').showModal()">{{ modal.button_title }}</button>
1+
{% include modal.opener_button_template_name %}
42
<dialog id="{{ modal.dialog_id }}" class="modal">
53
<div class="modal-box card card-compact shadow-xl loading-box">
64
<div class="w-full">

0 commit comments

Comments
 (0)