tangled
alpha
login
or
join now
lewis.moe
/
tangled-core
0
fork
atom
Monorepo for Tangled
0
fork
atom
overview
issues
1
pulls
pipelines
appview: style commits in format-patches
Akshay
10 months ago
fac0abc1
56f6fbc7
+50
-34
1 changed file
expand all
collapse all
unified
split
appview
pages
templates
repo
pulls
pull.html
+50
-34
appview/pages/templates/repo/pulls/pull.html
···
64
64
65
65
{{ if .IsFormatPatch }}
66
66
{{ $patches := .AsFormatPatch }}
67
67
-
{{ range $patches }}
68
68
-
<div class="rounded ml-20 drop-shadow-sm bg-white dark:bg-gray-800 dark:text-white w-fit md:max-w-3/5 flex flex-col gap-2 mt-2 relative">
69
69
-
<div id="commit-{{.SHA}}" class="py-2 px-2 relative w-full md:max-w-3/5 md:w-fit flex flex-col">
70
70
-
<div class="flex items-center justify-between gap-2">
71
71
-
<div class="mr-4 flex items-center justify-start">
72
72
-
{{ i "git-commit-horizontal" "w-4 h-4 mr-1.5" }}
73
73
-
<span>{{ .Title }}</span>
67
67
+
{{ $round := .RoundNumber }}
68
68
+
<details class="group py-2 md:ml-[3.5rem] text-gray-500 dark:text-gray-400 flex flex-col gap-2 relative text-sm">
69
69
+
<summary class="py-1 list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
70
70
+
{{ $s := "s" }}
71
71
+
{{ if eq (len $patches) 1 }}
72
72
+
{{ $s = "" }}
73
73
+
{{ end }}
74
74
+
<div class="group-open:hidden flex items-center gap-2 ml-2">
75
75
+
{{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $patches }} commit{{$s}}
76
76
+
</div>
77
77
+
<div class="hidden group-open:flex items-center gap-2 ml-2">
78
78
+
{{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $patches }} commit{{$s}}
79
79
+
</div>
80
80
+
</summary>
81
81
+
{{ range $patches }}
82
82
+
<div id="commit-{{.SHA}}" class="py-1 px-2 relative w-full md:max-w-3/5 md:w-fit flex flex-col">
83
83
+
<div class="flex items-center gap-2">
84
84
+
{{ i "git-commit-horizontal" "w-4 h-4" }}
85
85
+
<div class="text-sm text-gray-500 dark:text-gray-400">
86
86
+
{{ if not $.Pull.IsPatchBased }}
87
87
+
{{ $fullRepo := $.RepoInfo.FullName }}
88
88
+
{{ if not $.Pull.IsBranchBased }}
89
89
+
{{ $fullRepo = printf "%s/%s" $owner $.PullSourceRepo.Name }}
90
90
+
{{ end }}
91
91
+
<a href="/{{ $fullRepo }}/commit/{{ .SHA }}" class="font-mono text-gray-500 dark:text-gray-400">{{ slice .SHA 0 8 }}</a>
92
92
+
{{ else }}
93
93
+
<span class="font-mono">{{ slice .SHA 0 8 }}</span>
94
94
+
{{ end }}
95
95
+
</div>
96
96
+
<div class="flex items-center">
97
97
+
<span>{{ .Title }}</span>
98
98
+
{{ if gt (len .Body) 0 }}
99
99
+
<button
100
100
+
class="py-1/2 px-1 mx-2 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
101
101
+
hx-on:click="document.getElementById('body-{{$round}}-{{.SHA}}').classList.toggle('hidden')"
102
102
+
>
103
103
+
{{ i "ellipsis" "w-3 h-3" }}
104
104
+
</button>
105
105
+
{{ end }}
106
106
+
</div>
107
107
+
</div>
74
108
{{ if gt (len .Body) 0 }}
75
75
-
<button
76
76
-
class="py-1/2 px-1 mx-2 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
77
77
-
hx-on:click="document.getElementById('body-{{.SHA}}').classList.toggle('hidden')"
78
78
-
>
79
79
-
{{ i "ellipsis" "w-3 h-3" }}
80
80
-
</button>
109
109
+
<p id="body-{{$round}}-{{.SHA}}" class="hidden mt-1 text-sm pb-2">
110
110
+
{{ nl2br .Body }}
111
111
+
</p>
81
112
{{ end }}
82
82
-
</div>
83
83
-
<div class="text-sm text-gray-500 dark:text-gray-400">
84
84
-
{{ if not $.Pull.IsPatchBased }}
85
85
-
{{ $fullRepo := $.RepoInfo.FullName }}
86
86
-
{{ if not $.Pull.IsBranchBased }}
87
87
-
{{ $fullRepo = printf "%s/%s" $owner $.PullSourceRepo.Name }}
88
88
-
{{ end }}
89
89
-
<a href="/{{ $fullRepo }}/commit/{{ .SHA }}" class="font-mono">{{ slice .SHA 0 8 }}</a>
90
90
-
{{ else }}
91
91
-
<span class="font-mono">{{ slice .SHA 0 8 }}</span>
92
92
-
{{ end }}
93
93
-
</div>
94
113
</div>
95
95
-
{{ if gt (len .Body) 0 }}
96
96
-
<p id="body-{{.SHA}}" class="hidden mt-1 text-sm pb-2 dark:text-gray-300">
97
97
-
{{ nl2br .Body }}
98
98
-
</p>
99
99
-
{{ end }}
100
100
-
</div>
101
101
-
</div>
102
102
-
{{ end }}
114
114
+
{{ end }}
115
115
+
</details>
103
116
{{ end }}
104
117
105
118
106
106
-
<div class="md:pl-12 flex flex-col gap-2 mt-2 relative">
119
119
+
<div class="md:pl-[3.5rem] flex flex-col gap-2 mt-2 relative">
107
120
{{ range $cidx, $c := .Comments }}
108
121
<div id="comment-{{$c.ID}}" class="bg-white dark:bg-gray-800 rounded drop-shadow-sm py-2 px-4 relative w-full md:max-w-3/5 md:w-fit">
109
122
{{ if gt $cidx 0 }}
···
204
217
</div>
205
218
{{ end }}
206
219
{{ end }}
220
220
+
221
221
+
{{ define "commits" }}
222
222
+
{{ end }}