Compare commits

..

No commits in common. "d5feb10aca0b309dce17a13255b4030f0a0cfe1b" and "74225033413dc0f2b308bbe069f6d185b551e364" have entirely different histories.

26 changed files with 118 additions and 156 deletions

View File

@ -77,11 +77,10 @@ func main() {
if secNew.HasKey(keyEnUs.Name()) {
oldStr := secOld.Key(keyEnUs.Name()).String()
newStr := secNew.Key(keyEnUs.Name()).String()
if oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%") {
fmt.Printf("WARNING: locale %s [%s]%s has different number of arguments, skipping\n", path, secEnUS.Name(), keyEnUs.Name())
fmt.Printf("\told: %s\n", oldStr)
fmt.Printf("\tnew: %s\n", newStr)
fmt.Println("---- ")
// A bug: many of new translations with ";" are broken in Crowdin (due to last messy restoring)
// As the broken strings are gradually fixed, this workaround check could be removed (in a few months?)
if strings.Contains(oldStr, ";") && !strings.Contains(newStr, ";") {
println("skip potential broken string", path, secEnUS.Name(), keyEnUs.Name())
continue
}
secOld.Key(keyEnUs.Name()).SetValue(newStr)

2
go.mod
View File

@ -289,7 +289,7 @@ replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142
replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix
replace github.com/nektos/act => gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab
replace github.com/nektos/act => gitea.com/gitea/act v0.243.1
exclude github.com/gofrs/uuid v3.2.0+incompatible

4
go.sum
View File

@ -52,8 +52,8 @@ codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570/go.mod h1:IIAjsi
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg=
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs=
gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab h1:HDImhO/XpMJrw2PJcADI/wgur9Gro/pegLFaRt8Wpg0=
gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab/go.mod h1:mabw6AZAiDgxGlK83orWLrNERSPvgBJzEUS3S7u2bHI=
gitea.com/gitea/act v0.243.1 h1:zIVlhGOLE4SHFPW++u3+5Y/jX5mub3QIhB13oNf6rtA=
gitea.com/gitea/act v0.243.1/go.mod h1:iLHCXqOPUElA2nSyHo4wtxSmvdkym3WU7CkP3AxF39Q=
gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681 h1:MMSPgnVULVwV9kEBgvyEUhC9v/uviZ55hPJEMjpbNR4=
gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681/go.mod h1:77TZu701zMXWJFvB8gvTbQ92zQ3DQq/H7l5wAEjQRKc=
gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0=

View File

@ -197,9 +197,7 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
for _, v := range jobs {
id, job := v.Job()
needs := job.Needs()
if err := v.SetJob(id, job.EraseNeeds()); err != nil {
return err
}
job.EraseNeeds()
payload, _ := v.Marshal()
status := StatusWaiting
if len(needs) > 0 || run.NeedApproval {

View File

@ -122,8 +122,8 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
webhook_module.HookEventRepository,
webhook_module.HookEventRelease,
webhook_module.HookEventPackage:
if len(evt.Acts()) != 0 {
log.Warn("Ignore unsupported %s event arguments %v", triggedEvent, evt.Acts())
if len(evt.Acts) != 0 {
log.Warn("Ignore unsupported %s event arguments %q", triggedEvent, evt.Acts)
}
// no special filter parameters for these events, just return true if name matched
return true
@ -148,7 +148,7 @@ func detectMatched(commit *git.Commit, triggedEvent webhook_module.HookEventType
func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts()) == 0 {
if len(evt.Acts) == 0 {
return true
}
@ -157,7 +157,7 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
hasTagFilter := false
refName := git.RefName(pushPayload.Ref)
// all acts conditions should be satisfied
for cond, vals := range evt.Acts() {
for cond, vals := range evt.Acts {
switch cond {
case "branches":
hasBranchFilter = true
@ -241,18 +241,18 @@ func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobpa
if hasBranchFilter && hasTagFilter {
matchTimes++
}
return matchTimes == len(evt.Acts())
return matchTimes == len(evt.Acts)
}
func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts()) == 0 {
if len(evt.Acts) == 0 {
return true
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts() {
for cond, vals := range evt.Acts {
switch cond {
case "types":
for _, val := range vals {
@ -265,19 +265,19 @@ func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *j
log.Warn("issue event unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts())
return matchTimes == len(evt.Acts)
}
func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts()) == 0 {
if len(evt.Acts) == 0 {
// defaultly, only pull request opened and synchronized will trigger workflow
return prPayload.Action == api.HookIssueSynchronized || prPayload.Action == api.HookIssueOpened
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts() {
for cond, vals := range evt.Acts {
switch cond {
case "types":
action := prPayload.Action
@ -339,18 +339,18 @@ func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload
log.Warn("pull request event unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts())
return matchTimes == len(evt.Acts)
}
func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCommentPayload, evt *jobparser.Event) bool {
// with no special filter parameters
if len(evt.Acts()) == 0 {
if len(evt.Acts) == 0 {
return true
}
matchTimes := 0
// all acts conditions should be satisfied
for cond, vals := range evt.Acts() {
for cond, vals := range evt.Acts {
switch cond {
case "types":
for _, val := range vals {
@ -363,5 +363,5 @@ func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCo
log.Warn("issue comment unsupported condition %q", cond)
}
}
return matchTimes == len(evt.Acts())
return matchTimes == len(evt.Acts)
}

View File

@ -2280,8 +2280,6 @@ diff.image.side_by_side = Side by Side
diff.image.swipe = Swipe
diff.image.overlay = Overlay
diff.has_escaped = This line has hidden Unicode characters
diff.show_file_tree = Show file tree
diff.hide_file_tree = Hide file tree
releases.desc = Track project versions and downloads.
release.releases = Releases

View File

@ -1068,7 +1068,6 @@ release=リリース
releases=リリース
tag=タグ
released_this=がこれをリリース
tagged_this=がタグ付け
file.title=%s at %s
file_raw=Raw
file_history=履歴
@ -1277,7 +1276,6 @@ issues.choose.blank=デフォルト
issues.choose.blank_about=デフォルトのテンプレートからイシューを作成。
issues.choose.ignore_invalid_templates=無効なテンプレートが無視されました
issues.choose.invalid_templates=無効なテンプレートが%v 件見つかりました
issues.choose.invalid_config=イシューの設定にエラーがあります:
issues.no_ref=ブランチ/タグ指定なし
issues.create=イシューを作成
issues.new_label=新しいラベル
@ -1491,9 +1489,6 @@ issues.due_date_invalid=期日が正しくないか範囲を超えています
issues.dependency.title=依存関係
issues.dependency.issue_no_dependencies=依存関係が設定されていません。
issues.dependency.pr_no_dependencies=依存関係が設定されていません。
issues.dependency.no_permission_1=%d 個の依存関係への読み取り権限がありません
issues.dependency.no_permission_n=%d 個の依存関係への読み取り権限がありません
issues.dependency.no_permission.can_remove=この依存関係への読み取り権限はありませんが、この依存関係は削除できます
issues.dependency.add=依存関係を追加...
issues.dependency.cancel=キャンセル
issues.dependency.remove=削除
@ -2289,7 +2284,6 @@ release.compare=比較
release.edit=編集
release.ahead.commits=<strong>%d</strong>件のコミット
release.ahead.target=が、このリリース後 %s に追加されています
tag.ahead.target=が、このタグ付け後 %s に追加されています
release.source_code=ソースコード
release.new_subheader=リリースで、プロジェクトのバージョンを整理します。
release.edit_subheader=リリースで、プロジェクトのバージョンを整理します。

View File

@ -2135,7 +2135,7 @@ settings.dismiss_stale_approvals_desc=当新的提交更改合并请求内容被
settings.require_signed_commits=需要签名提交
settings.require_signed_commits_desc=拒绝推送未签名或无法验证的提交到分支
settings.protect_branch_name_pattern=受保护的分支名称模式
settings.protect_protected_file_patterns=`"受保护的文件模式 (使用分号 '\;' 分隔)" ;'):``
settings.protect_protected_file_patterns=`受保护的文件模式(使用分号分隔 ' ;'):`
settings.protect_protected_file_patterns_desc=`即使用户有权添加、编辑或删除此分支中的文件,也不允许直接更改受保护的文件。 可以使用分号分隔多个模式(' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`
settings.protect_unprotected_file_patterns=`不受保护的文件模式 (使用分号分隔 ' ;'):`
settings.protect_unprotected_file_patterns_desc=`如果用户有写入权限,则允许直接更改的不受保护的文件,以绕过推送限制。可以使用分号分隔多重模式 (' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`

View File

@ -105,7 +105,6 @@ func NewUserPost(ctx *context.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminUsers"] = true
ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
sources, err := auth.Sources()
if err != nil {
@ -274,7 +273,6 @@ func EditUserPost(ctx *context.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminUsers"] = true
ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
u := prepareUserInfo(ctx)
if ctx.Written() {
@ -316,13 +314,13 @@ func EditUserPost(ctx *context.Context) {
log.Error(err.Error())
errMsg = ctx.Tr("auth.password_pwned_err")
}
ctx.RenderWithErr(errMsg, tplUserEdit, &form)
ctx.RenderWithErr(errMsg, tplUserNew, &form)
return
}
if err := user_model.ValidateEmail(form.Email); err != nil {
ctx.Data["Err_Email"] = true
ctx.RenderWithErr(ctx.Tr("form.email_error"), tplUserEdit, &form)
ctx.RenderWithErr(ctx.Tr("form.email_error"), tplUserNew, &form)
return
}
@ -338,10 +336,7 @@ func EditUserPost(ctx *context.Context) {
if len(form.UserName) != 0 && u.Name != form.UserName {
if err := user_setting.HandleUsernameChange(ctx, u, form.UserName); err != nil {
if ctx.Written() {
return
}
ctx.RenderWithErr(ctx.Flash.ErrorMsg, tplUserEdit, &form)
ctx.Redirect(setting.AppSubURL + "/admin/users")
return
}
u.Name = form.UserName

View File

@ -294,10 +294,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
}
if err == nil {
for _, pr := range prs {
if pr.Issue.IsClosed {
// The closed PR never trigger action or webhook
continue
}
if newCommitID != "" && newCommitID != git.EmptySHA {
changed, err := checkIfPRContentChanged(ctx, pr, oldCommitID, newCommitID)
if err != nil {

View File

@ -15,18 +15,11 @@
<div>
<div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac gt-fw">
<div class="gt-df gt-ac gt-fw">
<button class="diff-toggle-file-tree-button gt-df gt-ac" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}">
<a class="diff-toggle-file-tree-button muted gt-df gt-ac">
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
{{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
{{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}}
</button>
<script>
const diffTreeVisible = localStorage?.getItem('diff_file_tree_visible') === 'true';
const diffTreeBtn = document.querySelector('.diff-toggle-file-tree-button');
const diffTreeIcon = `.octicon-sidebar-${diffTreeVisible ? 'expand' : 'collapse'}`;
diffTreeBtn.querySelector(diffTreeIcon).classList.remove('gt-hidden');
diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
</script>
{{svg "octicon-sidebar-collapse" 20 "icon hide"}}
{{svg "octicon-sidebar-expand" 20 "icon"}}
</a>
<div class="diff-detail-stats gt-df gt-ac gt-ml-3">
{{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
</div>
@ -75,9 +68,6 @@
<div id="diff-file-list"></div>
<div id="diff-container">
<div id="diff-file-tree" class="gt-hidden"></div>
<script>
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('gt-hidden');
</script>
<div id="diff-file-boxes" class="sixteen wide column">
{{range $i, $file := .Diff.Files}}
{{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}}

View File

@ -29,7 +29,9 @@
<div id="issue-filters" class="ui stackable grid">
<div class="six wide column">
{{if $.CanWriteIssuesOrPulls}}
<input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-vm gt-mr-4" title="{{.locale.Tr "repo.issues.action_check_all"}}">
<div class="ui checkbox issue-checkbox-all gt-vm">
<input type="checkbox" title="{{.locale.Tr "repo.issues.action_check_all"}}">
</div>
{{end}}
{{template "repo/issue/openclose" .}}
</div>
@ -177,12 +179,12 @@
{{end}}
<!-- Sort -->
<div class="ui dropdown downward type jump item">
<div class="ui dropdown type jump item">
<span class="text">
{{.locale.Tr "repo.issues.filter_sort"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</span>
<div class="left menu">
<div class="menu">
<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>

View File

@ -128,6 +128,7 @@
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
<div class="content">
{{template "repo/pulls/status" .}}
{{$canAutoMerge := false}}
{{$showGeneralMergeForm := false}}
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
{{if .Issue.PullRequest.HasMerged}}
@ -192,7 +193,7 @@
{{end}}
</div>
</div>
{{template "repo/issue/view_content/update_branch_by_merge" $}}
{{template "repo/issue/view_content/update_branch_by_merge" (dict "locale" .locale "Issue" .Issue "UpdateAllowed" .UpdateAllowed "UpdateByRebaseAllowed" .UpdateByRebaseAllowed "Link" .Link)}}
{{else if .Issue.PullRequest.IsChecking}}
<div class="item">
<i class="icon icon-octicon">{{svg "octicon-sync"}}</i>
@ -285,7 +286,7 @@
</div>
{{end}}
{{end}}
{{template "repo/issue/view_content/update_branch_by_merge" $}}
{{template "repo/issue/view_content/update_branch_by_merge" (dict "locale" .locale "Issue" .Issue "UpdateAllowed" .UpdateAllowed "UpdateByRebaseAllowed" .UpdateByRebaseAllowed "Link" .Link)}}
{{if .Issue.PullRequest.IsEmpty}}
<div class="ui divider"></div>

View File

@ -1,4 +1,5 @@
{{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}}
{{$canAutoMerge := false}}
{{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}}
<div class="ui divider"></div>
<div class="item item-section">
<div class="item-section-left">
@ -6,10 +7,10 @@
{{$.locale.Tr "repo.pulls.outdated_with_base_branch"}}
</div>
<div class="item-section-right">
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
{{if and .UpdateAllowed .UpdateByRebaseAllowed}}
<div class="gt-dib">
<div class="ui buttons update-button">
<button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}">
<button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}">
<span class="button-text">
{{$.locale.Tr "repo.pulls.update_branch"}}
</span>
@ -18,17 +19,17 @@
<div class="ui dropdown icon button no-text">
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<a class="item active selected" data-do="{{$.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a>
<a class="item" data-do="{{$.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a>
<a class="item active selected" data-do="{{.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a>
<a class="item" data-do="{{.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a>
</div>
</div>
</div>
</div>
{{end}}
{{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}}
<form action="{{$.Link}}/update" method="post" class="ui update-branch-form">
{{$.CsrfTokenHtml}}
<button class="ui compact button">
{{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}}
<form action="{{.Link}}/update" method="post" class="ui update-branch-form">
{{.CsrfTokenHtml}}
<button class="ui compact button" data-do="update">
<span class="ui text">{{$.locale.Tr "repo.pulls.update_branch"}}</span>
</button>
</form>

View File

@ -2,9 +2,11 @@
{{$approvalCounts := .ApprovalCounts}}
{{range .Issues}}
<li class="item gt-df gt-py-3">
<div class="issue-item-left gt-df gt-items-start">
<div class="issue-item-left gt-df">
{{if $.CanWriteIssuesOrPulls}}
<input type="checkbox" autocomplete="off" class="issue-checkbox gt-mt-2 gt-mr-4" data-issue-id={{.ID}} aria-label="{{$.locale.Tr "repo.issues.action_check"}} &quot;{{.Title}}&quot;">
<div class="ui checkbox issue-checkbox">
<input type="checkbox" data-issue-id={{.ID}} title="{{$.locale.Tr "repo.issues.action_check"}} «{{.Title}}»">
</div>
{{end}}
<div class="issue-item-icon">
{{if .IsPull}}

View File

@ -238,10 +238,6 @@ table {
border-collapse: collapse;
}
button {
cursor: pointer;
}
details summary {
cursor: pointer;
}

View File

@ -24,7 +24,6 @@
.gt-relative { position: relative !important; }
.gt-overflow-x-scroll { overflow-x: scroll !important; }
.gt-cursor-default { cursor: default !important; }
.gt-items-start { align-items: flex-start !important; }
.gt-mono {
font-family: var(--fonts-monospace) !important;

View File

@ -1616,12 +1616,14 @@
padding: 7px 0;
background: var(--color-body);
line-height: 30px;
height: 47px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
}
@media (max-width: 991px) {
.repository .diff-detail-box {
flex-direction: column;
align-items: flex-start;
height: 77px; /* match .ui.attached.header.diff-file-header.sticky-2nd-row */
}
}
@ -1677,13 +1679,6 @@
}
}
.diff-detail-actions {
/* prevent font-size from increasing element height so that .diff-detail-box comes
out with height of 47px (one line) and 77px (two lines), which is important for
position: sticky */
height: 33px;
}
.repository .diff-detail-box .diff-detail-actions > * {
margin-right: 0;
}
@ -1858,24 +1853,10 @@
padding-bottom: 5px;
}
.diff-file-box {
border: 1px solid transparent;
border-radius: var(--border-radius);
}
/* TODO: this can potentially be made "global" by removing the class prefix */
.diff-file-box .ui.attached.header,
.diff-file-box .ui.attached.table {
margin: 0; /* remove fomantic negative margins */;
width: initial; /* remove fomantic over 100% width */;
max-width: initial; /* remove fomantic over 100% width */;
}
.repository .diff-stats {
clear: both;
margin-bottom: 5px;
max-height: 200px;
height: fit-content;
max-height: 400px;
overflow: auto;
padding-left: 0;
}
@ -2671,8 +2652,7 @@
filter: drop-shadow(-3px 0 0 var(--color-primary-alpha-30)) !important;
}
.code-comment:target,
.diff-file-box:target {
.code-comment:target {
border-color: var(--color-primary) !important;
border-radius: var(--border-radius) !important;
box-shadow: 0 0 0 3px var(--color-primary-alpha-30) !important;
@ -3246,28 +3226,17 @@ td.blob-excerpt {
}
#diff-file-tree {
flex: 0 0 20%;
width: 20%;
max-width: 380px;
line-height: inherit;
position: sticky;
padding-top: 0;
top: 47px;
max-height: calc(100vh - 47px);
max-height: calc(100vh - 50px);
height: 100%;
overflow-y: auto;
}
.diff-toggle-file-tree-button {
background: none;
border: none;
user-select: none;
color: inherit;
}
.diff-toggle-file-tree-button:hover {
color: var(--color-primary);
}
@media (max-width: 991px) {
#diff-file-tree {
display: none !important;

View File

@ -67,7 +67,8 @@
.comment-code-cloud {
padding: 0.5rem 1rem !important;
position: relative;
max-width: 820px;
margin: 0 auto;
max-width: 1000px;
}
@media (max-width: 767px) {
@ -307,3 +308,11 @@ a.blob-excerpt:hover {
width: 72px;
height: 10px;
}
.diff-file-box {
border-radius: 0.285rem; /* Just like ui.top.attached.header */
}
.diff-file-box:target {
box-shadow: 0 0 0 3px var(--color-accent);
}

View File

@ -7,6 +7,10 @@
color: var(--color-primary) !important;
}
.issue.list > .item .issue-checkbox {
margin-top: 1px;
}
.issue.list > .item .issue-item-icon svg {
margin-right: 0.75rem;
margin-top: 1px;

View File

@ -16,7 +16,6 @@
<script>
import DiffFileTreeItem from './DiffFileTreeItem.vue';
import {doLoadMoreFiles} from '../features/repo-diff.js';
import {toggleElem} from '../utils/dom.js';
const {pageData} = window.config;
const LOCAL_STORAGE_KEY = 'diff_file_tree_visible';
@ -93,6 +92,8 @@ export default {
}
},
mounted() {
// ensure correct buttons when we are mounted to the dom
this.adjustToggleButton(this.fileTreeIsVisible);
// replace the pageData.diffFileInfo.files with our watched data so we get updates
pageData.diffFileInfo.files = this.files;
@ -108,17 +109,15 @@ export default {
updateVisibility(visible) {
this.fileTreeIsVisible = visible;
localStorage.setItem(LOCAL_STORAGE_KEY, this.fileTreeIsVisible);
this.updateState(this.fileTreeIsVisible);
this.adjustToggleButton(this.fileTreeIsVisible);
},
updateState(visible) {
const btn = document.querySelector('.diff-toggle-file-tree-button');
const [toShow, toHide] = btn.querySelectorAll('.icon');
const tree = document.getElementById('diff-file-tree');
const newTooltip = btn.getAttribute(visible ? 'data-hide-text' : 'data-show-text');
btn.setAttribute('data-tooltip-content', newTooltip);
toggleElem(tree, visible);
toggleElem(toShow, !visible);
toggleElem(toHide, visible);
adjustToggleButton(visible) {
const [toShow, toHide] = document.querySelectorAll('.diff-toggle-file-tree-button .icon');
toShow.classList.toggle('gt-hidden', visible); // hide the toShow icon if the tree is visible
toHide.classList.toggle('gt-hidden', !visible); // similarly
const diffTree = document.getElementById('diff-file-tree');
diffTree.classList.toggle('gt-hidden', !visible);
},
loadMoreData() {
this.isLoadingNewData = true;

View File

@ -1,7 +1,7 @@
<template>
<div v-show="show" :title="item.name">
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
<div class="item" :class="item.isFile ? 'filewrapper gt-p-1 gt-ac' : ''">
<div class="item" :class="item.isFile ? 'filewrapper gt-p-1' : ''">
<!-- Files -->
<SvgIcon
v-if="item.isFile"
@ -10,7 +10,7 @@
/>
<a
v-if="item.isFile"
class="file gt-ellipsis"
class="file gt-ellipsis muted"
:href="item.isFile ? '#diff-' + item.file.NameHash : ''"
>{{ item.name }}</a>
<SvgIcon
@ -20,7 +20,7 @@
/>
<!-- Directories -->
<div v-if="!item.isFile" class="directory gt-p-1 gt-ac" @click.stop="handleClick(item.isFile)">
<div v-if="!item.isFile" class="directory gt-p-1" @click.stop="handleClick(item.isFile)">
<SvgIcon
class="svg-icon"
:name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'"
@ -79,31 +79,31 @@ export default {
</script>
<style scoped>
.svg-icon.status {
span.svg-icon.status {
float: right;
}
.svg-icon.file {
span.svg-icon.file {
color: var(--color-secondary-dark-7);
}
.svg-icon.directory {
span.svg-icon.directory {
color: var(--color-primary);
}
.svg-icon.octicon-diff-modified {
span.svg-icon.octicon-diff-modified {
color: var(--color-yellow);
}
.svg-icon.octicon-diff-added {
span.svg-icon.octicon-diff-added {
color: var(--color-green);
}
.svg-icon.octicon-diff-removed {
span.svg-icon.octicon-diff-removed {
color: var(--color-red);
}
.svg-icon.octicon-diff-renamed {
span.svg-icon.octicon-diff-renamed {
color: var(--color-teal);
}
@ -139,11 +139,9 @@ div.list {
a {
text-decoration: none;
color: var(--color-text);
}
a:hover {
text-decoration: none;
color: var(--color-text);
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="action-view-container">
<div class="action-view-header">
<div class="action-info-summary gt-ac">
<div class="action-info-summary">
<ActionRunStatus :status="run.status" :size="20"/>
<div class="action-title">
{{ run.title }}
@ -30,7 +30,7 @@
<div class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id">
<a class="job-brief-link" :href="run.link+'/jobs/'+index">
<ActionRunStatus :status="job.status"/>
<span class="ui text gt-mx-3">{{ job.name }}</span>
<span class="ui text">{{ job.name }}</span>
</a>
<button class="job-brief-rerun" @click="rerunJob(index)" v-if="job.canRerun">
<SvgIcon name="octicon-sync" class="ui text black"/>
@ -404,6 +404,7 @@ export function initRepositoryActionView() {
}
.job-group-section .job-brief-list .job-brief-item .job-brief-link span {
margin-right: 8px;
display: flex;
align-items: center;
}

View File

@ -111,15 +111,8 @@ export function initGlobalCommon() {
},
});
// Special popup-directions, prevent Fomantic from guessing the popup direction.
// With default "direction: auto", if the viewport height is small, Fomantic would show the popup upward,
// if the dropdown is at the beginning of the page, then the top part would be clipped by the window view.
// eg: Issue List "Sort" dropdown
// But we can not set "direction: downward" for all dropdowns, because there is a bug in dropdown menu positioning when calculating the "left" position,
// which would make some dropdown popups slightly shift out of the right viewport edge in some cases.
// eg: the "Create New Repo" menu on the navbar.
// special popup-directions
$uiDropdowns.filter('.upward').dropdown('setting', 'direction', 'upward');
$uiDropdowns.filter('.downward').dropdown('setting', 'direction', 'downward');
$('.ui.checkbox').checkbox();

View File

@ -3,8 +3,9 @@ import {updateIssuesMeta} from './repo-issue.js';
import {toggleElem} from '../utils/dom.js';
export function initCommonIssue() {
const $issueSelectAll = $('.issue-checkbox-all');
const $issueCheckboxes = $('.issue-checkbox');
const $issueSelectAllWrapper = $('.issue-checkbox-all');
const $issueSelectAll = $('.issue-checkbox-all input');
const $issueCheckboxes = $('.issue-checkbox input');
const syncIssueSelectionState = () => {
const $checked = $issueCheckboxes.filter(':checked');
@ -22,7 +23,7 @@ export function initCommonIssue() {
toggleElem($('#issue-filters'), !anyChecked);
toggleElem($('#issue-actions'), anyChecked);
// there are two panels but only one select-all checkbox, so move the checkbox to the visible panel
$('#issue-filters, #issue-actions').filter(':visible').find('.column:first').prepend($issueSelectAll);
$('#issue-filters, #issue-actions').filter(':visible').find('.column:first').prepend($issueSelectAllWrapper);
};
$issueCheckboxes.on('change', syncIssueSelectionState);
@ -37,7 +38,7 @@ export function initCommonIssue() {
let action = this.getAttribute('data-action');
let elementId = this.getAttribute('data-element-id');
const url = this.getAttribute('data-url');
const issueIDs = $('.issue-checkbox:checked').map((_, el) => {
const issueIDs = $('.issue-checkbox').children('input:checked').map((_, el) => {
return el.getAttribute('data-issue-id');
}).get().join(',');
if (elementId === '0' && url.slice(-9) === '/assignee') {
@ -53,7 +54,20 @@ export function initCommonIssue() {
issueIDs,
elementId
).then(() => {
// NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the
// checkboxes stay checked after reload
if (action === 'close' || action === 'open') {
// uncheck all checkboxes
$('.issue-checkbox input[type="checkbox"]').each((_, e) => { e.checked = false });
}
window.location.reload();
});
});
// NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay
// checked after reload trigger checked event, if checkboxes are checked on load
$('.issue-checkbox input[type="checkbox"]:checked').first().each((_, e) => {
e.checked = false;
$(e).trigger('click');
});
}

View File

@ -9,6 +9,10 @@ export function initGiteaFomantic() {
// Disable the behavior of fomantic to toggle the checkbox when you press enter on a checkbox element.
$.fn.checkbox.settings.enableEnterKey = false;
// Prevent Fomantic from guessing the popup direction.
// Otherwise, if the viewport height is small, Fomantic would show the popup upward,
// if the dropdown is at the beginning of the page, then the top part would be clipped by the window view, eg: Issue List "Sort" dropdown
$.fn.dropdown.settings.direction = 'downward';
// By default, use "exact match" for full text search
$.fn.dropdown.settings.fullTextSearch = 'exact';
// Do not use "cursor: pointer" for dropdown labels