diff options
-rw-r--r-- | cgit.css | 2 | ||||
-rw-r--r-- | ui-shared.c | 41 |
2 files changed, 25 insertions, 18 deletions
@@ -254,7 +254,7 @@ div#cgit div.error { | |||
254 | margin: 1em 2em; | 254 | margin: 1em 2em; |
255 | } | 255 | } |
256 | 256 | ||
257 | div#cgit a.ls-blob, div#cgit a.ls-dir, div#cgit a.ls-mod { | 257 | div#cgit a.ls-blob, div#cgit a.ls-dir, div#cgit .ls-mod { |
258 | font-family: monospace; | 258 | font-family: monospace; |
259 | } | 259 | } |
260 | 260 | ||
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; |