diff options
| author | John Keeping | 2015-08-14 12:47:12 +0100 |
|---|---|---|
| committer | Jason A. Donenfeld | 2015-08-14 15:46:51 +0200 |
| commit | 51d9176e4bb5c619481355c6b895c6dec30c4f82 (patch) | |
| tree | f4a8ca97af15496a2090627c38affc6b86b9be73 | |
| parent | 764987980ec0e806205b8e075feafd4e010dcbd9 (diff) | |
| download | cgit-51d9176e4bb5c619481355c6b895c6dec30c4f82.tar.gz cgit-51d9176e4bb5c619481355c6b895c6dec30c4f82.tar.bz2 cgit-51d9176e4bb5c619481355c6b895c6dec30c4f82.zip | |
about: move layout into page functions
Signed-off-by: John Keeping <john@keeping.me.uk>
| -rw-r--r-- | cmd.c | 2 | ||||
| -rw-r--r-- | ui-repolist.c | 5 | ||||
| -rw-r--r-- | ui-summary.c | 8 |
3 files changed, 11 insertions, 4 deletions
| @@ -155,7 +155,7 @@ struct cgit_cmd *cgit_get_cmd(void) | |||
| 155 | static struct cgit_cmd cmds[] = { | 155 | static struct cgit_cmd cmds[] = { |
| 156 | def_cmd(HEAD, 1, 0, 0, 1), | 156 | def_cmd(HEAD, 1, 0, 0, 1), |
| 157 | def_cmd(atom, 1, 0, 0, 0), | 157 | def_cmd(atom, 1, 0, 0, 0), |
| 158 | def_cmp(about, 0, 1, 0, 0), | 158 | def_cmp(about, 0, 0, 0, 0), |
| 159 | def_cmd(blob, 1, 0, 0, 0), | 159 | def_cmd(blob, 1, 0, 0, 0), |
| 160 | def_cmd(commit, 1, 1, 1, 0), | 160 | def_cmd(commit, 1, 1, 1, 0), |
| 161 | def_cmd(diff, 1, 1, 1, 0), | 161 | def_cmd(diff, 1, 1, 1, 0), |
diff --git a/ui-repolist.c b/ui-repolist.c index 43253ed..ac1b3e3 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
| @@ -345,9 +345,12 @@ void cgit_print_repolist(void) | |||
| 345 | 345 | ||
| 346 | void cgit_print_site_readme(void) | 346 | void cgit_print_site_readme(void) |
| 347 | { | 347 | { |
| 348 | cgit_print_layout_start(); | ||
| 348 | if (!ctx.cfg.root_readme) | 349 | if (!ctx.cfg.root_readme) |
| 349 | return; | 350 | goto done; |
| 350 | cgit_open_filter(ctx.cfg.about_filter, ctx.cfg.root_readme); | 351 | cgit_open_filter(ctx.cfg.about_filter, ctx.cfg.root_readme); |
| 351 | html_include(ctx.cfg.root_readme); | 352 | html_include(ctx.cfg.root_readme); |
| 352 | cgit_close_filter(ctx.cfg.about_filter); | 353 | cgit_close_filter(ctx.cfg.about_filter); |
| 354 | done: | ||
| 355 | cgit_print_layout_end(); | ||
| 353 | } | 356 | } |
diff --git a/ui-summary.c b/ui-summary.c index a5c7078..cd1fef5 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
| @@ -101,8 +101,9 @@ void cgit_print_repo_readme(char *path) | |||
| 101 | char *filename, *ref; | 101 | char *filename, *ref; |
| 102 | int free_filename = 0; | 102 | int free_filename = 0; |
| 103 | 103 | ||
| 104 | cgit_print_layout_start(); | ||
| 104 | if (ctx.repo->readme.nr == 0) | 105 | if (ctx.repo->readme.nr == 0) |
| 105 | return; | 106 | goto done; |
| 106 | 107 | ||
| 107 | filename = ctx.repo->readme.items[0].string; | 108 | filename = ctx.repo->readme.items[0].string; |
| 108 | ref = ctx.repo->readme.items[0].util; | 109 | ref = ctx.repo->readme.items[0].util; |
| @@ -111,7 +112,7 @@ void cgit_print_repo_readme(char *path) | |||
| 111 | free_filename = 1; | 112 | free_filename = 1; |
| 112 | filename = append_readme_path(filename, ref, path); | 113 | filename = append_readme_path(filename, ref, path); |
| 113 | if (!filename) | 114 | if (!filename) |
| 114 | return; | 115 | goto done; |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | /* Print the calculated readme, either from the git repo or from the | 118 | /* Print the calculated readme, either from the git repo or from the |
| @@ -128,4 +129,7 @@ void cgit_print_repo_readme(char *path) | |||
| 128 | html("</div>"); | 129 | html("</div>"); |
| 129 | if (free_filename) | 130 | if (free_filename) |
| 130 | free(filename); | 131 | free(filename); |
| 132 | |||
| 133 | done: | ||
| 134 | cgit_print_layout_end(); | ||
| 131 | } | 135 | } |
