This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<div>
|
||||
<h1>Avatar Stack</h1>
|
||||
<table class="ui basic table">
|
||||
<thead><tr><th>Scenario</th><th>Rendered</th></tr></thead>
|
||||
<tbody>
|
||||
{{range $s := .AvatarStackScenarios}}
|
||||
<tr>
|
||||
<td>{{$s.Label}}</td>
|
||||
<td>{{ctx.RenderUtils.AvatarStackWithNames $s.Data}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -4,7 +4,7 @@
|
||||
<h1>Commit Sign Badges</h1>
|
||||
{{range $commit := .MockCommits}}
|
||||
<div class="flex-text-block tw-my-2">
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $commit "CommitBaseLink" "/devtest/commit" "CommitSignVerification" $commit.Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "Commit" $commit.GitCommit "CommitBaseLink" "/devtest/commit" "CommitSignVerification" $commit.Verification}}
|
||||
{{template "repo/commit_sign_badge" dict "CommitSignVerification" $commit.Verification}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "base/head" ctx.RootData}}
|
||||
<link rel="stylesheet" href="{{AssetURI "css/devtest.css"}}">
|
||||
<link rel="stylesheet" href="{{AssetURI "web_src/css/devtest.css"}}">
|
||||
<div class="tw-hidden" data-global-init="initDevtestPage"></div>
|
||||
{{template "base/alert" .}}
|
||||
<div class="ui container tw-mt-4">{{template "base/alert" ctx.RootData}}</div>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div>
|
||||
<h1>link-action</h1>
|
||||
<div>
|
||||
Use "window.fetch" to send a request to backend, the request is defined in an "A" or "BUTTON" element.
|
||||
The request is defined in an "A" or "BUTTON" element.
|
||||
It might be renamed to "link-fetch-action" to match the "form-fetch-action".
|
||||
</div>
|
||||
<div>
|
||||
@@ -16,30 +15,20 @@
|
||||
</div>
|
||||
<div>
|
||||
<h1>form-fetch-action</h1>
|
||||
<div>Use "window.fetch" to send a form request to backend</div>
|
||||
<div>
|
||||
<form method="get" action="fetch-action-test?k=1" class="form-fetch-action">
|
||||
<div class="flex-relaxed-list fetch-action-demo-forms">
|
||||
<form method="get" action="./fetch-action-test?k=1" class="form-fetch-action">
|
||||
<button name="btn">submit get</button>
|
||||
</form>
|
||||
<form method="post" action="fetch-action-test?k=1" class="form-fetch-action">
|
||||
<form method="post" action="./fetch-action-test?k=1" class="form-fetch-action">
|
||||
<div><textarea name="text" rows="3"></textarea></div>
|
||||
<div><label><input name="check" type="checkbox"> check</label></div>
|
||||
<div><button name="btn">submit post</button></div>
|
||||
</form>
|
||||
<form method="post" action="no-such-uri" class="form-fetch-action">
|
||||
<form method="post" action="/-/no-such-uri" class="form-fetch-action">
|
||||
<div class="tw-py-8">bad action url</div>
|
||||
<div><button name="btn">submit test</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.ui.message.flash-message {
|
||||
text-align: left;
|
||||
}
|
||||
.form-fetch-action {
|
||||
margin-bottom: 1em;
|
||||
border: 1px red dashed; /* show the border for demo purpose */
|
||||
}
|
||||
</style>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
|
||||
@@ -1,28 +1,38 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest">
|
||||
<div class="ui container">
|
||||
<h1>Flex List (standalone)</h1>
|
||||
<h3>Flex Relaxed List</h3>
|
||||
<div class="flex-container tw-border">
|
||||
<div class="flex-relaxed-list tw-flex-1">
|
||||
<div class="flex-left-right">
|
||||
<span class="gt-ellipsis">left looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</span>
|
||||
<span>right</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Flex Divided List (standalone)</h3>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-info" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
Flex Item
|
||||
<span class="ui basic label">
|
||||
with label
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
consists of leading/main/trailing part
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
main part contains title and (multiple) body lines
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-alert" 14}} CJK文本测试
|
||||
</button>
|
||||
@@ -35,50 +45,50 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-info" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-title">
|
||||
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong title
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
consists of leading/main/trailing part
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content
|
||||
<span class="tw-inline-block tw-truncate">Truncate very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-alert" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-repo" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-header">
|
||||
<div class="flex-item-title">
|
||||
<div class="item-main">
|
||||
<div class="item-header">
|
||||
<div class="item-title">
|
||||
<a class="tw-text-primary" href="{{$.Link}}">
|
||||
gitea-org / gitea
|
||||
</a>
|
||||
<span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<a class="muted" href="{{$.Link}}">
|
||||
<span class="flex-text-inline"><i class="color-icon tw-mr-2 tw-bg-blue"></i>Go</span>
|
||||
<span class="flex-text-inline"><i class="color-icon tw-bg-blue"></i>Go</span>
|
||||
</a>
|
||||
<a class="tw-text-text-light flex-text-inline" href="{{$.Link}}">{{svg "octicon-star" 16}}45000</a>
|
||||
<a class="tw-text-text-light flex-text-inline" href="{{$.Link}}">{{svg "octicon-git-branch" 16}}1234</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
when inside header, the trailing part will wrap below the title
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,27 +97,49 @@
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<h1>Flex List (with "ui segment")</h1>
|
||||
<h3>Flex Divided List (with "ui segment")</h3>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">item 1</div>
|
||||
<div class="flex-item">item 2</div>
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui attached segment">
|
||||
<h1>Flex List (with "ui segment")</h1>
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">item 1</div>
|
||||
<div class="flex-item">item 2</div>
|
||||
<h4>segment header</h4>
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Flex Divided List (with "ui segment fitted", items have their own padding)</h3>
|
||||
<div class="ui fitted segment">
|
||||
<div class="flex-divided-list items-px-default">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
<div class="item">item 3</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>If parent provides the padding/margin space:</h1>
|
||||
<div class="tw-border tw-border-secondary tw-py-4">
|
||||
<div class="flex-list flex-space-fitted">
|
||||
<div class="flex-item">item 1 (no padding top)</div>
|
||||
<div class="flex-item">item 2 (no padding bottom)</div>
|
||||
<h3>If parent provides padding or items need their own flex and/or padding:</h3>
|
||||
<div class="tw-border tw-border-secondary">
|
||||
<div class="tw-m-3">before divider</div>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-divided-list flex-items-block items-px-default">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="tw-m-3">after divider</div>
|
||||
</div>
|
||||
<div class="tw-border tw-border-secondary tw-p-4 tw-my-2">
|
||||
<div>before divider</div>
|
||||
<div class="divider"></div>
|
||||
<div class="flex-divided-list">
|
||||
<div class="item">item 1</div>
|
||||
<div class="item">item 2</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div>after divider</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<h2>Dropdown</h2>
|
||||
<div>
|
||||
<div class="ui dropdown tw-border tw-border-red tw-border-dashed" data-tooltip-content="border for demo purpose only">
|
||||
<span class="text">search-input & flex-item in menu</span>
|
||||
<span class="text">search-input & flexed items in menu</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu flex-items-menu">
|
||||
<div class="ui icon search input"><i class="icon">{{svg "octicon-search"}}</i><input type="text" value="search input in menu"></div>
|
||||
|
||||
@@ -1,21 +1,9 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
|
||||
<script>
|
||||
document.addEventListener('gitea:index-ready', () => {
|
||||
for (const el of $('.ui.modal:not([data-skip-button])')) {
|
||||
const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
|
||||
$(el).modal({onApprove() {alert('confirmed')}}).modal('show');
|
||||
});
|
||||
$('.modal-buttons').append($btn);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="test-modal-form-1" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 1)</div>
|
||||
<form class="content" method="post">
|
||||
<form class="content" method="post" action="?mock_response_delay=1">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
@@ -23,7 +11,7 @@
|
||||
|
||||
<div id="test-modal-form-2" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 2)</div>
|
||||
<form method="post">
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
@@ -33,7 +21,7 @@
|
||||
|
||||
<div id="test-modal-form-3" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 3)</div>
|
||||
<form method="post">
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
</div>
|
||||
@@ -46,7 +34,7 @@
|
||||
<div class="content">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
</div>
|
||||
<form method="post">
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
</div>
|
||||
@@ -54,7 +42,7 @@
|
||||
<div id="test-modal-form-5" class="ui mini modal">
|
||||
<div class="header">Form dialog (layout 5)</div>
|
||||
<div class="content">
|
||||
<form method="post">
|
||||
<form method="post" action="?mock_response_delay=1">
|
||||
<div class="ui input tw-w-full"><input name="user_input"></div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
|
||||
</form>
|
||||
|
||||
@@ -45,17 +45,6 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<script>
|
||||
document.addEventListener('gitea:index-ready', () => {
|
||||
const $buttons = $('#devtest-button-samples').find('button.ui');
|
||||
|
||||
const $buttonStyles = $('input[name*="button-style"]');
|
||||
$buttonStyles.on('click', () => $buttonStyles.map((_, el) => $buttons.toggleClass(el.value, el.checked)));
|
||||
|
||||
const $buttonStates = $('input[name*="button-state"]');
|
||||
$buttonStates.on('click', () => $buttonStates.map((_, el) => $buttons.prop(el.value, el.checked)));
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<div>numeric: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="" year="" day="numeric" month="numeric"></relative-time></div>
|
||||
<div>weekday: <relative-time datetime="2024-03-11" threshold="P0Y" prefix="" weekday="long" year="" month="numeric"></relative-time></div>
|
||||
<div>with time: <relative-time datetime="2024-03-11T19:00:00-05:00" threshold="P0Y" prefix="" weekday="long" year="" month="numeric"></relative-time></div>
|
||||
<div>minutes: <relative-time datetime="2024-03-11T19:30:45-05:00" threshold="P0Y" prefix="" weekday="" year="numeric" month="short" hour="numeric" minute="2-digit"></relative-time></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Threshold</h2>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="page-content">
|
||||
<div class="flex-text-block tw-justify-center tw-gap-5">
|
||||
<a href="/devtest/repo-action-view/runs/10">Run:CanCancel</a>
|
||||
<a href="/devtest/repo-action-view/runs/20">Run:CanApprove</a>
|
||||
<a href="/devtest/repo-action-view/runs/30">Run:CanRerun</a>
|
||||
<a href="{{AppSubUrl}}/devtest/repo-action-view/runs/10">Run:CanCancel</a>
|
||||
<a href="{{AppSubUrl}}/devtest/repo-action-view/runs/20">Run:CanApprove</a>
|
||||
<a href="{{AppSubUrl}}/devtest/repo-action-view/runs/30">Run:CanRerunLatest</a>
|
||||
<a href="{{AppSubUrl}}/devtest/repo-action-view/runs/10/attempts/2">Run:PreviousAttempt</a>
|
||||
<a href="{{AppSubUrl}}/devtest/repo-action-view/runs/40">Run:ReusableCaller</a>
|
||||
</div>
|
||||
{{template "repo/actions/view_component" (dict
|
||||
"RunID" (or .RunID 10)
|
||||
"JobID" (or .JobID 0)
|
||||
"ActionsURL" (print AppSubUrl "/devtest/repo-action-view")
|
||||
"ActionsViewURL" $.ActionsViewURL
|
||||
)}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content">
|
||||
<div data-global-init="initDevtestDetailsErrorMessage"></div>
|
||||
<div class="ui container">
|
||||
<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>
|
||||
<button class="ui button toast-test-button-pre">Show Error (with pre)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
@@ -1,11 +0,0 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<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>
|
||||
{{template "devtest/devtest-footer"}}
|
||||
Reference in New Issue
Block a user