the repository which powers this website
Diffstat (limited to 'themed/base.html')
| -rw-r--r-- | themed/base.html | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/themed/base.html b/themed/base.html index e3b6bcd3..4b8a79dc 100644 --- a/themed/base.html +++ b/themed/base.html @@ -1,4 +1,4 @@ -{! static int get_num_commits(); static int get_num_branches(); static int get_num_tags(); !} +{! static int get_num_commits(); static int get_num_branches(); static int get_num_tags(); static void short_commit_id(char *hex); !} {% block page_start %} <!DOCTYPE html> @@ -30,7 +30,13 @@ <a href="{! cgit_shared_repolink_url("refs", ctx.qry.head, NULL); !}" class="flex gap-x-1.5 py-1.5 px-3 bg-gray-50 border border-gray-300 rounded-md hover:bg-gray-100"> {# Heroicons micro list-bullet #} <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 self-center text-gray-500"><path d="M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" /></svg> - <span class="font-semibold self-baseline">{{ ctx.qry.head }}</span> + <span class="font-semibold self-baseline"> + {% if strcmp(ctx.qry.page, "tree") == 0 && ctx.qry.oid %} + {! short_commit_id(ctx.qry.oid); !} + {% else %} + {{ ctx.qry.head }} + {% endif %} + </span> {# Heroicons micro chevron-down #} <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 self-center text-gray-500"><path fill-rule="evenodd" d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg> </a> @@ -184,6 +190,13 @@ cgit_free_reflist_inner(&list); return num_tags; } + + static void short_commit_id(char *hex) { + char short_commit_id[8]; + memcpy(short_commit_id, hex, 7); + short_commit_id[7] = '\0'; + html_txt(short_commit_id); + } !} {! |