fix: use button to replace anchor elements without href (#40338)

Elements `<a>` without `href` are not focus-able, screen readers didn't
expose it as a button.

Use `<button type="button">` for these elements, and fix what the
conversion exposed:

- Disabled reactions and the copy-content button use `aria-disabled`,
because native `disabled` suppresses their tooltips
- The random label color button gets a label
- Hover, disabled and alignment styles that only matched `<a>` apply to
the buttons
- Unpinning an issue with the keyboard works, and removing a
non-permitted "blocked by" dependency sends the right type

Fixes: https://github.com/go-gitea/gitea/issues/40337

Assisted-by: Claude Code:claude-opus-5-5

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
authored and GitHub committed 2026-11-16 17:48:41 +00:00
1 parent 2f89c68b64
commit 8b48b45def
51 files changed
+162 -147

No files matched your search

+1
View File
@@ -1566,6 +1566,7 @@
"repo.issues.label_description": "Description",
"repo.issues.label_color": "Color",
"repo.issues.label_color_invalid": "Invalid color",
"repo.issues.label_color_random": "Generate random color",
"repo.issues.label_exclusive": "Exclusive",
"repo.issues.label_archive": "Archive Label",
"repo.issues.label_archived_filter": "Show archived labels",
+2 -2
View File
@@ -25,9 +25,9 @@
</div>
</div>
<div class="item-trailing">
<a class="ui red tiny button inline link-action" data-url="{{$.Link}}/delete?id={{.ID}}" data-modal-confirm="{{ctx.Locale.Tr "admin.badges.delete_user_desc"}}">
<button type="button" class="ui red tiny button link-action" data-url="{{$.Link}}/delete?id={{.ID}}" data-modal-confirm="{{ctx.Locale.Tr "admin.badges.delete_user_desc"}}">
{{ctx.Locale.Tr "admin.badges.remove_user"}}
</a>
</button>
</div>
</div>
{{end}}
+3 -2
View File
@@ -17,10 +17,11 @@
</div>
<div>
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}}
<a class="link-action" data-url="{{ctx.RootData.Link}}/cancel/{{.Process.PID}}"
<button type="button" class="btn link-action" data-url="{{ctx.RootData.Link}}/cancel/{{.Process.PID}}"
data-tooltip-content="{{ctx.Locale.Tr "cancel"}}"
data-modal-confirm-header="{{ctx.Locale.Tr "admin.monitor.process.cancel"}}"
data-modal-confirm-content="{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}"
>{{svg "octicon-trash" 16 "tw-text-red"}}</a>
>{{svg "octicon-trash" 16 "tw-text-red"}}</button>
{{end}}
</div>
</div>
+9 -14
View File
@@ -37,11 +37,16 @@
<button type="button" class="ui basic green button">Basic Green</button>
</li>
<li class="sample-group">
<h2>Inline / Plain:</h2>
<h2>Button reset and interact</h2>
<div class="tw-my-1">
<button type="button" class="btn tw-p-2">Plain button</button>
<button type="button" class="btn interact-fg tw-p-2">Plain button with interact fg</button>
<button type="button" class="btn interact-bg tw-p-2">Plain button with interact bg</button>
<button type="button" class="btn">btn reset</button>
<button type="button" class="btn interact-fg tw-p-2">btn interact-fg</button>
<button type="button" class="btn interact-link tw-p-2">btn interact-link</button>
<button type="button" class="btn interact-bg tw-p-2">btn interact-bg</button>
</div>
<div class="tw-my-1">
<button type="button" class="interact-fg">interact-fg</button>
<button type="button" class="interact-link">interact-link</button>
</div>
</li>
</ul>
@@ -147,15 +152,5 @@
</div>
</div>
</div>
<div>
<h1>ComboMarkdownEditor</h1>
{{template "shared/combomarkdowneditor" dict "MarkdownEditorContext" (ctx.MiscUtils.MarkdownEditorGeneral nil)}}
</div>
<h1>Tailwind CSS Demo</h1>
<div>
<button type="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>
</div>
{{template "devtest/devtest-footer"}}
@@ -47,6 +47,7 @@
data-locale-show-full-screen="{{ctx.Locale.Tr "show_full_screen"}}"
data-locale-download-logs="{{ctx.Locale.Tr "download_logs"}}"
data-locale-download-file="{{ctx.Locale.Tr "repo.download_file"}}"
data-locale-delete-file="{{ctx.Locale.Tr "repo.editor.delete_this_file"}}"
data-locale-copy-output="{{ctx.Locale.Tr "copy_output"}}"
data-locale-logs-always-auto-scroll="{{ctx.Locale.Tr "actions.logs.always_auto_scroll"}}"
data-locale-logs-always-expand-running="{{ctx.Locale.Tr "actions.logs.always_expand_running"}}"
@@ -8,11 +8,11 @@
<dialog id="runWorkflowDispatchModal" class="modal-dialog">
<div class="content">
<form id="runWorkflowDispatchForm" class="ui form ignore-dirty" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}&actor={{$.CurActor}}&status={{$.CurStatus}}&branch={{$.CurBranch}}" method="post">
<div class="ui inline field required tw-flex tw-items-center">
<div class="inline field required tw-flex tw-items-center">
<span class="ui inline required field">
<label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label>
</span>
<div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-text-items">
<div class="ui dropdown button select-branch branch-selector-dropdown ellipsis-text-items">
<input type="hidden" name="ref" value="refs/heads/{{index .Branches 0}}"
data-fetch-trigger="change" data-fetch-sync="$body #runWorkflowDispatchModalInputs"
data-fetch-url="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}&scoped_workflow_source_repo_id={{$.CurWorkflowRepoID}}"
+2 -2
View File
@@ -79,9 +79,9 @@
{{/*FIXME: the "HasSourceRenderedToggle" is never set on blame page, it should mean "whether the file is renderable".
If the file is renderable, then it must has the "display=source" parameter to make sure the file view page shows the source code, then line number works. */}}
{{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
<a class="item ref-in-new-issue" role="menuitem" href="#" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
{{end}}
<a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
<button type="button" class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</button>
</div>
</div>
</div>
+3 -3
View File
@@ -173,7 +173,7 @@
<div class="tw-p-3">
{{if $file.IsIncomplete}}
{{ctx.Locale.Tr "repo.diff.file_suppressed"}}
<a class="ui basic tiny button" data-global-click="diffLoadFileBody" data-href="?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{ctx.Locale.Tr "repo.diff.load"}}</a>
<button type="button" class="ui basic tiny button" data-global-click="diffLoadFileBody" data-href="?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{ctx.Locale.Tr "repo.diff.load"}}</button>
{{else}}
{{ctx.Locale.Tr "repo.diff.bin_not_shown"}}
{{end}}
@@ -226,10 +226,10 @@
<span id="diff-load-progress" class="tw-text-text-light-2" data-text-too-many-files="{{ctx.Locale.Tr "repo.diff.too_many_files"}}">
{{ctx.Locale.Tr "repo.diff.too_many_files" (len .Diff.Files) .DiffShortStat.NumFiles}}
</span>
<a class="ui basic tiny button" id="diff-show-more-files" data-global-click="diffLoadMoreFiles" data-href="?skip-to={{.Diff.End}}&file-only=true"
<button type="button" class="ui basic tiny button" id="diff-show-more-files" data-global-click="diffLoadMoreFiles" data-href="?skip-to={{.Diff.End}}&file-only=true"
data-text-default="{{ctx.Locale.Tr "repo.diff.show_more"}}"
data-text-matching="{{ctx.Locale.Tr "repo.diff.show_more_matching"}}"
>{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
>{{ctx.Locale.Tr "repo.diff.show_more"}}</button>
</div>
{{end}}
</div>
+1 -1
View File
@@ -203,7 +203,7 @@
{{else if .CanCreatePullRequest}}
<div class="ui info message flex-text-block pullrequest-form-toggle {{if .ExpandNewPrForm}}tw-hidden{{end}}">
<span class="tw-flex-1">{{ctx.Locale.Tr "repo.pulls.new.description"}}</span>
<a class="ui button primary show-panel toggle" data-panel=".pullrequest-form-toggle, .pullrequest-form">{{ctx.Locale.Tr "repo.pulls.new"}}</a>
<button type="button" class="ui button primary show-panel toggle" data-panel=".pullrequest-form-toggle, .pullrequest-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
</div>
<div class="pullrequest-form {{if not .ExpandNewPrForm}}tw-hidden{{end}}">
{{template "repo/issue/new_form" .}}
+1 -1
View File
@@ -19,7 +19,7 @@
<input type="hidden" name="commit_id" value="{{.ReviewCommitID}}">
<div class="field flex-text-block">
<b class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</b>
<a class="muted close-review-panel">{{svg "octicon-x" 16}}</a>
<button type="button" class="btn interact-fg close-review-panel" aria-label="{{ctx.Locale.Tr "cancel"}}">{{svg "octicon-x" 16}}</button>
</div>
<div class="field">
{{template "shared/combomarkdowneditor" (dict
+8 -8
View File
@@ -15,28 +15,28 @@
</button>
<div class="tippy-target">
{{$testParticipating := ctx.Locale.Tr "repo.watch.mode.participating"}}
<a class="item{{if $isParticipating}} active{{end}}" role="menuitem" aria-label="{{$testParticipating}}"
<button type="button" class="item {{if $isParticipating}}active{{end}}" role="menuitem" aria-label="{{$testParticipating}}"
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/participate" data-fetch-sync="$body #repo-header-watch"
>
{{svg "octicon-check" 16 (Iif $isParticipating "" "tw-invisible")}}
<div>{{$testParticipating}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.participating.desc"}}</div></div>
</a>
</button>
{{$textAll := ctx.Locale.Tr "repo.watch.mode.all"}}
<a class="item{{if $isAll}} active{{end}}" role="menuitem" aria-label="{{$textAll}}"
<button type="button" class="item {{if $isAll}}active{{end}}" role="menuitem" aria-label="{{$textAll}}"
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/watch" data-fetch-sync="$body #repo-header-watch"
>
{{svg "octicon-check" 16 (Iif $isAll "" "tw-invisible")}}
<div>{{$textAll}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.all.desc"}}</div></div>
</a>
</button>
{{$textIgnore := ctx.Locale.Tr "repo.watch.mode.ignore"}}
<a class="item{{if $isIgnoring}} active{{end}}" role="menuitem" aria-label="{{$textIgnore}}"
<button type="button" class="item {{if $isIgnoring}}active{{end}}" role="menuitem" aria-label="{{$textIgnore}}"
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/ignore" data-fetch-sync="$body #repo-header-watch"
>
{{svg "octicon-check" 16 (Iif $isIgnoring "" "tw-invisible")}}
<div>{{$textIgnore}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.ignore.desc"}}</div></div>
</a>
</button>
{{$textCustom := ctx.Locale.Tr "repo.watch.mode.custom"}}
<a class="item {{if $isCustom}}active{{end}} show-modal" role="menuitem" aria-label="{{$textCustom}}"
<button type="button" class="item {{if $isCustom}}active{{end}} show-modal" role="menuitem" aria-label="{{$textCustom}}"
data-modal="#repo-watch-options-modal"
data-modal-form.url="{{$.RepoLink}}/action/watch/options"
data-modal-issues="{{$.RepoWatch.IncludeIssues}}"
@@ -45,7 +45,7 @@
>
{{svg "octicon-check" 16 (Iif $isCustom "" "tw-invisible")}}
<div>{{$textCustom}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.custom.desc"}}</div></div>
</a>
</button>
</div>
{{else}}
<a role="button" class="ui compact small basic button" href="{{AppSubUrl}}/user/login" aria-label="{{$buttonText}}" data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}">
+2 -2
View File
@@ -16,9 +16,9 @@
</div>
<a class="issue-card-title muted issue-title tw-break-anywhere" href="{{.Link}}">{{.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
{{if and $.isPinnedIssueCard $.Page.IsRepoAdmin}}
<a role="button" class="issue-card-unpin muted flex-text-inline" data-tooltip-content={{ctx.Locale.Tr "repo.issues.unpin"}} data-issue-id="{{.ID}}" data-unpin-url="{{$.Page.Link}}/unpin/{{.Index}}">
<button type="button" class="btn interact-fg issue-card-unpin" data-tooltip-content={{ctx.Locale.Tr "repo.issues.unpin"}} data-issue-id="{{.ID}}" data-unpin-url="{{$.Page.Link}}/unpin/{{.Index}}">
{{svg "octicon-x" 16}}
</a>
</button>
{{end}}
</div>
<div class="meta">
+18 -18
View File
@@ -1,27 +1,27 @@
<div class="precolors">
<button type="button" class="ui button generate-random-color">
<button type="button" class="ui button generate-random-color" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_color_random"}}">
{{svg "octicon-sync"}}
</button>
<div>
<div aria-hidden="true">{{/* no good support for aria for these colors */}}
<div class="tw-flex">
<a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a>
<a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a>
<a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a>
<a class="color" style="background-color:#009800" data-color-hex="#009800"></a>
<a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
<a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
<a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
<a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a>
<button type="button" class="color" tabindex="-1" style="background-color:#e11d21" data-color-hex="#e11d21"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#eb6420" data-color-hex="#eb6420"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#fbca04" data-color-hex="#fbca04"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#009800" data-color-hex="#009800"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#006b75" data-color-hex="#006b75"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#207de5" data-color-hex="#207de5"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#0052cc" data-color-hex="#0052cc"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#5319e7" data-color-hex="#5319e7"></button>
</div>
<div class="tw-flex">
<a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
<a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
<a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
<a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a>
<a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a>
<a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a>
<a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a>
<a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
<button type="button" class="color" tabindex="-1" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#fad8c7" data-color-hex="#fad8c7"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#fef2c0" data-color-hex="#fef2c0"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#bfdadc" data-color-hex="#bfdadc"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#c7def8" data-color-hex="#c7def8"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></button>
<button type="button" class="color" tabindex="-1" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></button>
</div>
</div>
</div>
+1 -1
View File
@@ -29,7 +29,7 @@
<div class="field {{if .Err_Deadline}}error{{end}}">
<label>
{{ctx.Locale.Tr "repo.milestones.due_date"}}
<a id="milestone-clear-deadline">{{ctx.Locale.Tr "repo.milestones.clear"}}</a>
<button type="button" class="interact-fg" id="milestone-clear-deadline">{{ctx.Locale.Tr "repo.milestones.clear"}}</button>
</label>
<input type="date" name="deadline" class="tw-w-auto" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}">
</div>
@@ -9,9 +9,9 @@
>
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="fixed-text muted">
<span class="interact-fg fixed-text">
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
</span>
<div class="menu">
<div class="ui icon search input">
<i class="icon">{{svg "octicon-search" 16}}</i>
+2 -2
View File
@@ -8,8 +8,8 @@
</div>
<div class="flex-text-block">
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
<a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil"}}</a>
<a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
<button type="button" class="btn interact-fg issue-due-edit" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil"}}</button>
<button type="button" class="btn interact-fg issue-due-remove" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</button>
{{end}}
</div>
</div>
@@ -31,11 +31,11 @@
</div>
<div class="item-right">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
<button type="button" class="btn interact-fg show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
</button>
{{end}}
</div>
</div>
@@ -65,11 +65,11 @@
</div>
<div class="item-right">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
<button type="button" class="btn interact-fg show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blockedBy"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
</button>
{{end}}
</div>
</div>
@@ -90,11 +90,11 @@
</div>
<div class="item-right">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
<a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
<button type="button" class="btn interact-fg show-modal" data-modal="#issue-remove-dependency-confirm"
data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blockedBy"
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
</button>
{{end}}
</div>
</div>
+2 -2
View File
@@ -6,9 +6,9 @@
>
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="fixed-text muted">
<span class="interact-fg fixed-text">
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
</span>
<div class="menu">
{{if not $data.AllLabels}}
<div class="item disabled">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
@@ -7,9 +7,9 @@
>
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="fixed-text muted">
<span class="interact-fg fixed-text">
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
</span>
<div class="menu">
{{if and (not $data.OpenMilestones) (not $data.ClosedMilestones)}}
<div class="item disabled">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
@@ -8,9 +8,9 @@
>
<input class="combo-value" name="project_ids" type="hidden" value="{{SliceUtils.JoinInt64 $data.SelectedProjectIDs}}">
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="fixed-text muted">
<span class="interact-fg fixed-text">
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
</span>
<div class="menu">
{{if or $data.OpenProjects $data.ClosedProjects}}
<div class="ui icon search input">
@@ -7,9 +7,9 @@
>
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
<div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
<a class="fixed-text muted">
<span class="interact-fg fixed-text">
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
</a>
</span>
<div class="menu flex-items-menu">
{{if $hasCandidates}}
<div class="ui icon search input">
+2 -2
View File
@@ -1,5 +1,5 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
<a data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
<button type="button" class="interact-fg" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
</a>
</button>
{{end}}
@@ -72,7 +72,7 @@ The variables in "ctx.Data" are different in each case, making this template fra
<div class="comment-header">
<div class="comment-header-left">
{{if not $comment.OriginalAuthor}}
<a class="avatar">{{ctx.AvatarUtils.Avatar $comment.Poster 20}}</a>
<span class="avatar">{{ctx.AvatarUtils.Avatar $comment.Poster 20}}</span>
{{end}}
<span class="tw-text-text-light muted-links">
{{if $comment.OriginalAuthor}}
+1 -1
View File
@@ -56,7 +56,7 @@
{{if .Issue.IsPull}}
{{$headHref := .HeadTarget}}
{{if .HeadBranchLink}}
{{$headHref = HTMLFormat `<a href="%s">%s</a> <button type="button" class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
{{$headHref = HTMLFormat `<a href="%s">%s</a> <button type="button" class="btn interact-fg tw-align-[calc(0.5cap-7px)]" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
{{else}}
{{if .Issue.PullRequest.IsAgitFlow}}
{{$headHref = HTMLFormat `%s <a href="%s" target="_blank"><span class="ui label basic tiny" data-tooltip-content="%s">AGit</span></a>` $headHref "https://docs.gitea.com/usage/agit" (ctx.Locale.Tr "repo.pull.agit_documentation")}}
+2 -2
View File
@@ -32,7 +32,7 @@
</div>
{{else}}
<div class="stats-table">
<a class="table-cell tiny tw-bg-grey"></a>
<span class="table-cell tiny tw-bg-grey"></span>
</div>
{{end}}
{{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount}}
@@ -49,7 +49,7 @@
</div>
{{else}}
<div class="stats-table">
<a class="table-cell tiny tw-bg-grey"></a>
<span class="table-cell tiny tw-bg-grey"></span>
</div>
{{end}}
{{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount}}
+4 -4
View File
@@ -87,9 +87,9 @@
{{svg "octicon-info"}}
</span>
</div>
<a class="ui mini compact red button" data-global-click="onReleaseEditAttachmentDelete" data-id="{{.ID}}" data-uuid="{{.UUID}}">
<button type="button" class="ui mini compact red button" data-global-click="onReleaseEditAttachmentDelete" data-id="{{.ID}}" data-uuid="{{.UUID}}">
{{ctx.Locale.Tr "remove"}}
</a>
</button>
</div>
{{end}}
{{if .IsAttachmentEnabled}}
@@ -130,11 +130,11 @@
<a class="ui small button" href="{{.RepoLink}}/releases">
{{ctx.Locale.Tr "repo.release.cancel"}}
</a>
<a class="ui small red button link-action"
<button type="button" class="ui small red button link-action"
data-modal-confirm-header="{{ctx.Locale.Tr "repo.release.deletion"}}" data-modal-confirm-content="{{ctx.Locale.Tr "repo.release.deletion_desc"}}"
data-url="{{$.RepoLink}}/releases/delete?id={{.ID}}">
{{ctx.Locale.Tr "repo.release.delete_release"}}
</a>
</button>
{{if .IsDraft}}
<button class="ui small button" type="submit" name="draft" value="1">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
<button type="submit" class="ui small primary button">{{ctx.Locale.Tr "repo.release.publish"}}</button>
+1 -1
View File
@@ -74,7 +74,7 @@
</div>
</div>
<div class="item-trailing">
<button type="button" class="ui red tiny button inline link-action"
<button type="button" class="ui red tiny button link-action"
data-url="{{$.Link}}/collaborative_owner/delete?id={{.ID}}"
data-modal-confirm-header="{{ctx.Locale.Tr "actions.general.remove_collaborative_owner"}}"
data-modal-confirm-content="{{ctx.Locale.Tr "actions.general.remove_collaborative_owner_desc"}}"
+2 -2
View File
@@ -5,8 +5,8 @@
<a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
<div class="ui right">
{{if .EscapeStatus.Escaped}}
<a class="ui tiny basic button unescape-button tw-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a>
<a class="ui tiny basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a>
<button type="button" class="ui tiny basic button unescape-button tw-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
<button type="button" class="ui tiny basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
<a class="ui primary tiny button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
</div>
+1 -1
View File
@@ -37,7 +37,7 @@
<td>{{DateUtils.TimeSince .Created}}</td>
<td class="tw-text-right">
<form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post">
<button type="submit" class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button>
<button type="submit" class="ui primary button">{{svg "octicon-lock"}} {{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button>
</form>
</td>
</tr>
@@ -19,10 +19,10 @@
<span class="tw-ml-2 tw-text-grey-light">{{.URL}}</span>
</div>
<a class="muted" href="{{$.BaseLink}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
<a class="tw-text-red tw-pr-2 link-action negative"
<button type="button" class="btn tw-text-red tw-pr-2 link-action negative" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_webhook"}}"
data-url="{{$.Link}}/delete?id={{.ID}}"
data-modal-confirm="{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}"
>{{svg "octicon-trash"}}</a>
>{{svg "octicon-trash"}}</button>
</div>
{{end}}
</div>
@@ -358,9 +358,9 @@
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button>
{{else}}
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button>
<a class="ui red button link-action"
<button type="button" class="ui red button link-action"
data-url="{{.BaseLink}}/delete?id={{.Webhook.ID}}"
data-modal-confirm="{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}"
>{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
>{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</button>
{{end}}
</div>
+2 -2
View File
@@ -43,9 +43,9 @@
{{end}}
{{if (and $.Repository.CanContentChange ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
<a class="flex-text-inline link-action" data-url="{{$.RepoLink}}/tags/delete?id={{.ID}}" data-modal-confirm="#confirm-delete-tag-modal">
<button type="button" class="btn interact-fg link-action" data-url="{{$.RepoLink}}/tags/delete?id={{.ID}}" data-modal-confirm="#confirm-delete-tag-modal">
{{svg "octicon-trash"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
</a>
</button>
{{end}}
{{if and $canReadReleases (not $release.IsTag)}}
+11 -11
View File
@@ -67,26 +67,26 @@
<button type="button" class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
</div>
<a download class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a>
<a class="btn-octicon {{if not .CanCopyContent}}disabled{{end}}" data-global-click="onCopyContentButtonClick"
<a download class="btn interact-fg" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a>
<button type="button" class="btn interact-fg {{if not .CanCopyContent}}disabled{{end}}" {{if not .CanCopyContent}}aria-disabled="true"{{end}} data-global-click="onCopyContentButtonClick"
{{if not .IsDisplayingSource}}data-raw-file-link="{{$.RawFileLink}}"{{end}}
data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}"
>{{svg "octicon-copy"}}</a>
>{{svg "octicon-copy"}}</button>
{{if and .EnableFeed .RefFullName.IsBranch}}
<a class="btn-octicon" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
<a class="btn interact-fg" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
{{svg "octicon-rss"}}
</a>
{{end}}
{{if .Repository.CanContentChange}}
{{if .CanEditFile}}
<a class="btn-octicon" data-tooltip-content="{{.EditFileTooltip}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-pencil"}}</a>
<a class="btn interact-fg" data-tooltip-content="{{.EditFileTooltip}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-pencil"}}</a>
{{else}}
<span class="btn-octicon disabled" data-tooltip-content="{{.EditFileTooltip}}">{{svg "octicon-pencil"}}</span>
<span class="btn disabled" data-tooltip-content="{{.EditFileTooltip}}">{{svg "octicon-pencil"}}</span>
{{end}}
{{if .CanDeleteFile}}
<a class="btn-octicon btn-octicon-danger" data-tooltip-content="{{.DeleteFileTooltip}}" href="{{.RepoLink}}/_delete/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-trash"}}</a>
<a class="btn interact-fg interact-danger" data-tooltip-content="{{.DeleteFileTooltip}}" href="{{.RepoLink}}/_delete/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-trash"}}</a>
{{else}}
<span class="btn-octicon disabled" data-tooltip-content="{{.DeleteFileTooltip}}">{{svg "octicon-trash"}}</span>
<span class="btn disabled" data-tooltip-content="{{.DeleteFileTooltip}}">{{svg "octicon-trash"}}</span>
{{end}}
{{end}}
{{else if .EscapeStatus.Escaped}}
@@ -94,7 +94,7 @@
<button type="button" class="ui mini basic button escape-button tw-mr-1">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
{{if and .ReadmeInList .CanEditReadmeFile}}
<a class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .FileTreePath}}">{{svg "octicon-pencil"}}</a>
<a class="btn interact-fg" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .FileTreePath}}">{{svg "octicon-pencil"}}</a>
{{end}}
</div>
</h4>
@@ -150,10 +150,10 @@
<div class="code-line-menu tippy-target">
{{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
<a class="item ref-in-new-issue" role="menuitem" href="#" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.HTMLURL ctx}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
{{end}}
<a class="item view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a>
<a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
<button type="button" class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</button>
</div>
</div>
</div>
+2 -2
View File
@@ -44,8 +44,8 @@
</div>
<div class="repo-button-row">
{{if .EscapeStatus.Escaped}}
<a class="ui small button unescape-button tw-hidden" data-unicode-content-selector=".wiki-content-parts">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a>
<a class="ui small button escape-button" data-unicode-content-selector=".wiki-content-parts">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a>
<button type="button" class="ui small button unescape-button tw-hidden" data-unicode-content-selector=".wiki-content-parts">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
<button type="button" class="ui small button escape-button" data-unicode-content-selector=".wiki-content-parts">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}</a>
+2 -2
View File
@@ -24,11 +24,11 @@
</div>
<div class="divider"></div>
<div class="item">
<a class="link-action" data-url="{{$.Link}}/reset_registration_token"
<button type="button" class="btn interact-fg link-action" data-url="{{$.Link}}/reset_registration_token"
data-modal-confirm="{{ctx.Locale.Tr "actions.runners.reset_registration_token_confirm"}}"
>
{{ctx.Locale.Tr "actions.runners.reset_registration_token"}}
</a>
</button>
</div>
</div>
</div>
+1 -3
View File
@@ -21,9 +21,7 @@
<a class="list-item-large-title" href="{{if $issue.Link}}{{$issue.Link}}{{else}}{{$root.Link}}/{{$issue.Index}}{{end}}">{{$issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
{{if $issue.IsPull}}
{{if (index $root.CommitStatuses $issue.PullRequest.ID)}}
<span class="tw-align-[1px]">{{/* make the "flex" children align with parent "inline" */}}
{{template "repo/commit_statuses" dict "Status" (index $root.CommitLastStatus $issue.PullRequest.ID) "Statuses" (index $root.CommitStatuses $issue.PullRequest.ID)}}
</span>
{{template "repo/commit_statuses" dict "Status" (index $root.CommitLastStatus $issue.PullRequest.ID) "Statuses" (index $root.CommitStatuses $issue.PullRequest.ID) "AdditionalClasses" "tw-text-16 tw-align-[calc(0.5cap-9px)]"}}
{{end}}
{{end}}
<span class="labels-list">
+3 -3
View File
@@ -7,14 +7,14 @@
<div class="tippy-target">
<div class="reaction-picker">
{{range $value := $allowedReactions}}
<a class="item emoji" role="menuitem" data-tooltip-content="{{$value}}" aria-label="{{$value}}" data-reaction-content="{{$value}}" data-has-reacted="{{(index $.Reactions $value).HasUser ctx.RootData.SignedUserID}}" data-global-click="onCommentReactionButtonClick">{{ReactionToEmoji $value}}</a>
<button type="button" class="item emoji" role="menuitem" data-tooltip-content="{{$value}}" aria-label="{{$value}}" data-reaction-content="{{$value}}" data-has-reacted="{{(index $.Reactions $value).HasUser ctx.RootData.SignedUserID}}" data-global-click="onCommentReactionButtonClick">{{ReactionToEmoji $value}}</button>
{{end}}
</div>
</div>
{{end}}
{{range $key, $value := .Reactions}}
{{$hasReacted := $value.HasUser ctx.RootData.SignedUserID}}
<a role="button" class="ui label basic{{if not $canReact}} disabled{{end}}"
<button type="button" class="ui label basic{{if not $canReact}} disabled{{end}}" {{if not $canReact}}aria-disabled="true"{{end}}
data-global-click="onCommentReactionButtonClick"
data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
aria-label="{{$key}}: {{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
@@ -22,7 +22,7 @@
data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
<span class="reaction">{{ReactionToEmoji $key}}</span>
<span>{{len $value}}</span>
</a>
</button>
{{end}}
</div>
{{end}}
+2 -2
View File
@@ -25,8 +25,8 @@
<input type="hidden" name="scope" value="{{.Scope}}">
<input type="hidden" name="nonce" value="{{.Nonce}}">
<input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
<button type="submit" id="authorize-app" name="granted" value="true" class="ui red inline button">{{ctx.Locale.Tr "auth.authorize_application"}}</button>
<button type="submit" name="granted" value="false" class="ui basic primary inline button">{{ctx.Locale.Tr "cancel"}}</button>
<button type="submit" id="authorize-app" name="granted" value="true" class="ui red button">{{ctx.Locale.Tr "auth.authorize_application"}}</button>
<button type="submit" name="granted" value="false" class="ui basic primary button">{{ctx.Locale.Tr "cancel"}}</button>
</form>
</div>
</div>
+3 -1
View File
@@ -283,8 +283,10 @@ func TestReleaseReaction(t *testing.T) {
resp := session.MakeRequest(t, NewRequest(t, "GET", "/user2/repo1/releases"), http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
AssertHTMLElement(t, htmlDoc, `.bottom-reactions a.ui.label[data-reaction-content="heart"]`, 1)
AssertHTMLElement(t, htmlDoc, `.bottom-reactions .ui.label[data-reaction-content="heart"]`, 1)
AssertHTMLElement(t, htmlDoc, `.reaction-picker [data-reaction-content="-1"]`, 0)
htmlDoc = NewHTMLParser(t, MakeRequest(t, NewRequest(t, "GET", "/user2/repo1/releases"), http.StatusOK).Body)
AssertHTMLElement(t, htmlDoc, `.bottom-reactions .ui.label[data-reaction-content="heart"][aria-disabled="true"]:not([disabled])`, 1)
session.MakeRequest(t, reactReq(1, "unreact", "heart"), http.StatusOK)
unittest.AssertCount(t, &issues_model.Reaction{ReleaseID: 1}, 0)
+3
View File
@@ -44,6 +44,9 @@
}
.color-picker-combo .precolors .color {
border: none;
border-radius: 0;
padding: 0;
display: inline-block;
width: 15px;
height: 15px;
+17 -1
View File
@@ -22,18 +22,34 @@ Gitea's private styles use `g-` prefix.
text-overflow: ellipsis;
}
/* interact-xx classes can be used standalone, reset the <a> and <button> styles to default text styles */
.interact-fg, .interact-bg, .interact-link {
background: transparent;
border: none;
color: inherit;
cursor: pointer;
text-decoration: none;
text-align: left;
line-height: inherit;
margin: 0;
padding: 0;
}
.interact-fg { color: inherit !important; }
.interact-fg:hover { color: var(--color-primary) !important; }
.interact-fg:active { color: var(--color-primary-active) !important; }
.interact-fg.disabled:hover { color: inherit !important; }
.interact-bg { background: transparent !important; }
.interact-bg:hover { background: var(--color-hover) !important; }
.interact-bg:active { background: var(--color-active) !important; }
/* sometimes, we'd like to make "<button>" look like a link */
.interact-link { color: var(--color-primary); cursor: pointer; }
.interact-link { color: var(--color-primary); }
.interact-link:hover { text-decoration: underline; }
.interact-danger:hover { color: var(--color-danger) !important; }
/* primary-color dot centered on the top-right corner of the element */
.indicator-dot {
position: relative;
+2 -2
View File
@@ -13,8 +13,8 @@
}
.btn.is-loading > *,
.btn-octicon.is-loading > *,
.button.is-loading > * {
.button.is-loading > *,
button.is-loading > * {
opacity: 0;
}
+8
View File
@@ -2,6 +2,7 @@
cursor: pointer;
display: inline-flex;
align-items: center;
vertical-align: middle; /* align buttons with/without svg icon */
min-width: 0;
outline: none;
font-family: var(--fonts-regular);
@@ -50,6 +51,8 @@
color: var(--color-text);
}
button:disabled,
.btn:disabled,
.ui.buttons .disabled.button:not(.basic),
.ui.disabled.button,
.ui.button:disabled,
@@ -306,6 +309,11 @@
border: none;
}
.btn.disabled {
cursor: default;
opacity: var(--opacity-disabled);
}
/* sometimes, we'd like to make "<a href>" look like a button */
a.btn,
a.btn:hover {
+3
View File
@@ -95,6 +95,9 @@
padding: 9px 14px;
border-radius: var(--border-radius);
color: inherit;
border: none;
text-align: left;
line-height: inherit;
background: inherit;
text-decoration: none;
gap: 10px;
+1 -18
View File
@@ -153,25 +153,8 @@
font-size: 1em;
}
.non-diff-file-content .header .file-actions .btn-octicon {
line-height: var(--line-height-default);
.non-diff-file-content .header .file-actions .btn {
padding: 8px;
vertical-align: middle;
color: var(--color-text);
}
.non-diff-file-content .header .file-actions .btn-octicon:hover {
color: var(--color-primary);
}
.non-diff-file-content .header .file-actions .btn-octicon-danger:hover {
color: var(--color-red);
}
.non-diff-file-content .header .file-actions .btn-octicon.disabled {
color: inherit;
opacity: var(--opacity-disabled);
cursor: default;
}
.non-diff-file-content .plain-text {
+2
View File
@@ -50,6 +50,8 @@
.bottom-reactions .ui.label:not(.disabled):hover {
background: var(--color-reaction-hover-bg);
border-color: var(--color-secondary-dark-2);
color: var(--color-text);
}
.bottom-reactions .ui.label.disabled {
+4 -3
View File
@@ -37,6 +37,7 @@ type RepoActionViewLocale = ActionRunSummaryViewLocale & ActionRunJobViewLocale
artifactExpiredAt: string,
confirmDeleteArtifact: string,
downloadFile: string,
deleteFile: string,
workflowFile: string,
workflowFileNoPermission: string,
runDetails: string,
@@ -299,12 +300,12 @@ onBeforeUnmount(() => {
<SvgIcon name="octicon-file" class="tw-text-text-light"/>
<span class="tw-flex-1 gt-ellipsis">{{ artifact.name }}</span>
</a>
<a download class="silenced" :href="buildArtifactLink(artifact.name)" :data-tooltip-content="locale.downloadFile">
<a download class="btn interact-fg" :href="buildArtifactLink(artifact.name)" :data-tooltip-content="locale.downloadFile">
<SvgIcon name="octicon-download"/>
</a>
<a v-if="run.canDeleteArtifact" class="silenced" @click="deleteArtifact(artifact.name)">
<button type="button" v-if="run.canDeleteArtifact" class="btn interact-fg" @click="deleteArtifact(artifact.name)" :data-tooltip-content="locale.deleteFile">
<SvgIcon name="octicon-trash"/>
</a>
</button>
</template>
<span
v-else class="flex-text-block tw-flex-1 tw-min-w-0 tw-text-text-light-2"
+1
View File
@@ -78,6 +78,7 @@ function initRepositoryActionsView() {
showFullScreen: el.getAttribute('data-locale-show-full-screen'),
downloadLogs: el.getAttribute('data-locale-download-logs'),
downloadFile: el.getAttribute('data-locale-download-file'),
deleteFile: el.getAttribute('data-locale-delete-file'),
copyOutput: el.getAttribute('data-locale-copy-output'),
status: {
unknown: el.getAttribute('data-locale-status-unknown'),
+1 -1
View File
@@ -17,7 +17,7 @@ function selectRange(range: string): Element | null {
const elLineNums = document.querySelectorAll(`.code-view td.lines-num span[data-line-number]`);
const refInNewIssue = document.querySelector('a.ref-in-new-issue');
const copyPermalink = document.querySelector('a.copy-line-permalink');
const copyPermalink = document.querySelector('button.copy-line-permalink');
const viewGitBlame = document.querySelector('a.view_git_blame');
const updateIssueHref = function (anchor: string) {
+2 -2
View File
@@ -67,7 +67,7 @@ export function initRepoTopicBar() {
lastErrorToast = showErrorToast(responseData.message, {duration: 5000});
if (responseData.invalidTopics && responseData.invalidTopics.length > 0) {
const {invalidTopics} = responseData;
const topicLabels = queryElemChildren(topicDropdown, 'a.ui.label');
const topicLabels = queryElemChildren(topicDropdown, '.ui.label');
for (const [index, value] of topics.split(',').entries()) {
if (invalidTopics.includes(value)) {
topicLabels[index].classList.remove('green');
@@ -98,7 +98,7 @@ export function initRepoTopicBar() {
};
const query = stripTags(this.urlData.query.trim());
let found_query = false;
const current_topics = Array.from(queryElemChildren(topicDropdown, 'a.ui.label.visible'), (el) => el.getAttribute('data-value'));
const current_topics = Array.from(queryElemChildren(topicDropdown, '.ui.label.visible'), (el) => el.getAttribute('data-value'));
if (res.topics) {
let found = false;
+1 -1
View File
@@ -145,7 +145,7 @@ function initPinRemoveButton() {
const response = await DELETE(el.getAttribute('data-unpin-url')!);
if (response.ok) {
// Delete the tooltip
el._tippy.destroy();
el._tippy?.destroy();
// Remove the Card
el.closest(`div.issue-card[data-issue-id="${CSS.escape(String(id))}"]`)!.remove();
}