From db021a1989a52911557ce6b998c11fbe4a4bea9d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 5 Mar 2015 20:41:45 +0100 Subject: Remove no-op link from submodule entries Instead of linking to the current page ("href='#'"), do not add a link to a submodule entry at all if the module-link setting is not used. Signed-off-by: Lukas Fleischer --- ui-shared.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'ui-shared.c') 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) item = lookup_path(list, path); } } - html("module_link, dir, rev); + if (item || ctx.repo->module_link) { + html("module_link, dir, rev); + } + html("'>"); + html_txt(path); + html(""); } else { - html("#"); + html(""); + html_txt(path); + html(""); } - html("'>"); - html_txt(path); - html(""); html_txtf(" @ %.7s", rev); if (item && tail) path[len - 1] = tail; -- cgit v1.2.3-59-g8ed1b