0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-30 05:28:06 +02:00

adjustment

This commit is contained in:
Lunny Xiao 2026-02-21 12:39:14 -08:00
parent 512365a84f
commit 7c0ac9173b
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
6 changed files with 25 additions and 32 deletions

View File

@ -806,14 +806,14 @@ func (c *Comment) MetaSpecialDoerTr(locale translation.Locale) template.HTML {
return locale.Tr("repo.issues.review.codeowners_rules")
case SpecialDoerNameProjectWorkflow:
if c.CommentMetaData.ProjectWorkflowID > 0 {
return htmlutil.HTMLFormat("%s", locale.Tr("repo.issues.project_workflow_action",
return locale.Tr("repo.issues.project_workflow_action",
htmlutil.HTMLFormat("<span class=\"muted text black tw-font-semibold\">%s</span>", locale.Tr(c.CommentMetaData.ProjectWorkflowEvent.LangKey())),
htmlutil.HTMLFormat("<span class=\"muted text black tw-font-semibold\">%s</span>", c.CommentMetaData.ProjectTitle),
))
)
}
return locale.Tr("repo.issues.project_workflow")
}
return htmlutil.HTMLFormat("%s", c.CommentMetaData.SpecialDoerName)
return template.HTML(c.CommentMetaData.SpecialDoerName)
}
func (c *Comment) TimelineRequestedReviewTr(locale translation.Locale, createdStr template.HTML) template.HTML {

View File

@ -348,8 +348,12 @@ func executeWorkflowActions(ctx context.Context, workflow *project_model.Workflo
if err := workflow.LoadProject(ctx); err != nil {
log.Error("LoadProject: %v", err)
}
title := ""
if workflow.Project != nil {
title = workflow.Project.Title
}
workflowCtx := issues_model.WithProjectWorkflowCommentMeta(ctx, issues_model.ProjectWorkflowCommentMeta{
ProjectTitle: util.Iif(workflow.Project != nil, workflow.Project.Title, ""),
ProjectTitle: title,
ProjectWorkflowID: workflow.ID,
ProjectWorkflowEvent: workflow.WorkflowEvent,
})

View File

@ -86,7 +86,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}}
{{else}}
@ -101,7 +101,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}}
{{else}}
@ -116,7 +116,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
{{if eq $.Issue.PullRequest.Status 3}}
{{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (HTMLFormat `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "<b>%[1]s</b>" $.BaseTarget) $createdStr}}
@ -144,7 +144,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{if eq .RefAction 3}}<del>{{end}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}}
</span>
{{if eq .RefAction 3}}</del>{{end}}
@ -158,7 +158,7 @@
<span class="badge">{{svg "octicon-bookmark"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr}}
</span>
<div class="detail flex-text-block">
@ -173,7 +173,7 @@
<span class="badge">{{svg "octicon-tag"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{if and .AddedLabels (not .RemovedLabels)}}
{{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (ctx.RenderUtils.RenderLabels .AddedLabels $.RepoLink .Issue) $createdStr}}
{{else if and (not .AddedLabels) .RemovedLabels}}
@ -376,7 +376,7 @@
{{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}}
</span>
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{if eq $reviewType 1}}
{{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}}
{{else if eq $reviewType 2}}
@ -488,7 +488,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}}
</span>
</div>
@ -588,7 +588,7 @@
<span class="badge">{{svg "octicon-project"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{$newProjectDisplay := .CommentMetaData.ProjectTitle}}
{{if .Project}}
{{$trKey := printf "projects.type-%d.display_name" .Project.Type}}
@ -663,7 +663,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-merge" 16}}</span>
<span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{template "repo/issue/view_content/comments_authorlink" dict "comment" .}}
{{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}}
{{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}}
</span>

View File

@ -1,10 +1,10 @@
{{if .comment.OriginalAuthor}}
<span class="text black">
{{svg (MigrationIcon .ctxData.Repository.GetOriginalURLHostname)}}
{{svg (MigrationIcon ctx.Repository.GetOriginalURLHostname)}}
{{.comment.OriginalAuthor}}
</span>
{{if .ctxData.Repository.OriginalURL}}
<span class="migrate">({{ctx.Locale.Tr "repo.migrated_from" .ctxData.Repository.OriginalURL .ctxData.Repository.GetOriginalURLHostname}})</span>
{{if ctx.Repository.OriginalURL}}
<span class="migrate">({{ctx.Locale.Tr "repo.migrated_from" ctx.Repository.OriginalURL ctx.Repository.GetOriginalURLHostname}})</span>
{{end}}
{{else}}
{{$specialDoerHtml := .comment.MetaSpecialDoerTr ctx.Locale}}

View File

@ -3,7 +3,7 @@
{{template "repo/header" .}}
<div class="ui container padded">
<div class="tw-flex tw-justify-between tw-items-center tw-mb-4">
<a class="ui" href="{{.ProjectLink}}">{{svg "octicon-arrow-left"}} {{ctx.Locale.Tr "projects.workflows"}} {{.Project.Title}}</a>
<a href="{{.ProjectLink}}">{{svg "octicon-arrow-left"}} {{ctx.Locale.Tr "projects.workflows"}} {{.Project.Title}}</a>
</div>
</div>
{{template "projects/workflows" .}}

View File

@ -858,7 +858,7 @@ onUnmounted(() => {
</div>
</div>
</div>
<div v-else class="ui labels">
<div v-else class="ui list labels-list">
<span v-if="!store.workflowFilters.labels?.length" class="text-muted">{{ locale.anyLabel }}</span>
<span
v-for="labelId in store.workflowFilters.labels" :key="labelId"
@ -923,7 +923,7 @@ onUnmounted(() => {
</div>
</div>
</div>
<div v-else class="ui labels">
<div v-else class="ui list labels-list">
<span v-if="!store.workflowActions.addLabels?.length" class="text-muted">{{ locale.none }}</span>
<span
v-for="labelId in store.workflowActions.addLabels" :key="labelId"
@ -965,7 +965,7 @@ onUnmounted(() => {
</div>
</div>
</div>
<div v-else class="ui labels">
<div v-else class="ui list labels-list">
<span v-if="!store.workflowActions.removeLabels?.length" class="text-muted">{{ locale.none }}</span>
<span
v-for="labelId in store.workflowActions.removeLabels" :key="labelId"
@ -1418,17 +1418,6 @@ onUnmounted(() => {
margin: 0.125rem;
}
.ui.labels {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
}
.ui.labels .ui.label {
margin: 0;
}
.text-muted {
color: var(--color-text-light-2);
}