diff options
Diffstat (limited to 'source/ui-shared.c')
| -rw-r--r-- | source/ui-shared.c | 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 19 insertions, 17 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index a79c291..2ec9d0e 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -611,7 +611,8 @@ static void print_repo_tabs(void) ctx.qry.oid, ctx.qry.vpath); else cgit_tree_link("tree", - tab_title("Browse the tree at %s", "Browse the file tree", vpath), + tab_title("Browse the tree at %s", + "Browse the file tree", vpath), tab_class("tree"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); html("</li>\n<li>"); @@ -686,8 +687,6 @@ static void print_site_search(void) free(currenturl); } -// The link is built out of the request in ctx.qry, so a caller that alters a -// field of ctx.qry first gets a link differing in exactly that. static void snapshot_link(const char *name, const char *title, const char *class, const char *head, const char *rev, const char *archivename) @@ -695,6 +694,8 @@ static void snapshot_link(const char *name, const char *title, const char *class reporevlink("snapshot", name, title, class, head, rev, archivename); } +// The link is built out of the request in ctx.qry, so a caller that alters a +// field of ctx.qry first gets a link differing in exactly that. static void self_link(const char *name, const char *title, const char *class) { if (!strcmp(ctx.qry.page, "repolist")) @@ -1225,10 +1226,7 @@ static const struct forge *forge_for_host(const char *host, size_t len) * Derives a submodule row's links from its .gitmodules entry. The url is * matched against this instance's own repositories first, so ssh, file and * relative urls still land on an internal page when their target is served - * here, and the pinned commit gets a page of its own. A plain web url is - * linked as it is, an ssh url to a known host is rewritten to its web form, - * and anything else is left unlinked with the url as a tooltip, since a - * scheme cgit cannot vouch for has no place in an href. + * here, and a scheme cgit cannot vouch for is left unlinked as a tooltip. */ static void gitmodules_link(const char *path, const char *rev, char **module, char **commit, @@ -1477,7 +1475,8 @@ void cgit_print_http_headers(void) void cgit_redirect(const char *url, bool permanent) { - htmlf("Status: %d %s\n", permanent ? 301 : 302, permanent ? "Moved Permanently" : "Found"); + htmlf("Status: %d %s\n", permanent ? 301 : 302, + permanent ? "Moved Permanently" : "Found"); html("Location: "); html_url_path(url); html("\n\n"); @@ -1500,8 +1499,10 @@ void cgit_print_docstart(void) html("<meta charset='UTF-8'>\n"); html("<meta name='viewport' content='width=device-width, initial-scale=1'>\n"); html("<meta name='color-scheme' content='light dark'>\n"); - html("<meta name='theme-color' media='(prefers-color-scheme: light)' content='#ffffff'>\n"); - html("<meta name='theme-color' media='(prefers-color-scheme: dark)' content='#1b1b1b'>\n"); + html("<meta name='theme-color' media='(prefers-color-scheme: light)'" + " content='#ffffff'>\n"); + html("<meta name='theme-color' media='(prefers-color-scheme: dark)'" + " content='#1b1b1b'>\n"); html("<title>"); // An error page reached before a title was chosen still has to name // itself, since an empty title element is not valid. @@ -1585,7 +1586,8 @@ void cgit_print_docend(void) if (ctx.cfg.footer) html_include(ctx.cfg.footer); else { - htmlf("<footer class='footer'>generated by <a href='https://github.com/brycekwon/cgit'>cgit %s</a> " + htmlf("<footer class='footer'>generated by " + "<a href='https://github.com/brycekwon/cgit'>cgit %s</a> " "(<a href='https://git-scm.com/'>git %s</a>)</footer>\n", cgit_version, git_version_string); } @@ -1652,11 +1654,10 @@ static void capture_http_clone_url(const char *url) } /* - * One row of the clone table. The url is shown as written, and every row is - * a link, but a browser cannot follow the ssh, scp or git forms, so those - * rows point at the first http url in the clone list, or at the repository's - * own page when the list has none, which with http clone enabled is itself a - * working clone url. A colspan of zero leaves the attribute out. + * One row of the clone table. Every row is a link, but a browser cannot + * follow the ssh, scp or git forms, so those rows point at the first http + * url in the clone list, or at the repository's own page when the list has + * none. A colspan of zero leaves the attribute out. */ void cgit_print_clone_row(const char *url, int colspan) { @@ -1858,7 +1859,8 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, snapshot_link("sig", NULL, NULL, NULL, NULL, filename.buf); html(")"); - } else if (starts_with(f->suffix, ".tar") && cgit_snapshot_get_sig(ref, &cgit_snapshot_formats[0])) { + } else if (starts_with(f->suffix, ".tar") && + cgit_snapshot_get_sig(ref, &cgit_snapshot_formats[0])) { // A compressed tarball offers the signature made for // the plain tar it expands to, which is the first // format in the table. |
