[prev in list] [next in list] [prev in thread] [next in thread]
List: gameoftrees
Subject: Re: gotwebd: add actions in the blame page too
From: Tracey Emery <tracey () traceyemery ! net>
Date: 2023-12-01 17:48:10
Message-ID: 20231201174810.jidmabhjg6gxejpj () traceyemery ! net
[Download RAW message or body]
On Fri, Dec 01, 2023 at 05:59:03PM +0100, Omar Polo wrote:
> similarly to what just done for the blob page
>
> here's an example:
Ok. I think you can go ahead with all of these changes without ok's on
each.
>
> https://got.omarpolo.com/?action=blob&commit=4dfd9794964c0817a9cab3b2b8ea8858589b28ab&file=README&path=got.git
>
> diff /home/op/w/got
> commit - 4dfd9794964c0817a9cab3b2b8ea8858589b28ab
> path + /home/op/w/got
> blob - 3080be599c4dbac49c74a4048614b42b1194bad9
> file + gotwebd/pages.tmpl
> --- gotwebd/pages.tmpl
> +++ gotwebd/pages.tmpl
> @@ -1019,7 +1019,24 @@ nextsep(char *s, char **t)
> const struct got_error *err;
> struct request *c = tp->tp_arg;
> struct transport *t = c->t;
> + struct querystring *qs = t->qs;
> struct repo_commit *rc = TAILQ_FIRST(&t->repo_commits);
> + struct gotweb_url briefs_url, blob_url, raw_url;
> +
> + memset(&briefs_url, 0, sizeof(briefs_url));
> + briefs_url.index_page = -1,
> + briefs_url.page = -1,
> + briefs_url.action = BRIEFS,
> + briefs_url.path = qs->path,
> + briefs_url.commit = qs->commit,
> + briefs_url.folder = qs->folder,
> + briefs_url.file = qs->file,
> +
> + memcpy(&blob_url, &briefs_url, sizeof(blob_url));
> + blob_url.action = BLOB;
> +
> + memcpy(&raw_url, &briefs_url, sizeof(raw_url));
> + raw_url.action = BLOBRAW;
> !}
> <header class="subtitle">
> <h2>Blame</h2>
> @@ -1033,6 +1050,20 @@ nextsep(char *s, char **t)
> </dd>
> <dt>Message:</dt>
> <dd class="commit-msg">{{ rc->commit_msg }}</dd>
> + <dt>Actions:</dt>
> + <dd>
> + <a href="{{ render gotweb_render_url(c, &briefs_url) }}">
> + History
> + </a>
> + {{" | "}}
> + <a href="{{ render gotweb_render_url(c, &blob_url) }}">
> + Blob
> + </a>
> + {{" | "}}
> + <a href="{{ render gotweb_render_url(c, &raw_url) }}">
> + Raw File
> + </a>
> + </dd>
> </dl>
> </div>
> <hr />
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic