Sort repos by age on index page

This commit is contained in:
RunasSudo 2025-05-16 20:10:57 +10:00
parent 2460441ce7
commit cca01672a2
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,4 @@
{! int cgit_repolist_is_visible(struct cgit_repo *repo); !}
{! void cgit_repolist_print_modtime(struct cgit_repo *repo); !}
{! void cgit_shared_site_url(const char *page, const char *search, const char *sort, int ofs, int always_root); !}
{! #include "../ui-repolist.h" !}
{% page cgit_print_repolist %}
{! ctx.page.title = ctx.cfg.root_title; !}
@ -23,6 +21,7 @@
</form>
<div class="grid grid-cols-[auto_1fr]">
{# Repo list #}
{! cgit_repolist_sort_repolist("idle"); !}
{% for int i = 0; i < cgit_repolist.count; i++ %}
{! ctx.repo = &cgit_repolist.repos[i]; !}
{! if (!cgit_repolist_is_visible(ctx.repo)) { continue; } !}

View File

@ -3,6 +3,7 @@
extern int cgit_repolist_is_visible(struct cgit_repo *repo);
extern void cgit_repolist_print_modtime(struct cgit_repo *repo);
extern int cgit_repolist_sort_repolist(char *field);
extern void cgit_print_repolist(void);
extern void cgit_print_site_readme(void);