Remove formatting all the template

Signed-off-by: Alex Lau(AvengerMoJo) <avengermojo@gmail.com>
This commit is contained in:
Alex Lau(AvengerMoJo) 2024-04-11 14:15:16 +08:00
parent c10d144ca7
commit 32cb52662f
No known key found for this signature in database
GPG Key ID: E924333A268354EA
5 changed files with 152 additions and 155 deletions

View File

@ -3659,10 +3659,7 @@ require_action.creation.failed = Create Global Require Action %s Failed.
require_action.creation.success = Create Global Require Action %s successfully.
require_action.deletion = Delete
require_action.deletion.description = Removing the Global Require Action is permanent and cannot be undone. Continue?
require_action.deletion.success = The Global Require Action has been removed.
require_action.deletion.success = The Global Require Action has been removed.
workflow.disable = Disable Workflow
workflow.disable_success = Workflow '%s' disabled successfully.

View File

@ -1,8 +1,8 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings actions")}}
<div class="org-setting-content">
{{if eq .PageType "require_action"}}
{{template "shared/actions/require_action_list" .}}
{{else if eq .PageType "runners"}}
{{if eq .PageType "require_action"}}
{{template "shared/actions/require_action_list" .}}
{{else if eq .PageType "runners"}}
{{template "shared/actions/runner_list" .}}
{{else if eq .PageType "secrets"}}
{{template "shared/secrets/add_list" .}}

View File

@ -29,9 +29,9 @@
<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
<div class="menu">
<a class="{{if .PageIsSharedSettingsRequireAction}}active {{end}}item" href="{{.OrgLink}}/settings/actions/require_action">
{{ctx.Locale.Tr "actions.require_action"}}
</a>
<a class="{{if .PageIsSharedSettingsRequireAction}}active {{end}}item" href="{{.OrgLink}}/settings/actions/require_action">
{{ctx.Locale.Tr "actions.require_action"}}
</a>
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/actions/runners">
{{ctx.Locale.Tr "actions.runners"}}
</a>

View File

@ -20,9 +20,9 @@
{{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}}
<div class="ui red label">{{ctx.Locale.Tr "disabled"}}</div>
{{end}}
{{if $.ActionsConfig.IsGlobalWorkflowEnabled .Entry.Name}}
<div class="ui red label">{{ctx.Locale.Tr "Global Enabled"}}</div>
{{end}}
{{if $.ActionsConfig.IsGlobalWorkflowEnabled .Entry.Name}}
<div class="ui red label">{{ctx.Locale.Tr "Global Enabled"}}</div>
{{end}}
</a>
{{end}}
</div>
@ -68,10 +68,10 @@
</div>
</div>
<!-- IsGlobalWorkflowEnabled -->
<div class="ui dropdown jump item">
<span class="text">{{ctx.Locale.Tr "actions.workflow.global"}}</span>
</div>
<!-- IsGlobalWorkflowEnabled -->
<div class="ui dropdown jump item">
<span class="text">{{ctx.Locale.Tr "actions.workflow.global"}}</span>
</div>
{{if .AllowDisableOrEnableWorkflow}}
<button class="ui jump dropdown btn interact-bg tw-p-2">
{{svg "octicon-kebab-horizontal"}}
@ -79,9 +79,9 @@
<a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
</a>
<a class="item link-action" data-url="{{$.Link}}/{{if .CurGlobalWorkflowEnable}}global_disable{{else}}global_enable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
{{if .CurGlobalWorkflowEnable}}{{ctx.Locale.Tr "actions.workflow.global_disable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.global_enable"}}{{end}}
</a>
<a class="item link-action" data-url="{{$.Link}}/{{if .CurGlobalWorkflowEnable}}global_disable{{else}}global_enable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
{{if .CurGlobalWorkflowEnable}}{{ctx.Locale.Tr "actions.workflow.global_disable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.global_enable"}}{{end}}
</a>
</div>
</button>
{{end}}

View File

@ -1,145 +1,145 @@
<div class="require-actions-container">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "actions.require_action.require_action_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
<div class="ui right">
<div class="ui top right">
<button class="ui primary tiny button show-modal"
data-modal="#add-require-actions-modal"
data-modal-form.action="{{.Link}}/add"
data-modal-header="{{ctx.Locale.Tr "actions.require_action.add"}}">
{{ctx.Locale.Tr "actions.require_action.add"}}
</button>
</div>
</div>
</h4>
<div class="ui attached segment">
<form class="ui form ignore-dirty" id="require-action-list-search-form" action="{{$.Link}}">
<!-- Search Text -->
{{template "shared/search/combo" dict "Value" .Keyword}}
<button class="ui primary button">{{ctx.Locale.Tr "actions.require_action.search"}}</button>
</form>
</div>
<div class="ui attached table segment">
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th data-sortt-asc="newest" data-sortt-desc="oldest">
{{ctx.Locale.Tr "actions.require_action.id"}}
</th>
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
{{ctx.Locale.Tr "actions.require_action.workflow"}}
</th>
<th>{{ctx.Locale.Tr "actions.require_action.repo"}}</th>
<th>{{ctx.Locale.Tr "actions.require_action.link"}}</th>
<th>{{ctx.Locale.Tr "actions.require_action.remove"}}</th>
</tr>
</thead>
<tbody>
{{if .RequireActions}}
{{range .RequireActions}}
<tr>
<td>{{.ID}}</td>
<td><p data-tooltip-content="{{.RepoName}}">{{.WorkflowName}}</p></td>
<td>{{.RepoName}}</td>
<td><a href="/{{$.OrgName}}/{{.RepoName}}">Workflow Link</a></td>
<td class="require_action-ops">
{{if .Removable $.OrgID}}
<button class="btn interact-bg tw-p-2 link-action"
data-tooltip-content="{{ctx.Locale.Tr "actions.require_action.deletion"}}"
data-url="{{$.Link}}/{{.ID}}/delete"
data-modal-confirm="{{ctx.Locale.Tr "actions.require_action.deletion.description"}}"
>
{{svg "octicon-trash"}}
</button>
<!-- <a href="{{$.Link}}/{{.ID}}/delete">{{svg "octicon-x-circle-fill"}}</a>-->
{{end}}
</td>
</tr>
{{end}}
{{else}}
<tr>
<td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.require_action.none"}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{template "base/paginate"}}
<h4 class="ui top attached header">
{{ctx.Locale.Tr "actions.require_action.require_action_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
<div class="ui right">
<div class="ui top right">
<button class="ui primary tiny button show-modal"
data-modal="#add-require-actions-modal"
data-modal-form.action="{{.Link}}/add"
data-modal-header="{{ctx.Locale.Tr "actions.require_action.add"}}">
{{ctx.Locale.Tr "actions.require_action.add"}}
</button>
</div>
</div>
</h4>
<div class="ui attached segment">
<form class="ui form ignore-dirty" id="require-action-list-search-form" action="{{$.Link}}">
<!-- Search Text -->
{{template "shared/search/combo" dict "Value" .Keyword}}
<button class="ui primary button">{{ctx.Locale.Tr "actions.require_action.search"}}</button>
</form>
</div>
<div class="ui attached table segment">
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th data-sortt-asc="newest" data-sortt-desc="oldest">
{{ctx.Locale.Tr "actions.require_action.id"}}
</th>
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
{{ctx.Locale.Tr "actions.require_action.workflow"}}
</th>
<th>{{ctx.Locale.Tr "actions.require_action.repo"}}</th>
<th>{{ctx.Locale.Tr "actions.require_action.link"}}</th>
<th>{{ctx.Locale.Tr "actions.require_action.remove"}}</th>
</tr>
</thead>
<tbody>
{{if .RequireActions}}
{{range .RequireActions}}
<tr>
<td>{{.ID}}</td>
<td><p data-tooltip-content="{{.RepoName}}">{{.WorkflowName}}</p></td>
<td>{{.RepoName}}</td>
<td><a href="/{{$.OrgName}}/{{.RepoName}}">Workflow Link</a></td>
<td class="require_action-ops">
{{if .Removable $.OrgID}}
<button class="btn interact-bg tw-p-2 link-action"
data-tooltip-content="{{ctx.Locale.Tr "actions.require_action.deletion"}}"
data-url="{{$.Link}}/{{.ID}}/delete"
data-modal-confirm="{{ctx.Locale.Tr "actions.require_action.deletion.description"}}"
>
{{svg "octicon-trash"}}
</button>
<!-- <a href="{{$.Link}}/{{.ID}}/delete">{{svg "octicon-x-circle-fill"}}</a>-->
{{end}}
</td>
</tr>
{{end}}
{{else}}
<tr>
<td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.require_action.none"}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{template "base/paginate"}}
</div>
{{/* Add RequireAction dialog */}}
<div class="ui small modal" id="add-require-actions-modal">
<div class="header">
<span id="actions-modal-header">Enable Workflows</span>
</div>
<form class="ui form form-fetch-action" method="post">
<div class="content">
<div class="item">
<a href="https://docs.gitea.com/usage/actions/require-action">{{ctx.Locale.Tr "actions.require_action.enable_global_workflow"}}</a>
</div>
<div class="divider"></div>
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
{{ctx.Locale.Tr "actions.require_action.workflow"}}
</th>
<th>
{{ctx.Locale.Tr "actions.require_action.repo"}}
</th>
</tr>
</thead>
<tbody>
{{if .GlobalEnableWorkflows}}
{{range .GlobalEnableWorkflows}}
<tr>
<td><div class="field">
<div class="ui radio checkbox">
<input class="select-org-radio" name="workflow_name" type="radio" value="{{.Filename}}">
<label>{{.Filename}}</label>
</div>
<input name="repo_name" type="hidden" value="{{.RepoName}}">
</div></td>
<td><div class="field">
<a href="/{{$.OrgName}}/{{.RepoName}}">
<label>{{.RepoName}}</label>
</a>
</div></td>
</tr>
{{end}}
{{else}}
<tr>
<td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.require_action.none"}}</td>
</tr>
{{end}}
</tbody>
</table>
<div class="divider"></div>
<div class="item">
<a href="{{$.Link}}/add">{{ctx.Locale.Tr "actions.require_action.add_require_action"}}</a>
</div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
<div class="header">
<span id="actions-modal-header">Enable Workflows</span>
</div>
<form class="ui form form-fetch-action" method="post">
<div class="content">
<div class="item">
<a href="https://docs.gitea.com/usage/actions/require-action">{{ctx.Locale.Tr "actions.require_action.enable_global_workflow"}}</a>
</div>
<div class="divider"></div>
<table class="ui very basic striped table unstackable">
<thead>
<tr>
<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
{{ctx.Locale.Tr "actions.require_action.workflow"}}
</th>
<th>
{{ctx.Locale.Tr "actions.require_action.repo"}}
</th>
</tr>
</thead>
<tbody>
{{if .GlobalEnableWorkflows}}
{{range .GlobalEnableWorkflows}}
<tr>
<td><div class="field">
<div class="ui radio checkbox">
<input class="select-org-radio" name="workflow_name" type="radio" value="{{.Filename}}">
<label>{{.Filename}}</label>
</div>
<input name="repo_name" type="hidden" value="{{.RepoName}}">
</div></td>
<td><div class="field">
<a href="/{{$.OrgName}}/{{.RepoName}}">
<label>{{.RepoName}}</label>
</a>
</div></td>
</tr>
{{end}}
{{else}}
<tr>
<td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.require_action.none"}}</td>
</tr>
{{end}}
</tbody>
</table>
<div class="divider"></div>
<div class="item">
<a href="{{$.Link}}/add">{{ctx.Locale.Tr "actions.require_action.add_require_action"}}</a>
</div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
</div>
<script>
window.addEventListener('DOMContentLoaded', function() {
var checkboxes = document.querySelectorAll('.ui.radio.checkbox');
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
var hiddenInput = this.nextElementSibling;
var isChecked = this.querySelector('input[type="radio"]').checked;
hiddenInput.disabled = !isChecked;
// Disable other hidden inputs
checkboxes.forEach(function(otherCheckbox) {
var otherHiddenInput = otherCheckbox.nextElementSibling;
if (otherCheckbox !== checkbox) {
otherHiddenInput.disabled = isChecked;
}
});
});
});
});
window.addEventListener('DOMContentLoaded', function() {
var checkboxes = document.querySelectorAll('.ui.radio.checkbox');
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
var hiddenInput = this.nextElementSibling;
var isChecked = this.querySelector('input[type="radio"]').checked;
hiddenInput.disabled = !isChecked;
// Disable other hidden inputs
checkboxes.forEach(function(otherCheckbox) {
var otherHiddenInput = otherCheckbox.nextElementSibling;
if (otherCheckbox !== checkbox) {
otherHiddenInput.disabled = isChecked;
}
});
});
});
});
</script>