the repository which powers this website
Use themed display for repo age on index page
RunasSudo 9 months ago
parent cca0167 · commit dfce675
-rw-r--r--themed/index.html2
-rw-r--r--ui-repolist.c12
-rw-r--r--ui-repolist.h2
3 files changed, 12 insertions, 4 deletions
diff --git a/themed/index.html b/themed/index.html
index aa50f0ac..712307e2 100644
--- a/themed/index.html
+++ b/themed/index.html
@@ -34,7 +34,7 @@
<div><a href="{{ repourl|attr }}" class="font-semibold text-blue-500 hover:text-blue-600 hover:underline">{{ ctx.repo->name }}</a></div>
{! free(repourl); !}
<div class="text-sm text-gray-500">{{ ctx.repo->desc }}</div>
- <div class="text-sm text-gray-500">Updated {! cgit_repolist_print_modtime(ctx.repo); !} ago</div>
+ <div class="text-sm text-gray-500">Updated {! cgit_repolist_print_modtime_themed(ctx.repo); !}</div>
</div>
{% endfor %}
</div>
diff --git a/ui-repolist.c b/ui-repolist.c
index 01f1fb51..18020860 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -82,9 +82,12 @@ static void print_modtime(struct cgit_repo *repo)
cgit_print_age(t, 0, -1);
}
-void cgit_repolist_print_modtime(struct cgit_repo *repo)
+void cgit_repolist_print_modtime_themed(struct cgit_repo *repo)
{
- print_modtime(repo);
+ time_t t;
+ if (get_repo_modtime(repo, &t)) {
+ cgit_print_age_themed(t, 0, TM_MONTH * 12);
+ }
}
static int is_match(struct cgit_repo *repo)
@@ -274,6 +277,11 @@ static int sort_repolist(char *field)
return 0;
}
+int cgit_repolist_sort_repolist(char *field)
+{
+ return sort_repolist(field);
+}
+
void _orig_cgit_print_repolist(void)
{
diff --git a/ui-repolist.h b/ui-repolist.h
index fd266dfc..47e434a4 100644
--- a/ui-repolist.h
+++ b/ui-repolist.h
@@ -2,7 +2,7 @@
#define UI_REPOLIST_H
extern int cgit_repolist_is_visible(struct cgit_repo *repo);
-extern void cgit_repolist_print_modtime(struct cgit_repo *repo);
+extern void cgit_repolist_print_modtime_themed(struct cgit_repo *repo);
extern int cgit_repolist_sort_repolist(char *field);
extern void cgit_print_repolist(void);