From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/repo/actions/dispatch.tmpl | 101 +++++++++++++++++++++++++++++++ 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, 306 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 0000000..48c2aa5 --- /dev/null +++ b/templates/repo/actions/dispatch.tmpl @@ -0,0 +1,101 @@ +
+ + {{ctx.Locale.Tr "actions.workflow.dispatch.trigger_found"}} + + + +
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl new file mode 100644 index 0000000..263530f --- /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 0000000..88d6e51 --- /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 0000000..7bab492 --- /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 0000000..a0e02cf --- /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 0000000..b787762 --- /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