Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Open and close each page through the layout calls
Diffstat (limited to 'source/ui-shared.c')
| -rw-r--r-- | source/ui-shared.c | 67 |
1 file changed, 31 insertions, 36 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index 7c198ea..1d09c26 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1375,7 +1375,7 @@ void cgit_redirect(const char *url, const char *query, bool permanent) html("\n\n"); } -void cgit_print_docstart(void) +static void print_docstart(void) { const struct object_id *pinned; struct string_list_item *item; @@ -1462,28 +1462,6 @@ void cgit_print_docstart(void) html_include(ctx.cfg.header); } -void cgit_print_docend(void) -{ - html("</main>\n"); - if (ctx.cfg.embedded) { - html("</div>\n"); - if (ctx.cfg.footer) - html_include(ctx.cfg.footer); - return; - } - if (ctx.cfg.footer) - html_include(ctx.cfg.footer); - else if (ctx.cfg.enable_version_info) - 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); - else - html("<footer class='footer'>generated by <a href='https://github.com/brycekwon/cgit'>cgit</a></footer>\n"); - html("</div>\n"); - html("</body>\n</html>\n"); -} - void cgit_print_error_page(int code, const char *msg, const char *fmt, ...) { va_list ap; @@ -1521,18 +1499,6 @@ void cgit_print_blob_too_large(size_t size) size / 1024, ctx.cfg.max_blob_size); } -void cgit_print_layout_start(void) -{ - cgit_print_http_headers(); - cgit_print_docstart(); - cgit_print_pageheader(); -} - -void cgit_print_layout_end(void) -{ - cgit_print_docend(); -} - static void add_clone_urls(void (*fn)(const char *), char *urls, char *suffix) { struct strbuf **url_list = strbuf_split_str(urls, ' ', 0); @@ -1624,7 +1590,7 @@ void cgit_add_hidden_formfields(int incl_head, int incl_search, const char *page } } -void cgit_print_pageheader(void) +static void print_pageheader(void) { const struct object_id *pinned; @@ -1711,6 +1677,35 @@ void cgit_print_pageheader(void) html("<main class='content'>\n"); } +void cgit_print_layout_start(void) +{ + cgit_print_http_headers(); + print_docstart(); + print_pageheader(); +} + +void cgit_print_layout_end(void) +{ + html("</main>\n"); + if (ctx.cfg.embedded) { + html("</div>\n"); + if (ctx.cfg.footer) + html_include(ctx.cfg.footer); + return; + } + if (ctx.cfg.footer) + html_include(ctx.cfg.footer); + else if (ctx.cfg.enable_version_info) + 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); + else + html("<footer class='footer'>generated by <a href='https://github.com/brycekwon/cgit'>cgit</a></footer>\n"); + html("</div>\n"); + html("</body>\n</html>\n"); +} + static void print_fileperm(unsigned short mode) { htmlf("%c%c%c", (mode & 4 ? 'r' : '-'), (mode & 2 ? 'w' : '-'), (mode & 1 ? 'x' : '-')); |
