{! #include "../ui-blob.h" !} {! int ls_item(const struct object_id *oid, struct strbuf *base, const char *pathname, unsigned mode, void *cbdata) { tree_listing_item(oid, base, pathname, mode, true); /* from tree_common.html */ return 0; } !} {% block cgit_print_summary_impl %} {! page_start(); !} {! repo_header(); !}
{# Main content #} {! repo_description_panel(); !} {! repo_summary_bar(); !}
{# Latest commit panel (specify rounded-t-md so background does not cover border) #} {! char *hex = ctx.qry.oid; if (!hex) { hex = ctx.qry.head; } struct object_id oid; if (repo_get_oid(the_repository, hex, &oid)) { die("Bad object id"); } struct commit *commit = lookup_commit_reference(the_repository, &oid); if (!commit) { die("Bad commit reference"); } struct commitinfo *info = cgit_parse_commit(commit); !} {! cgit_free_commitinfo(info); !} {# Files #} {! const struct object_id *tree_oid = get_commit_tree_oid(commit); struct tree *tree = parse_tree_indirect(tree_oid); struct pathspec paths = { .nr = 0 }; read_tree(the_repository, tree, &paths, ls_item, NULL); !}
{% if ctx.repo->readme.nr > 0 %} {! char *filename = ctx.repo->readme.items[0].string; char *ref = ctx.repo->readme.items[0].util; !}
{# Readme panel #}
{# Heroicons micro book-open #} {{ filename }}
{# Readme content #}
{! cgit_open_filter(ctx.repo->about_filter, filename); if (ref) { cgit_print_file(filename, ref, 1); } else { html_include(filename); } cgit_close_filter(ctx.repo->about_filter); !}
{% endif %}
{! page_end(); !} {% endblock %} {% page cgit_print_summary %} {! cgit_print_summary_impl(); !} {% endpage %}