mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
Replace Fomantic's hard-forked jQuery modal with native `<dialog>` elements, advancing https://github.com/go-gitea/gitea/issues/29849. The UI is visually unchanged. Dialogs open with `show()` over an `inert` page, so tooltips, popups and toasts mounted on `<body>` stay usable above them, unlike with `showModal()` (https://github.com/whatwg/html/issues/9936). - Remove the Fomantic modal and dimmer, add `showModal` and `hideModal` - Declare modals as `<dialog class="modal-dialog">`, shown inside a `.modal-backdrop`, instead of `ui modal` with its unused size classes - Remove two modals that could never be opened - Block the page while a modal is open, close the topmost one on Escape and restore focus to its opener - Allow stacked modals, use a confirm modal instead of `window.confirm` for deleting content history - Hide popups and toasts when a modal opens or closes - Keep the release notes modal open when generating notes fails Fixes: https://github.com/go-gitea/gitea/issues/39643 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
164 lines
7.4 KiB
Handlebars
164 lines
7.4 KiB
Handlebars
{{template "base/head" .}}
|
|
|
|
{{$showCreateWorkflowBadge := Iif .WorkflowBadge true false}}
|
|
{{$showEnableDisableWorkflow := and .AllowDisableOrEnableWorkflow .CurWorkflowIsListed $.CurWorkflow}}
|
|
|
|
<div class="page-content repository actions">
|
|
{{template "repo/header" .}}
|
|
<div class="ui container">
|
|
{{template "base/alert" .}}
|
|
|
|
{{if .HasWorkflowsOrRuns}}
|
|
<div class="flex-container">
|
|
{{template "repo/actions/sidebar" .}}
|
|
<div class="flex-container-main">
|
|
<div class="ui top attached header flex-left-right">
|
|
<strong>{{ctx.Locale.TrN .Page.Paginator.Total "actions.runs.workflow_run_count_1" "actions.runs.workflow_run_count_n" .Page.Paginator.Total}}</strong>
|
|
<div class="ui secondary filter menu flex-text-block tw-m-0">
|
|
<!-- Actor -->
|
|
<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}&actor=0">
|
|
{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
|
|
</a>
|
|
{{range .Actors}}
|
|
<a class="item{{if eq .ID $.CurActor}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.ID}}&status={{$.CurStatus}}&branch={{$.CurBranch}}">
|
|
{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<!-- Status -->
|
|
<div class="ui dropdown jump item">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&branch={{$.CurBranch}}&status=0">
|
|
{{ctx.Locale.Tr "actions.runs.status_no_select"}}
|
|
</a>
|
|
{{range .StatusInfoList}}
|
|
<a class="item{{if eq .Status $.CurStatus}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{.Status}}&branch={{$.CurBranch}}">
|
|
<span class="flex-text-inline tw-gap-2">
|
|
{{template "repo/icons/action_status" (dict "Status" .StatusName)}}
|
|
{{.DisplayedStatus}}
|
|
</span>
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<!-- Branch -->
|
|
<div class="ui{{if not .RunBranches}} disabled{{end}} dropdown jump item" data-test-id="filter-branch">
|
|
<span class="text">{{ctx.Locale.Tr "actions.runs.branch"}}</span>
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="ui icon search input">
|
|
<i class="icon">{{svg "octicon-search"}}</i>
|
|
<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.branch"}}">
|
|
</div>
|
|
<a class="item{{if not $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}">
|
|
{{ctx.Locale.Tr "actions.runs.branches_no_select"}}
|
|
</a>
|
|
{{range .RunBranches}}
|
|
<a class="item{{if eq . $.CurBranch}} selected{{end}}" href="?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{.}}">
|
|
{{.}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if or $showCreateWorkflowBadge $showEnableDisableWorkflow}}
|
|
<button type="button" class="ui jump dropdown btn interact-bg tw-p-2">
|
|
{{svg "octicon-kebab-horizontal"}}
|
|
<div class="menu">
|
|
{{if $showCreateWorkflowBadge}}
|
|
<div class="item show-modal" data-modal="#workflow-status-badge-modal">
|
|
{{ctx.Locale.Tr "actions.workflow.create_status_badge"}}
|
|
</div>
|
|
{{end}}
|
|
{{if $showEnableDisableWorkflow}}
|
|
<a class="item {{if .CurWorkflowRequired}}disabled{{else}}link-action{{end}}"{{if not .CurWorkflowRequired}} data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}"{{end}}>
|
|
{{if .CurWorkflowRequired}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{else if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</button>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if .WorkflowDispatchConfig}}
|
|
{{template "repo/actions/workflow_dispatch" .}}
|
|
{{end}}
|
|
|
|
<div class="ui attached segment">
|
|
{{template "repo/actions/runs_list" dict "ActionRunListData" $.ActionRunListData}}
|
|
{{template "base/paginate" dict "Page" $.Page}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
{{template "repo/actions/no_workflows" .}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if $showCreateWorkflowBadge}}
|
|
<dialog id="workflow-status-badge-modal" class="modal-dialog">
|
|
<div class="header">{{ctx.Locale.Tr "actions.workflow.status_badge"}}</div>
|
|
<div class="content">
|
|
<div class="ui form" data-global-init="initWorkflowBadgeForm"
|
|
data-badge-url="{{.WorkflowBadge.BadgeURL}}"
|
|
data-workflow-url="{{.WorkflowBadge.WorkflowURL}}"
|
|
data-workflow-display-name="{{.WorkflowBadge.DisplayName}}"
|
|
>
|
|
<div class="field">
|
|
<img data-workflow-badge-image src="{{.WorkflowBadge.BadgeURL}}" alt="{{.CurWorkflow}}">
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "actions.runs.branch"}}</label>
|
|
<div class="ui selection dropdown">
|
|
<input type="hidden" data-workflow-badge-branch value="{{.Repository.DefaultBranch}}">
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="text">{{.Repository.DefaultBranch}}</div>
|
|
<div class="menu">
|
|
<div class="item selected" data-value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</div>
|
|
{{range $branchName := .RunBranches}}
|
|
{{if ne $branchName $.Repository.DefaultBranch}}
|
|
<div class="item" data-value="{{$branchName}}">{{$branchName}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "actions.workflow.status_badge_url"}}</label>
|
|
<div class="ui action input">
|
|
<input id="workflow-badge-url" readonly autofocus>
|
|
<button type="button" class="ui icon button" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-target="#workflow-badge-url">{{svg "octicon-copy" 14}}</button>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label>Markdown</label>
|
|
<textarea id="workflow-badge-markdown" rows="2" readonly></textarea>
|
|
</div>
|
|
<div class="field">
|
|
<label>HTML</label>
|
|
<textarea id="workflow-badge-html" rows="2" readonly></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</dialog>
|
|
{{end}}
|
|
|
|
{{template "base/footer" .}}
|