1{{ define "title" }}pipelines · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "extrameta" }}
4 {{ $title := "pipelines"}}
5 {{ $url := printf "https://tangled.org/%s/pipelines" .RepoInfo.FullName }}
6 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
7{{ end }}
8
9{{ define "repoContent" }}
10<div class="flex justify-between items-center gap-4">
11 <div class="w-full flex flex-col gap-2">
12 {{ range .Pipelines }}
13 {{ block "pipeline" (list $ .) }} {{ end }}
14 {{ else }}
15 <p class="text-center pt-5 text-gray-400 dark:text-gray-500">
16 No pipelines run for this repository.
17 </p>
18 {{ end }}
19 </div>
20</div>
21{{ end }}
22
23
24{{ define "pipeline" }}
25 {{ $root := index . 0 }}
26 {{ $p := index . 1 }}
27 <div class="py-2 bg-white dark:bg-gray-800 dark:text-white">
28 {{ block "pipelineHeader" $ }} {{ end }}
29 </div>
30{{ end }}
31
32{{ define "pipelineHeader" }}
33 {{ $root := index . 0 }}
34 {{ $p := index . 1 }}
35 {{ with $p }}
36 <div class="grid grid-cols-6 md:grid-cols-12 gap-2 items-center w-full">
37 <div class="text-sm md:text-base col-span-1">
38 {{ .Trigger.Kind.String }}
39 </div>
40
41 <div class="col-span-2 md:col-span-7 flex items-center gap-4">
42 {{ $target := .Trigger.TargetRef }}
43 {{ $workflows := .Workflows }}
44 {{ $link := "" }}
45 {{ if .IsResponding }}
46 {{ $link = printf "/%s/pipelines/%s/workflow/%d" $root.RepoInfo.FullName .Id (index $workflows 0) }}
47 {{ end }}
48 {{ if .Trigger.IsPush }}
49 <span class="font-bold">{{ $target }}</span>
50 <span class="hidden md:inline-flex gap-2 items-center font-mono text-sm">
51 {{ $old := deref .Trigger.PushOldSha }}
52 {{ $new := deref .Trigger.PushNewSha }}
53
54 <a href="/{{ $root.RepoInfo.FullName }}/commit/{{ $new }}">{{ slice $new 0 8 }}</a>
55 {{ i "arrow-left" "size-4" }}
56 <a href="/{{ $root.RepoInfo.FullName }}/commit/{{ $old }}">{{ slice $old 0 8 }}</a>
57 </span>
58 {{ else if .Trigger.IsPullRequest }}
59 {{ $sha := deref .Trigger.PRSourceSha }}
60 <span class="inline-flex gap-2 items-center">
61 <span class="font-bold">{{ $target }}</span>
62 {{ i "arrow-left" "size-4" }}
63 {{ .Trigger.PRSourceBranch }}
64 <span class="text-sm font-mono">
65 @
66 <a href="/{{ $root.RepoInfo.FullName }}/commit/{{ $sha }}">{{ slice $sha 0 8 }}</a>
67 </span>
68 </span>
69 {{ end }}
70 </div>
71
72 <div class="text-sm md:text-base col-span-1">
73 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" . "RepoInfo" $root.RepoInfo) }}
74 </div>
75
76 <div class="text-sm md:text-base col-span-1 text-right">
77 {{ template "repo/fragments/shortTimeAgo" .Created }}
78 </div>
79
80 {{ $t := .TimeTaken }}
81 <div class="text-sm md:text-base col-span-1 text-right">
82 {{ if $t }}
83 <time title="{{ $t }}">{{ $t | durationFmt }}</time>
84 {{ else }}
85 <time>--</time>
86 {{ end }}
87 </div>
88
89 <div class="col-span-1 flex justify-end">
90 {{ if $link }}
91 <a class="md:hidden" href="/{{ $root.RepoInfo.FullName }}/pipelines/{{ .Id }}/workflow/{{ index $workflows 0 }}">
92 {{ i "arrow-up-right" "size-4" }}
93 </a>
94 <a class="hidden md:inline underline" href="/{{ $root.RepoInfo.FullName }}/pipelines/{{ .Id }}/workflow/{{ index $workflows 0 }}">
95 view
96 </a>
97 {{ end }}
98 </div>
99
100 </div>
101 {{ end }}
102{{ end }}