aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 23a893b..1dd8722 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -559,25 +559,32 @@ void cgit_submodule_link(const char *class, char *path, const char *rev)
559 item = lookup_path(list, path); 559 item = lookup_path(list, path);
560 } 560 }
561 } 561 }
562 html("<a "); 562 if (item || ctx.repo->module_link) {
563 if (class) 563 html("<a ");
564 htmlf("class='%s' ", class); 564 if (class)
565 html("href='"); 565 htmlf("class='%s' ", class);
566 if (item) { 566 html("href='");
567 html_attrf(item->util, rev); 567 if (item) {
568 } else if (ctx.repo->module_link) { 568 html_attrf(item->util, rev);
569 dir = strrchr(path, '/'); 569 } else {
570 if (dir) 570 dir = strrchr(path, '/');
571 dir++; 571 if (dir)
572 else 572 dir++;
573 dir = path; 573 else
574 html_attrf(ctx.repo->module_link, dir, rev); 574 dir = path;
575 html_attrf(ctx.repo->module_link, dir, rev);
576 }
577 html("'>");
578 html_txt(path);
579 html("</a>");
575 } else { 580 } else {
576 html("#"); 581 html("<span");
582 if (class)
583 htmlf(" class='%s'", class);
584 html(">");
585 html_txt(path);
586 html("</span>");
577 } 587 }
578 html("'>");
579 html_txt(path);
580 html("</a>");
581 html_txtf(" @ %.7s", rev); 588 html_txtf(" @ %.7s", rev);
582 if (item && tail) 589 if (item && tail)
583 path[len - 1] = tail; 590 path[len - 1] = tail;