Blame


1 ed619ca0 2022-12-14 op {!
2 ed619ca0 2022-12-14 op /*
3 ed619ca0 2022-12-14 op * Copyright (c) 2022 Omar Polo <op@openbsd.org>
4 ed619ca0 2022-12-14 op * Copyright (c) 2016, 2019, 2020-2022 Tracey Emery <tracey@traceyemery.net>
5 ed619ca0 2022-12-14 op *
6 ed619ca0 2022-12-14 op * Permission to use, copy, modify, and distribute this software for any
7 ed619ca0 2022-12-14 op * purpose with or without fee is hereby granted, provided that the above
8 ed619ca0 2022-12-14 op * copyright notice and this permission notice appear in all copies.
9 ed619ca0 2022-12-14 op *
10 ed619ca0 2022-12-14 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 ed619ca0 2022-12-14 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 ed619ca0 2022-12-14 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ed619ca0 2022-12-14 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 ed619ca0 2022-12-14 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ed619ca0 2022-12-14 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 ed619ca0 2022-12-14 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 ed619ca0 2022-12-14 op */
18 ed619ca0 2022-12-14 op
19 ed619ca0 2022-12-14 op #include <sys/types.h>
20 ed619ca0 2022-12-14 op #include <sys/queue.h>
21 ed619ca0 2022-12-14 op
22 ed619ca0 2022-12-14 op #include <event.h>
23 ed619ca0 2022-12-14 op #include <stdint.h>
24 ed619ca0 2022-12-14 op #include <stdlib.h>
25 ed619ca0 2022-12-14 op #include <string.h>
26 ed619ca0 2022-12-14 op #include <imsg.h>
27 ed619ca0 2022-12-14 op
28 ed619ca0 2022-12-14 op #include "proc.h"
29 ed619ca0 2022-12-14 op
30 ed619ca0 2022-12-14 op #include "gotwebd.h"
31 ed619ca0 2022-12-14 op #include "tmpl.h"
32 ed619ca0 2022-12-14 op
33 ed619ca0 2022-12-14 op static int
34 ed619ca0 2022-12-14 op gotweb_render_age(struct template *tp, time_t time, int ref_tm)
35 ed619ca0 2022-12-14 op {
36 ed619ca0 2022-12-14 op const struct got_error *err;
37 ed619ca0 2022-12-14 op char *age;
38 ed619ca0 2022-12-14 op int r;
39 ed619ca0 2022-12-14 op
40 ed619ca0 2022-12-14 op err = gotweb_get_time_str(&age, time, ref_tm);
41 ed619ca0 2022-12-14 op if (err)
42 ed619ca0 2022-12-14 op return 0;
43 ed619ca0 2022-12-14 op r = tp->tp_puts(tp, age);
44 ed619ca0 2022-12-14 op free(age);
45 ed619ca0 2022-12-14 op return r;
46 ed619ca0 2022-12-14 op }
47 ed619ca0 2022-12-14 op
48 ed619ca0 2022-12-14 op !}
49 ed619ca0 2022-12-14 op
50 ed619ca0 2022-12-14 op {{ define gotweb_render_header(struct template *tp) }}
51 ed619ca0 2022-12-14 op {!
52 ed619ca0 2022-12-14 op struct request *c = tp->tp_arg;
53 ed619ca0 2022-12-14 op struct server *srv = c->srv;
54 ed619ca0 2022-12-14 op struct querystring *qs = c->t->qs;
55 ed619ca0 2022-12-14 op struct gotweb_url u_path;
56 d19d9fce 2022-12-20 op const char *prfx = c->document_uri;
57 ed619ca0 2022-12-14 op const char *css = srv->custom_css;
58 ed619ca0 2022-12-14 op
59 ed619ca0 2022-12-14 op memset(&u_path, 0, sizeof(u_path));
60 ed619ca0 2022-12-14 op u_path.index_page = -1;
61 ed619ca0 2022-12-14 op u_path.page = -1;
62 ed619ca0 2022-12-14 op u_path.action = SUMMARY;
63 ed619ca0 2022-12-14 op !}
64 ed619ca0 2022-12-14 op <!doctype html>
65 ed619ca0 2022-12-14 op <html>
66 ed619ca0 2022-12-14 op <head>
67 ed619ca0 2022-12-14 op <meta charset="utf-8" />
68 ed619ca0 2022-12-14 op <title>{{ srv->site_name }}</title>
69 ed619ca0 2022-12-14 op <meta name="viewport" content="initial-scale=.75" />
70 ed619ca0 2022-12-14 op <meta name="msapplication-TileColor" content="#da532c" />
71 ed619ca0 2022-12-14 op <meta name="theme-color" content="#ffffff"/>
72 ed619ca0 2022-12-14 op <link rel="apple-touch-icon" sizes="180x180" href="{{ prfx }}apple-touch-icon.png" />
73 ed619ca0 2022-12-14 op <link rel="icon" type="image/png" sizes="32x32" href="{{ prfx }}favicon-32x32.png" />
74 ed619ca0 2022-12-14 op <link rel="icon" type="image/png" sizes="16x16" href="{{ prfx }}favicon-16x16.png" />
75 ed619ca0 2022-12-14 op <link rel="manifest" href="{{ prfx }}site.webmanifest"/>
76 ed619ca0 2022-12-14 op <link rel="mask-icon" href="{{ prfx }}safari-pinned-tab.svg" />
77 ed619ca0 2022-12-14 op <link rel="stylesheet" type="text/css" href="{{ prfx }}{{ css }}" />
78 ed619ca0 2022-12-14 op </head>
79 ed619ca0 2022-12-14 op <body>
80 ed619ca0 2022-12-14 op <div id="gw_body">
81 ed619ca0 2022-12-14 op <div id="header">
82 ed619ca0 2022-12-14 op <div id="got_link">
83 ed619ca0 2022-12-14 op <a href="{{ srv->logo_url }}" target="_blank">
84 ed619ca0 2022-12-14 op <img src="{{ prfx }}{{ srv->logo }}" />
85 ed619ca0 2022-12-14 op </a>
86 ed619ca0 2022-12-14 op </div>
87 ed619ca0 2022-12-14 op </div>
88 ed619ca0 2022-12-14 op <div id="site_path">
89 ed619ca0 2022-12-14 op <div id="site_link">
90 ed619ca0 2022-12-14 op <a href="?index_page={{ printf "%d", qs->index_page }}">
91 ed619ca0 2022-12-14 op {{ srv->site_link }}
92 ed619ca0 2022-12-14 op </a>
93 ed619ca0 2022-12-14 op {{ if qs->path }}
94 ed619ca0 2022-12-14 op {! u_path.path = qs->path; !}
95 ed619ca0 2022-12-14 op {{ " / " }}
96 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &u_path)}}">
97 ed619ca0 2022-12-14 op {{ qs->path }}
98 ed619ca0 2022-12-14 op </a>
99 ed619ca0 2022-12-14 op {{ end }}
100 ed619ca0 2022-12-14 op {{ if qs->action != INDEX }}
101 ed619ca0 2022-12-14 op {{ " / " }}{{ gotweb_action_name(qs->action) }}
102 ed619ca0 2022-12-14 op {{ end }}
103 ed619ca0 2022-12-14 op </div>
104 ed619ca0 2022-12-14 op </div>
105 ed619ca0 2022-12-14 op <div id="content">
106 ed619ca0 2022-12-14 op {{ end }}
107 ed619ca0 2022-12-14 op
108 ed619ca0 2022-12-14 op {{ define gotweb_render_footer(struct template *tp) }}
109 ed619ca0 2022-12-14 op {!
110 ed619ca0 2022-12-14 op struct request *c = tp->tp_arg;
111 ed619ca0 2022-12-14 op struct server *srv = c->srv;
112 ed619ca0 2022-12-14 op !}
113 ed619ca0 2022-12-14 op <div id="site_owner_wrapper">
114 ed619ca0 2022-12-14 op <div id="site_owner">
115 ed619ca0 2022-12-14 op {{ if srv->show_site_owner }}
116 ed619ca0 2022-12-14 op {{ srv->site_owner }}
117 ed619ca0 2022-12-14 op {{ end }}
118 ed619ca0 2022-12-14 op </div>
119 ed619ca0 2022-12-14 op </div>
120 ed619ca0 2022-12-14 op </div>
121 ed619ca0 2022-12-14 op </div>
122 ed619ca0 2022-12-14 op </body>
123 ed619ca0 2022-12-14 op </html>
124 ed619ca0 2022-12-14 op {{ end }}
125 ed619ca0 2022-12-14 op
126 ed619ca0 2022-12-14 op {{ define gotweb_render_repo_table_hdr(struct template *tp) }}
127 ed619ca0 2022-12-14 op {!
128 ed619ca0 2022-12-14 op struct request *c = tp->tp_arg;
129 ed619ca0 2022-12-14 op struct server *srv = c->srv;
130 ed619ca0 2022-12-14 op !}
131 ed619ca0 2022-12-14 op <div id="index_header">
132 ed619ca0 2022-12-14 op <div id="index_header_project">
133 ed619ca0 2022-12-14 op Project
134 ed619ca0 2022-12-14 op </div>
135 ed619ca0 2022-12-14 op {{ if srv->show_repo_description }}
136 ed619ca0 2022-12-14 op <div id="index_header_description">
137 ed619ca0 2022-12-14 op Description
138 ed619ca0 2022-12-14 op </div>
139 ed619ca0 2022-12-14 op {{ end }}
140 ed619ca0 2022-12-14 op {{ if srv->show_repo_owner }}
141 ed619ca0 2022-12-14 op <div id="index_header_owner">
142 ed619ca0 2022-12-14 op Owner
143 ed619ca0 2022-12-14 op </div>
144 ed619ca0 2022-12-14 op {{ end }}
145 ed619ca0 2022-12-14 op {{ if srv->show_repo_age }}
146 ed619ca0 2022-12-14 op <div id="index_header_age">
147 ed619ca0 2022-12-14 op Last Change
148 ed619ca0 2022-12-14 op </div>
149 ed619ca0 2022-12-14 op {{ end }}
150 ed619ca0 2022-12-14 op </div>
151 ed619ca0 2022-12-14 op {{ end }}
152 ed619ca0 2022-12-14 op
153 ed619ca0 2022-12-14 op {{ define gotweb_render_repo_fragment(struct template *tp, struct repo_dir *repo_dir) }}
154 ed619ca0 2022-12-14 op {!
155 ed619ca0 2022-12-14 op struct request *c = tp->tp_arg;
156 ed619ca0 2022-12-14 op struct server *srv = c->srv;
157 ed619ca0 2022-12-14 op struct gotweb_url summary = {
158 ed619ca0 2022-12-14 op .action = SUMMARY,
159 ed619ca0 2022-12-14 op .index_page = -1,
160 ed619ca0 2022-12-14 op .page = -1,
161 ed619ca0 2022-12-14 op .path = repo_dir->name,
162 ed619ca0 2022-12-14 op }, briefs = {
163 ed619ca0 2022-12-14 op .action = BRIEFS,
164 ed619ca0 2022-12-14 op .index_page = -1,
165 ed619ca0 2022-12-14 op .page = -1,
166 ed619ca0 2022-12-14 op .path = repo_dir->name,
167 ed619ca0 2022-12-14 op }, commits = {
168 ed619ca0 2022-12-14 op .action = COMMITS,
169 ed619ca0 2022-12-14 op .index_page = -1,
170 ed619ca0 2022-12-14 op .page = -1,
171 ed619ca0 2022-12-14 op .path = repo_dir->name,
172 ed619ca0 2022-12-14 op }, tags = {
173 ed619ca0 2022-12-14 op .action = TAGS,
174 ed619ca0 2022-12-14 op .index_page = -1,
175 ed619ca0 2022-12-14 op .page = -1,
176 ed619ca0 2022-12-14 op .path = repo_dir->name,
177 ed619ca0 2022-12-14 op }, tree = {
178 ed619ca0 2022-12-14 op .action = TREE,
179 ed619ca0 2022-12-14 op .index_page = -1,
180 ed619ca0 2022-12-14 op .page = -1,
181 ed619ca0 2022-12-14 op .path = repo_dir->name,
182 ed619ca0 2022-12-14 op };
183 ed619ca0 2022-12-14 op !}
184 ed619ca0 2022-12-14 op <div class="index_wrapper">
185 ed619ca0 2022-12-14 op <div class="index_project">
186 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &summary) }}">{{ repo_dir->name }}</a>
187 ed619ca0 2022-12-14 op </div>
188 ed619ca0 2022-12-14 op {{ if srv->show_repo_description }}
189 ed619ca0 2022-12-14 op <div class="index_project_description">
190 ed619ca0 2022-12-14 op {{ repo_dir->description }}
191 ed619ca0 2022-12-14 op </div>
192 ed619ca0 2022-12-14 op {{ end }}
193 ed619ca0 2022-12-14 op {{ if srv->show_repo_owner }}
194 ed619ca0 2022-12-14 op <div class="index_project_owner">
195 ed619ca0 2022-12-14 op {{ repo_dir->owner }}
196 ed619ca0 2022-12-14 op </div>
197 ed619ca0 2022-12-14 op {{ end }}
198 ed619ca0 2022-12-14 op {{ if srv->show_repo_age }}
199 ed619ca0 2022-12-14 op <div class="index_project_age">
200 ed619ca0 2022-12-14 op {{ repo_dir->age }}
201 ed619ca0 2022-12-14 op </div>
202 ed619ca0 2022-12-14 op {{ end }}
203 ed619ca0 2022-12-14 op <div class="navs_wrapper">
204 ed619ca0 2022-12-14 op <div class="navs">
205 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &summary) }}">summary</a>
206 ed619ca0 2022-12-14 op {{ " | " }}
207 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &briefs) }}">briefs</a>
208 ed619ca0 2022-12-14 op {{ " | " }}
209 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &commits) }}">commits</a>
210 ed619ca0 2022-12-14 op {{ " | " }}
211 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &tags) }}">tags</a>
212 ed619ca0 2022-12-14 op {{ " | " }}
213 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &tree) }}">tree</a>
214 ed619ca0 2022-12-14 op </div>
215 ed619ca0 2022-12-14 op <div class="dotted_line"></div>
216 ed619ca0 2022-12-14 op </div>
217 ed619ca0 2022-12-14 op </div>
218 ed619ca0 2022-12-14 op {{ end }}
219 ed619ca0 2022-12-14 op
220 ed619ca0 2022-12-14 op {{ define gotweb_render_briefs(struct template *tp) }}
221 ed619ca0 2022-12-14 op {!
222 ed619ca0 2022-12-14 op const struct got_error *error;
223 ed619ca0 2022-12-14 op struct request *c = tp->tp_arg;
224 ed619ca0 2022-12-14 op struct server *srv = c->srv;
225 ed619ca0 2022-12-14 op struct transport *t = c->t;
226 ed619ca0 2022-12-14 op struct querystring *qs = c->t->qs;
227 ed619ca0 2022-12-14 op struct repo_commit *rc;
228 ed619ca0 2022-12-14 op struct repo_dir *repo_dir = t->repo_dir;
229 ed619ca0 2022-12-14 op struct gotweb_url diff_url, tree_url;
230 ed619ca0 2022-12-14 op char *tmp;
231 ed619ca0 2022-12-14 op
232 ed619ca0 2022-12-14 op diff_url = (struct gotweb_url){
233 ed619ca0 2022-12-14 op .action = DIFF,
234 ed619ca0 2022-12-14 op .index_page = -1,
235 ed619ca0 2022-12-14 op .page = -1,
236 ed619ca0 2022-12-14 op .path = repo_dir->name,
237 ed619ca0 2022-12-14 op .headref = qs->headref,
238 ed619ca0 2022-12-14 op };
239 ed619ca0 2022-12-14 op tree_url = (struct gotweb_url){
240 ed619ca0 2022-12-14 op .action = TREE,
241 ed619ca0 2022-12-14 op .index_page = -1,
242 ed619ca0 2022-12-14 op .page = -1,
243 ed619ca0 2022-12-14 op .path = repo_dir->name,
244 ed619ca0 2022-12-14 op .headref = qs->headref,
245 ed619ca0 2022-12-14 op };
246 ed619ca0 2022-12-14 op
247 ed619ca0 2022-12-14 op if (qs->action == SUMMARY) {
248 ed619ca0 2022-12-14 op qs->action = BRIEFS;
249 ed619ca0 2022-12-14 op error = got_get_repo_commits(c, D_MAXSLCOMMDISP);
250 ed619ca0 2022-12-14 op } else
251 ed619ca0 2022-12-14 op error = got_get_repo_commits(c, srv->max_commits_display);
252 ed619ca0 2022-12-14 op if (error)
253 ed619ca0 2022-12-14 op return -1;
254 ed619ca0 2022-12-14 op !}
255 ed619ca0 2022-12-14 op <div id="briefs_title_wrapper">
256 ed619ca0 2022-12-14 op <div id="briefs_title">Commit Briefs</div>
257 ed619ca0 2022-12-14 op </div>
258 ed619ca0 2022-12-14 op <div id="briefs_content">
259 ed619ca0 2022-12-14 op {{ tailq-foreach rc &t->repo_commits entry }}
260 ed619ca0 2022-12-14 op {!
261 ed619ca0 2022-12-14 op diff_url.commit = rc->commit_id;
262 ed619ca0 2022-12-14 op tree_url.commit = rc->commit_id;
263 ed619ca0 2022-12-14 op
264 ed619ca0 2022-12-14 op tmp = strchr(rc->author, '<');
265 ed619ca0 2022-12-14 op if (tmp)
266 ed619ca0 2022-12-14 op *tmp = '\0';
267 ed619ca0 2022-12-14 op
268 ed619ca0 2022-12-14 op tmp = strchr(rc->commit_msg, '\n');
269 ed619ca0 2022-12-14 op if (tmp)
270 ed619ca0 2022-12-14 op *tmp = '\0';
271 ed619ca0 2022-12-14 op !}
272 ed619ca0 2022-12-14 op <div class="briefs_age">
273 ed619ca0 2022-12-14 op {{ render gotweb_render_age(tp, rc->committer_time, TM_DIFF) }}
274 ed619ca0 2022-12-14 op </div>
275 ed619ca0 2022-12-14 op <div class="briefs_author">
276 ed619ca0 2022-12-14 op {{ rc->author }}
277 ed619ca0 2022-12-14 op </div>
278 ed619ca0 2022-12-14 op <div class="briefs_log">
279 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
280 ed619ca0 2022-12-14 op {{ rc->commit_msg }}
281 ed619ca0 2022-12-14 op </a>
282 ed619ca0 2022-12-14 op {{ if rc->refs_str }}
283 ed619ca0 2022-12-14 op {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
284 ed619ca0 2022-12-14 op {{ end }}
285 ed619ca0 2022-12-14 op </a>
286 ed619ca0 2022-12-14 op </div>
287 ed619ca0 2022-12-14 op <div class="navs_wrapper">
288 ed619ca0 2022-12-14 op <div class="navs">
289 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">diff</a>
290 ed619ca0 2022-12-14 op {{ " | " }}
291 ed619ca0 2022-12-14 op <a href="{{ render gotweb_render_url(tp->tp_arg, &tree_url) }}">tree</a>
292 ed619ca0 2022-12-14 op </div>
293 ed619ca0 2022-12-14 op </div>
294 ed619ca0 2022-12-14 op <div class="dotted_line"></div>
295 ed619ca0 2022-12-14 op {{ end }}
296 ed619ca0 2022-12-14 op {{ if t->next_id || t->prev_id }}
297 b4c0bd72 2022-12-17 op {{ render gotweb_render_navs(tp) }}
298 ed619ca0 2022-12-14 op {{ end }}
299 b4c0bd72 2022-12-17 op </div>
300 b4c0bd72 2022-12-17 op {{ end }}
301 b4c0bd72 2022-12-17 op
302 b4c0bd72 2022-12-17 op {{ define gotweb_render_navs(struct template *tp) }}
303 b4c0bd72 2022-12-17 op {!
304 b4c0bd72 2022-12-17 op struct request *c = tp->tp_arg;
305 b4c0bd72 2022-12-17 op struct transport *t = c->t;
306 b4c0bd72 2022-12-17 op struct gotweb_url prev, next;
307 b4c0bd72 2022-12-17 op int have_prev, have_next;
308 b4c0bd72 2022-12-17 op
309 b4c0bd72 2022-12-17 op gotweb_get_navs(c, &prev, &have_prev, &next, &have_next);
310 b4c0bd72 2022-12-17 op !}
311 b4c0bd72 2022-12-17 op <div id="np_wrapper">
312 b4c0bd72 2022-12-17 op <div id="nav_prev">
313 b4c0bd72 2022-12-17 op {{ if have_prev }}
314 b4c0bd72 2022-12-17 op <a href="{{ render gotweb_render_url(c, &prev) }}">
315 b4c0bd72 2022-12-17 op Previous
316 b4c0bd72 2022-12-17 op </a>
317 b4c0bd72 2022-12-17 op {{ end }}
318 b4c0bd72 2022-12-17 op </div>
319 b4c0bd72 2022-12-17 op <div id="nav_next">
320 b4c0bd72 2022-12-17 op {{ if have_next }}
321 b4c0bd72 2022-12-17 op <a href="{{ render gotweb_render_url(c, &next) }}">
322 b4c0bd72 2022-12-17 op Next
323 b4c0bd72 2022-12-17 op </a>
324 b4c0bd72 2022-12-17 op {{ end }}
325 b4c0bd72 2022-12-17 op </div>
326 ed619ca0 2022-12-14 op </div>
327 b4c0bd72 2022-12-17 op {{ finally }}
328 b4c0bd72 2022-12-17 op {!
329 b4c0bd72 2022-12-17 op free(t->next_id);
330 b4c0bd72 2022-12-17 op t->next_id = NULL;
331 b4c0bd72 2022-12-17 op free(t->prev_id);
332 b4c0bd72 2022-12-17 op t->prev_id = NULL;
333 b4c0bd72 2022-12-17 op !}
334 ed619ca0 2022-12-14 op {{ end }}
335 156a1144 2022-12-17 op
336 156a1144 2022-12-17 op {{ define gotweb_render_commits(struct template *tp) }}
337 156a1144 2022-12-17 op {!
338 156a1144 2022-12-17 op struct request *c = tp->tp_arg;
339 156a1144 2022-12-17 op struct transport *t = c->t;
340 156a1144 2022-12-17 op struct repo_dir *repo_dir = t->repo_dir;
341 156a1144 2022-12-17 op struct repo_commit *rc;
342 156a1144 2022-12-17 op struct gotweb_url diff, tree;
343 156a1144 2022-12-17 op
344 156a1144 2022-12-17 op diff = (struct gotweb_url){
345 156a1144 2022-12-17 op .action = DIFF,
346 156a1144 2022-12-17 op .index_page = -1,
347 156a1144 2022-12-17 op .page = -1,
348 156a1144 2022-12-17 op .path = repo_dir->name,
349 156a1144 2022-12-17 op };
350 156a1144 2022-12-17 op tree = (struct gotweb_url){
351 156a1144 2022-12-17 op .action = TREE,
352 156a1144 2022-12-17 op .index_page = -1,
353 156a1144 2022-12-17 op .page = -1,
354 156a1144 2022-12-17 op .path = repo_dir->name,
355 156a1144 2022-12-17 op };
356 156a1144 2022-12-17 op !}
357 156a1144 2022-12-17 op <div class="commits_title_wrapper">
358 156a1144 2022-12-17 op <div class="commits_title">Commits</div>
359 156a1144 2022-12-17 op </div>
360 156a1144 2022-12-17 op <div class="commits_content">
361 156a1144 2022-12-17 op {{ tailq-foreach rc &t->repo_commits entry }}
362 156a1144 2022-12-17 op {!
363 156a1144 2022-12-17 op diff.commit = rc->commit_id;
364 156a1144 2022-12-17 op tree.commit = rc->commit_id;
365 156a1144 2022-12-17 op !}
366 156a1144 2022-12-17 op <div class="commits_header_wrapper">
367 156a1144 2022-12-17 op <div class="commits_header">
368 156a1144 2022-12-17 op <div class="header_commit_title">Commit:</div>
369 156a1144 2022-12-17 op <div class="header_commit">{{ rc->commit_id }}</div>
370 156a1144 2022-12-17 op <div class="header_author_title">Author:</div>
371 156a1144 2022-12-17 op <div class="header_author">{{ rc->author }}</div>
372 156a1144 2022-12-17 op <div class="header_age_title">Date:</div>
373 156a1144 2022-12-17 op <div class="header_age">
374 156a1144 2022-12-17 op {{ render gotweb_render_age(tp, rc->committer_time, TM_LONG) }}
375 156a1144 2022-12-17 op </div>
376 156a1144 2022-12-17 op </div>
377 156a1144 2022-12-17 op </div>
378 156a1144 2022-12-17 op <div class="navs_wrapper">
379 156a1144 2022-12-17 op <div class="navs">
380 156a1144 2022-12-17 op <a href="{{ render gotweb_render_url(c, &diff) }}">diff</a>
381 156a1144 2022-12-17 op {{ " | " }}
382 156a1144 2022-12-17 op <a href="{{ render gotweb_render_url(c, &tree) }}">tree</a>
383 156a1144 2022-12-17 op </div>
384 156a1144 2022-12-17 op </div>
385 156a1144 2022-12-17 op <div class="dotted_line"></div>
386 156a1144 2022-12-17 op {{ end }}
387 156a1144 2022-12-17 op {{ if t->next_id || t->prev_id }}
388 156a1144 2022-12-17 op {{ render gotweb_render_navs(tp) }}
389 156a1144 2022-12-17 op {{ end }}
390 156a1144 2022-12-17 op </div>
391 156a1144 2022-12-17 op {{ end }}