aboutsummaryrefslogtreecommitdiff
path: root/forged/templates/repo_contrib_one.tmpl
blob: 6556ea91e72a85f489ec2fca707b9a3ce03158fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

{{/*
	SPDX-License-Identifier: AGPL-3.0-only
	SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
*/}}
{{- define "repo_contrib_one" -}}
{{- $root := . -}}
<!DOCTYPE html>
<html lang="en">
	<head>
		{{- template "head_common" . -}}
		<title>Merge requests &ndash; {{ .repo_name }} &ndash; {{ template "group_path_plain" .group_path }} &ndash; {{ .global.forge_title -}}</title>
	</head>
	<body class="repo-contrib-one">
		{{- template "header" . -}}
		<main>
			<div class="repo-header">
				<h2>{{- .repo_name -}}</h2>
				<ul class="nav-tabs-standalone">
					<li class="nav-item">
						<a class="nav-link" href="../{{- template "ref_query" $root -}}">Summary</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../tree/{{- template "ref_query" $root -}}">Tree</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../log/{{- template "ref_query" $root -}}">Log</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../branches/">Branches</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../tags/">Tags</a>
					</li>
					<li class="nav-item">
						<a class="nav-link active" href="../contrib/">Merge requests</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../settings/">Settings</a>
					</li>
				</ul>
			</div>
			<div class="repo-header-extension">
				<div class="repo-header-extension-content">
					{{- .repo_description -}}
				</div>
			</div>
			<div class="padding-wrapper">
				<table id="mr-info-table">
					<thead>
						<tr class="title-row">
							<th colspan="2">Merge request info</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<th scope="row">ID</th>
							<td>{{- .mr_id -}}</td>
						</tr>
						<tr>
							<th scope="row">Status</th>
							<td>{{- .mr_status -}}</td>
						</tr>
						<tr>
							<th scope="row">Title</th>
							<td>{{- .mr_title -}}</td>
						</tr>
						<tr>
							<th scope="row">Source ref</th>
							<td>{{- .mr_source_ref -}}</td>
						</tr>
						<tr>
							<th scope="row">Destination branch</th>
							<td>{{- .mr_destination_branch -}}</td>
						</tr>
						<tr>
							<th scope="row">Merge base</th>
							<td>{{- .merge_base.Hash.String -}}</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="padding-wrapper">
				{{- $merge_base := .merge_base -}}
				{{- $source_commit := .source_commit -}}
				{{- range .file_patches -}}
					<div class="file-patch toggle-on-wrapper">
						<input type="checkbox" id="toggle-{{- .From.Hash -}}{{- .To.Hash -}}" class="file-toggle toggle-on-toggle">
						<label for="toggle-{{- .From.Hash -}}{{- .To.Hash -}}" class="file-header toggle-on-header">
							<div>
								{{- if eq .From.Path "" -}}
									--- /dev/null
								{{- else -}}
									--- a/<a href="../../tree/{{- .From.Path -}}?commit={{- $merge_base.Hash -}}">{{- .From.Path -}}</a> {{ .From.Mode -}}
								{{- end -}}
								<br />
								{{- if eq .To.Path "" -}}
									+++ /dev/null
								{{- else -}}
									+++ b/<a href="../../tree/{{- .To.Path -}}?commit={{- $source_commit.Hash -}}">{{- .To.Path -}}</a> {{ .To.Mode -}}
								{{- end -}}
							</div>
						</label>
						<div class="file-content toggle-on-content scroll">
							{{- range .Chunks -}}
								{{- if eq .Operation 0 -}}
									<pre class="chunk chunk-unchanged">{{ .Content }}</pre>
								{{- else if eq .Operation 1 -}}
									<pre class="chunk chunk-addition">{{ .Content }}</pre>
								{{- else if eq .Operation 2 -}}
									<pre class="chunk chunk-deletion">{{ .Content }}</pre>
								{{- else -}}
									<pre class="chunk chunk-unknown">{{ .Content }}</pre>
								{{- end -}}
							{{- end -}}
						</div>
					</div>
				{{- end -}}
			</div>
		</main>
		<footer>
			{{- template "footer" . -}}
		</footer>
	</body>
</html>
{{- end -}}