diff --git a/src/main/twirl/gitbucket/core/repo/files.scala.html b/src/main/twirl/gitbucket/core/repo/files.scala.html index 9a1c95b..e10c8b1 100644 --- a/src/main/twirl/gitbucket/core/repo/files.scala.html +++ b/src/main/twirl/gitbucket/core/repo/files.scala.html @@ -145,21 +145,35 @@ @if(file.isDirectory){ - @if(file.linkUrl.isDefined){ - - @file.name.split("/").toList.init match { - case Nil => {} - case list => {@list.mkString("", "/", "/")} - }@file.name.split("/").toList.last - - } else { - - @file.name.split("/").toList.init match { - case Nil => {} - case list => {@list.mkString("", "/", "/")} - }@file.name.split("/").toList.last - - } + @{file.linkUrl match { + case Some(linkUrl) if linkUrl.startsWith("http://") || linkUrl.startsWith("https://") => { + + {file.name.split("/").toList.init match { + case Nil => "" + case list => list.mkString("", "/", "/") + }} + {file.name.split("/").toList.last} + + } + case Some(_) => { + + {file.name.split("/").toList.init match { + case Nil => "" + case list => list.mkString("", "/", "/") + }} + {file.name.split("/").toList.last} + + } + case None => { + + {file.name.split("/").toList.init match { + case Nil => "" + case list => list.mkString("", "/", "/") + }} + {file.name.split("/").toList.last} + + } + }} } else { @file.name }