From 65aa53fc52ff15efe54df4147564828d535837f8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 11 Oct 2024 12:27:00 +0200 Subject: Adding upstream version 8.0.3. Signed-off-by: Daniel Baumann --- templates/repo/actions/dispatch.tmpl | 99 ++++++++++++++++++++++++++++++++ templates/repo/actions/list.tmpl | 92 +++++++++++++++++++++++++++++ templates/repo/actions/no_workflows.tmpl | 8 +++ templates/repo/actions/runs_list.tmpl | 43 ++++++++++++++ templates/repo/actions/status.tmpl | 29 ++++++++++ templates/repo/actions/view.tmpl | 33 +++++++++++ 6 files changed, 304 insertions(+) create mode 100644 templates/repo/actions/dispatch.tmpl create mode 100644 templates/repo/actions/list.tmpl create mode 100644 templates/repo/actions/no_workflows.tmpl create mode 100644 templates/repo/actions/runs_list.tmpl create mode 100644 templates/repo/actions/status.tmpl create mode 100644 templates/repo/actions/view.tmpl (limited to 'templates/repo/actions') diff --git a/templates/repo/actions/dispatch.tmpl b/templates/repo/actions/dispatch.tmpl new file mode 100644 index 00000000..520a9b50 --- /dev/null +++ b/templates/repo/actions/dispatch.tmpl @@ -0,0 +1,99 @@ +
+ + {{ctx.Locale.Tr "actions.workflow.dispatch.trigger_found"}} + + + +
\ No newline at end of file diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl new file mode 100644 index 00000000..263530f9 --- /dev/null +++ b/templates/repo/actions/list.tmpl @@ -0,0 +1,92 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + + {{if .HasWorkflowsOrRuns}} +
+ +
+ + + {{if $.CurWorkflowDispatch}} + {{template "repo/actions/dispatch" .}} + {{end}} + + {{template "repo/actions/runs_list" .}} +
+
+ {{else}} + {{template "repo/actions/no_workflows" .}} + {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/actions/no_workflows.tmpl b/templates/repo/actions/no_workflows.tmpl new file mode 100644 index 00000000..88d6e513 --- /dev/null +++ b/templates/repo/actions/no_workflows.tmpl @@ -0,0 +1,8 @@ +
+ {{svg "octicon-no-entry" 48}} +

{{ctx.Locale.Tr "actions.runs.no_workflows"}}

+ {{if and .CanWriteCode .CanWriteActions}} +

{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://forgejo.org/docs/latest/admin/actions/"}}

+ {{end}} +

{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://forgejo.org/docs/latest/admin/actions/"}}

+
diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl new file mode 100644 index 00000000..e37f3d7d --- /dev/null +++ b/templates/repo/actions/runs_list.tmpl @@ -0,0 +1,43 @@ +
+ {{if not .Runs}} +
+ {{svg "octicon-no-entry" 48}} +

{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}

+
+ {{end}} + {{range .Runs}} +
+
+ {{template "repo/actions/status" (dict "status" .Status.String)}} +
+
+ + {{if .Title}}{{.Title}}{{else}}{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}{{end}} + +
+ {{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}} - + {{- if .ScheduleID -}} + {{ctx.Locale.Tr "actions.runs.scheduled"}} + {{- else -}} + {{ctx.Locale.Tr "actions.runs.commit"}} + {{ShortSha .CommitSHA}} + {{ctx.Locale.Tr "actions.runs.pushed_by"}} + {{.TriggerUser.GetDisplayName}} + {{- end -}} +
+
+
+ {{if .RefLink}} + {{.PrettyRef}} + {{else}} + {{.PrettyRef}} + {{end}} +
+
{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}
+
{{svg "octicon-stopwatch" 16}}{{.Duration}}
+
+
+
+ {{end}} +
+{{template "base/paginate" .}} diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl new file mode 100644 index 00000000..a0e02cf8 --- /dev/null +++ b/templates/repo/actions/status.tmpl @@ -0,0 +1,29 @@ + +{{- $size := 16 -}} +{{- if .size -}} +{{- $size = .size -}} +{{- end -}} + +{{- $className := "" -}} +{{- if .className -}} +{{- $className = .className -}} +{{- end -}} + + +{{if eq .status "success"}} + {{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}} +{{else if eq .status "skipped"}} + {{svg "octicon-skip" $size (printf "text grey %s" $className)}} +{{else if eq .status "waiting"}} + {{svg "octicon-clock" $size (printf "text yellow %s" $className)}} +{{else if eq .status "blocked"}} + {{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 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}} + diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl new file mode 100644 index 00000000..b7877627 --- /dev/null +++ b/templates/repo/actions/view.tmpl @@ -0,0 +1,33 @@ +{{template "base/head" .}} + +
+ {{template "repo/header" .}} +
+
+
+ +{{template "base/footer" .}} -- cgit v1.2.3