aboutsummaryrefslogtreecommitdiffstats
path: root/templates/devtest
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-06-27 04:45:24 +0200
committerGitHub <noreply@github.com>2023-06-27 02:45:24 +0000
commitc71e8abbc331e2a68186aa11a4797ecd24ff6d27 (patch)
tree24488621201c7501bd6056053e9cca3de221fce1 /templates/devtest
parent72c60f94c1a54707ebad2af0f587c08d2e8f992c (diff)
downloadgitea-c71e8abbc331e2a68186aa11a4797ecd24ff6d27.tar.gz
gitea-c71e8abbc331e2a68186aa11a4797ecd24ff6d27.zip
Add toasts to UI (#25449)
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
Diffstat (limited to 'templates/devtest')
-rw-r--r--templates/devtest/gitea-ui.tmpl23
1 files changed, 11 insertions, 12 deletions
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl
index 2c5a54c1c2..8b31957f2e 100644
--- a/templates/devtest/gitea-ui.tmpl
+++ b/templates/devtest/gitea-ui.tmpl
@@ -1,4 +1,5 @@
{{template "base/head" .}}
+<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
<div class="page-content devtest ui container">
<div>
<h1>Button</h1>
@@ -14,11 +15,6 @@
<label><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label>
</div>
<div id="devtest-button-samples">
- <style>
- .button-sample-groups { margin: 0; padding: 0; }
- .button-sample-groups .sample-group { list-style: none; margin: 0; padding: 0; }
- .button-sample-groups .sample-group .ui.button { margin-bottom: 5px; }
- </style>
<ul class="button-sample-groups">
<li class="sample-group">
<h2>General purpose:</h2>
@@ -243,16 +239,19 @@
</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" .}}
</div>
-
- <style>
- h1, h2 {
- margin: 0;
- padding: 10px 0;
- }
- </style>
+ <script src="{{AssetUrlPrefix}}/js/devtest.js?v={{AssetVersion}}"></script>
</div>
{{template "base/footer" .}}