aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-03 14:04:50 +0800
committerGitHub <noreply@github.com>2023-07-03 14:04:50 +0800
commit45bc180a15d1edf3a20f25c4bb428819b94e6ad9 (patch)
tree79a9eb2b1b424e093b1bd45e6ccdd8fc2fd11d60 /templates
parent2aa6a785cf9b066fb0a297b1bdc3fb431fa25667 (diff)
downloadgitea-45bc180a15d1edf3a20f25c4bb428819b94e6ad9.tar.gz
gitea-45bc180a15d1edf3a20f25c4bb428819b94e6ad9.zip
Make "cancel" buttons have proper type in modal forms (#25618)
Replace #25446, fix #25438 All "cancel" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". This is a complete fix for all modal dialogs. The major change is "modules/aria/modal.js", "devtest" related code is for demo/test purpose.
Diffstat (limited to 'templates')
-rw-r--r--templates/devtest/fomantic-modal.tmpl13
1 files changed, 13 insertions, 0 deletions
diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl
index aaa4c2c12d..799bab7594 100644
--- a/templates/devtest/fomantic-modal.tmpl
+++ b/templates/devtest/fomantic-modal.tmpl
@@ -1,5 +1,18 @@
{{template "base/head" .}}
<div class="page-content devtest ui container">
+ {{template "base/alert" .}}
+
+ <button class="show-modal" data-modal="#test-modal-form">show modal form</button>
+ <div id="test-modal-form" class="ui mini modal">
+ <div class="header">Form dialog</div>
+ <form class="content" method="post">
+ <div class="ui input"><input name="user_input"></div>
+ {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonTypes" "confirm")}}
+ </form>
+ </div>
+
+ <div class="divider"></div>
+
<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">