diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-06-27 21:58:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 13:58:38 +0000 |
commit | c1fe6fbcc36bd29549019274d39f273b3e37755d (patch) | |
tree | 22938fd15047666a750608f8aaf485a55d152014 /templates | |
parent | 9bc5552c11f6aca08c8c873a0561882b3e099350 (diff) | |
download | gitea-c1fe6fbcc36bd29549019274d39f273b3e37755d.tar.gz gitea-c1fe6fbcc36bd29549019274d39f273b3e37755d.zip |
Make toast support preventDuplicates (#31501)
make preventDuplicates default to true, users get a clear UI feedback
and know that "a new message appears".
Fixes: https://github.com/go-gitea/gitea/issues/26651
---------
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/devtest/gitea-ui.tmpl | 11 | ||||
-rw-r--r-- | templates/devtest/toast.tmpl | 15 |
2 files changed, 15 insertions, 11 deletions
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index ea293fd3b4..06d0e36569 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -183,15 +183,6 @@ </div> <div> - <h1>Toast</h1> - <div> - <button class="ui button" id="info-toast">Show Info Toast</button> - <button class="ui button" id="warning-toast">Show Warning Toast</button> - <button class="ui button" id="error-toast">Show Error Toast</button> - </div> - </div> - - <div> <h1>ComboMarkdownEditor</h1> <div>ps: no JS code attached, so just a layout</div> {{template "shared/combomarkdowneditor" .}} @@ -201,7 +192,5 @@ <div> <button class="{{if true}}tw-bg-red{{end}} tw-p-5 tw-border tw-rounded hover:tw-bg-blue active:tw-bg-yellow">Button</button> </div> - - <script src="{{AssetUrlPrefix}}/js/devtest.js?v={{AssetVersion}}"></script> </div> {{template "base/footer" .}} diff --git a/templates/devtest/toast.tmpl b/templates/devtest/toast.tmpl new file mode 100644 index 0000000000..412f23964a --- /dev/null +++ b/templates/devtest/toast.tmpl @@ -0,0 +1,15 @@ +{{template "base/head" .}} + +<div> + <h1>Toast</h1> + <div> + <button class="ui button toast-test-button" data-toast-level="info" data-toast-message="test info">Show Info Toast</button> + <button class="ui button toast-test-button" data-toast-level="warning" data-toast-message="test warning">Show Warning Toast</button> + <button class="ui button toast-test-button" data-toast-level="error" data-toast-message="test error">Show Error Toast</button> + <button class="ui button toast-test-button" data-toast-level="error" data-toast-message="very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong message">Show Error Toast (long)</button> + </div> +</div> + +<script src="{{AssetUrlPrefix}}/js/devtest.js?v={{AssetVersion}}"></script> + +{{template "base/footer" .}} |