Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
* upstream/main:
  Show new pull request button also on subdirectories and files (go-gitea#24842)
  Improvements for action detail page (go-gitea#24718)
  • Loading branch information
zjjhot committed May 22, 2023
2 parents b05d1a0 + 32ec254 commit 5884e1e
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 58 deletions.
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ milestones = Milestones
ok = OK
cancel = Cancel
rerun = Re-run
rerun_all = Re-run all jobs
save = Save
add = Add
add_all = Add All
Expand Down
5 changes: 3 additions & 2 deletions templates/repo/actions/status.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- This template should be kept the same as web_src/js/components/ActionRunStatus.vue
Please also update the vue file above if this template is modified.
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
-->
{{- $size := 16 -}}
{{- if .size -}}
Expand All @@ -11,7 +12,7 @@
{{- $className = .className -}}
{{- end -}}

<span data-tooltip-content="{{.locale.Tr (printf "actions.status.%s" .status)}}">
<span class="gt-df gt-ac" data-tooltip-content="{{.locale.Tr (printf "actions.status.%s" .status)}}">
{{if eq .status "success"}}
{{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}}
{{else if eq .status "skipped"}}
Expand All @@ -22,7 +23,7 @@
{{svg "octicon-blocked" $size (printf "text yellow %s" $className)}}
{{else if eq .status "running"}}
{{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}}
{{else}}
{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}}
{{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}}
{{end}}
</span>
1 change: 1 addition & 0 deletions templates/repo/actions/view.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}"
data-locale-cancel="{{.locale.Tr "cancel"}}"
data-locale-rerun="{{.locale.Tr "rerun"}}"
data-locale-rerun-all="{{.locale.Tr "rerun_all"}}"
data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}"
data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}"
data-locale-status-running="{{.locale.Tr "actions.status.running"}}"
Expand Down
8 changes: 4 additions & 4 deletions templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
<!-- If home page, show new pr. If not, show breadcrumb -->
{{if and (eq $n 0) .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
{{if ne .Repository.ID .BaseRepo.ID}}
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
Expand All @@ -79,6 +76,9 @@
{{svg "octicon-git-pull-request"}}
</a>
{{end}}
<!-- Show go to file and breadcrumbs if not on home page -->
{{$n := len .TreeNames}}
{{$l := Eval $n "-" 1}}
{{if eq $n 0}}
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
{{end}}
Expand Down
1 change: 1 addition & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
/* console colors */
--color-console-fg: #ffffff;
--color-console-bg: #171717;
--color-console-hover-bg: #ffffff16;
/* named colors */
--color-red: #db2828;
--color-orange: #f2711c;
Expand Down
5 changes: 3 additions & 2 deletions web_src/js/components/ActionRunStatus.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<!-- This vue should be kept the same as templates/repo/actions/status.tmpl
Please also update the template file above if this vue is modified.
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
-->
<template>
<span :data-tooltip-content="localeStatus" v-if="status">
<span class="gt-df gt-ac" :data-tooltip-content="localeStatus" v-if="status">
<SvgIcon name="octicon-check-circle-fill" class="text green" :size="size" :class-name="className" v-if="status === 'success'"/>
<SvgIcon name="octicon-skip" class="text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
<SvgIcon name="octicon-clock" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'waiting'"/>
<SvgIcon name="octicon-blocked" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'blocked'"/>
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class-name="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else/>
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else-if="['failure', 'cancelled', 'unknown'].includes(status)" />
</span>
</template>

Expand Down
Loading

0 comments on commit 5884e1e

Please sign in to comment.