mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Show the correct name of the readme file (instead of showing always README.md).
This commit is contained in:
@@ -276,7 +276,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
val readme = files.find { file =>
|
||||
readmeFiles.contains(file.name.toLowerCase)
|
||||
}.map { file =>
|
||||
StringUtil.convertFromByteArray(JGitUtil.getContent(Git.open(getRepositoryDir(repository.owner, repository.name)), file.id, true).get)
|
||||
file -> StringUtil.convertFromByteArray(JGitUtil.getContent(Git.open(getRepositoryDir(repository.owner, repository.name)), file.id, true).get)
|
||||
}
|
||||
|
||||
repo.html.files(revision, repository,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
pathList: List[String],
|
||||
latestCommit: util.JGitUtil.CommitInfo,
|
||||
files: List[util.JGitUtil.FileInfo],
|
||||
readme: Option[String])(implicit context: app.Context)
|
||||
readme: Option[(util.JGitUtil.FileInfo, String)])(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||
@@ -77,9 +77,9 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@readme.map { content =>
|
||||
@readme.map { case(file, content) =>
|
||||
<div id="readme" class="box">
|
||||
<div class="box-header">README.md</div>
|
||||
<div class="box-header">@file.name</div>
|
||||
<div class="box-content markdown-body">@markdown(content, repository, false, false)</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user