2024-11-26 08:36:55 -07:00
{{ template "devtest/devtest-header" }}
2023-04-24 05:08:59 -06:00
<div class="page-content devtest ui container">
2023-07-03 00:04:50 -06:00
{{ template "base/alert" . }}
2024-04-14 11:53:52 -06:00
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
<script type="module">
2024-11-26 08:36:55 -07:00
for (const el of $('.ui.modal:not([data-skip-button])')) {
2024-04-14 11:53:52 -06:00
const $btn = $('<button class="ui button">').text(`$ { el.id}`).on('click', () => {
$(el).modal( { onApprove() { alert('confirmed')}}).modal('show');
});
$('.modal-buttons').append($btn);
}
</script>
2023-07-03 00:04:50 -06:00
2023-08-28 17:49:21 -06:00
<div id="test-modal-form-1" class="ui mini modal">
<div class="header">Form dialog (layout 1)</div>
2023-07-03 00:04:50 -06:00
<form class="content" method="post">
2024-02-27 07:31:41 -07:00
<div class="ui input tw-w-full"><input name="user_input"></div>
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-07-03 00:04:50 -06:00
</form>
</div>
2023-08-28 17:49:21 -06:00
<div id="test-modal-form-2" class="ui mini modal">
<div class="header">Form dialog (layout 2)</div>
<form method="post">
<div class="content">
2024-02-27 07:31:41 -07:00
<div class="ui input tw-w-full"><input name="user_input"></div>
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-08-28 17:49:21 -06:00
</div>
</form>
</div>
<div id="test-modal-form-3" class="ui mini modal">
<div class="header">Form dialog (layout 3)</div>
<form method="post">
<div class="content">
2024-02-27 07:31:41 -07:00
<div class="ui input tw-w-full"><input name="user_input"></div>
2023-08-28 17:49:21 -06:00
</div>
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-08-28 17:49:21 -06:00
</form>
2023-09-11 11:06:05 -06:00
</div>
<div id="test-modal-form-4" class="ui mini modal">
<div class="header">Form dialog (layout 4)</div>
<div class="content">
2024-02-27 07:31:41 -07:00
<div class="ui input tw-w-full"><input name="user_input"></div>
2023-09-11 11:06:05 -06:00
</div>
<form method="post">
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-09-11 11:06:05 -06:00
</form>
2023-08-28 17:49:21 -06:00
</div>
2023-07-03 00:04:50 -06:00
2023-04-24 05:08:59 -06:00
<div class="ui g-modal-confirm modal" id="test-modal-default">
<div class="header"> {{ svg "octicon-file" }} Default dialog <span>title</span></div>
<div class="content">
very long aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</div>
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" }}
2023-04-24 05:08:59 -06:00
</div>
<div class="ui g-modal-confirm modal" id="test-modal-confirm">
<div class="header">Confirm dialog</div>
<div class="content">hello, this is the modal dialog content</div>
2023-09-24 14:31:58 -06:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-04-24 05:08:59 -06:00
</div>
<div class="ui g-modal-confirm modal" id="test-modal-danger">
{{ svg "octicon-x" 1 6 "inside close" }}
<div class="header">dangerous action dialog</div>
<div class="content">hello, this is the modal dialog content, this is a dangerous operation</div>
{{ template "base/modal_actions_confirm" ( dict "ModalButtonDangerText" "I know and must do this is dangerous operation" ) }}
</div>
2024-11-26 08:36:55 -07:00
<div class="divider"></div>
<button class="show-modal" data-modal="#test-modal-fill-values"
data-modal-fill-by-id="value for id"
data-modal-fill-by-name="value for name"
data-modal-fill-by-class="value for class"
data-modal-p="value for tag"
data-modal-a.text-content="fill with attr"
>test-modal-fill-values</button>
<div id="test-modal-fill-values" class="ui mini modal" data-skip-button>
<div class="header">Modal dialog (fill values)</div>
<form class="content">
<div id="fill-by-id"></div>
<input name="fill-by-name">
<div class="fill-by-class"></div>
<p></p>
<a href="#">link</a>
{{ template "base/modal_actions_confirm" dict }}
</form>
</div>
2023-04-24 05:08:59 -06:00
</div>
2024-11-26 08:36:55 -07:00
{{ template "devtest/devtest-footer" }}