diff --git a/themed/base.html b/themed/base.html index 4b8a79d..ecf7996 100644 --- a/themed/base.html +++ b/themed/base.html @@ -31,7 +31,7 @@ {# Heroicons micro list-bullet #} - {% if strcmp(ctx.qry.page, "tree") == 0 && ctx.qry.oid %} + {% if (strcmp(ctx.qry.page, "tree") == 0 || strcmp(ctx.qry.page, "summary") == 0) && ctx.qry.oid %} {! short_commit_id(ctx.qry.oid); !} {% else %} {{ ctx.qry.head }} diff --git a/themed/summary.html b/themed/summary.html index 14b0727..4a3ca3f 100644 --- a/themed/summary.html +++ b/themed/summary.html @@ -31,7 +31,7 @@ } !} -{% page cgit_print_summary %} +{% block cgit_print_summary_impl %} {! page_start(); !} {! repo_header(); !}
{# Main content #} @@ -40,9 +40,11 @@
{# Latest commit panel (specify rounded-t-md so background does not cover border) #} {! - // Get latest commit + char *hex = ctx.qry.oid; + if (!hex) { hex = ctx.qry.head; } + struct object_id oid; - if (repo_get_oid(the_repository, ctx.qry.head, &oid)) { + if (repo_get_oid(the_repository, hex, &oid)) { die("Bad object id"); } struct commit *commit = lookup_commit_reference(the_repository, &oid); @@ -56,13 +58,13 @@ {{ info->author }} object.oid), ctx.qry.vpath); !}" class="ml-2 text-gray-500 hover:text-blue-600 hover:underline">{{ info->subject }}
- + object.oid), ctx.qry.vpath); !}" class="font-mono hover:text-blue-600 hover:underline"> {! short_commit_id(oid_to_hex(&commit->object.oid)); !} - -· -{! cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2); !} ago - + + · + {! cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2); !} ago +
{# Files #} {! @@ -102,4 +104,8 @@ {% endif %}
{! page_end(); !} +{% endblock %} + +{% page cgit_print_summary %} +{! cgit_print_summary_impl(); !} {% endpage %} diff --git a/themed/tree.html b/themed/tree.html index 5ad6a11..f1a6a83 100644 --- a/themed/tree.html +++ b/themed/tree.html @@ -151,7 +151,7 @@ {% page cgit_print_tree %} {! // Redirect to summary page if no subdirectory - if (!ctx.qry.path) { return cgit_print_summary(); } + if (!ctx.qry.path) { return cgit_print_summary_impl(); } !} {! page_start(); !} {! repo_header(); !}