@(branch: String, repository: service.RepositoryService.RepositoryInfo, pathList: List[String], latestCommit: util.JGitUtil.CommitInfo, files: List[util.JGitUtil.FileInfo], readme: Option[String])(implicit context: app.Context) @import context._ @import view.helpers @html.main(repository.owner + "/" + repository.name) { @html.header("code", repository) @navtab(branch, repository, "files") <div class="head"> <a href="@path/@repository.owner/@repository.name/tree/@branch">@repository.name</a> / @pathList.zipWithIndex.map { case (section, i) => <a href="@path/@repository.owner/@repository.name/tree/@branch/@pathList.take(i + 1).mkString("/")">@section</a> / } </div> <div class="box"> <table class="table table-file-list" style="border: 1px solid silver;"> <tr> <th colspan="4" style="font-weight: normal;"> <a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id" class="commit-message">@latestCommit.shortMessage</a> @if(latestCommit.description.isDefined){ <a href="javascript:void(0)" onclick="$('#description-@latestCommit.id').toggle();">...</a> } @if(latestCommit.description.isDefined){ <pre id="description-@latestCommit.id" class="commit-description" style="display: none;">@latestCommit.description.get</pre> } </th> </tr> <tr> <td colspan="4" class="latest-commmit"> <div> <a href="@path/@repository.owner/@repository.name/@latestCommit.committer" class="username">@latestCommit.committer</a> @helpers.datetime(latestCommit.time) <div class="pull-right align-right monospace"> <a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id" class="commit-id"><span class="description">latest commit</span> @latestCommit.id.substring(0, 10)</a> </div> </div> </td> </tr> @if(pathList.size > 0){ <tr> <td width="16"></td> <td><a href="@path/@repository.owner/@repository.name@if(pathList.size > 1){/tree/@branch/@pathList.init.mkString("/")}">..</a></td> <td></td> <td></td> </tr> } @files.map { file => <tr> <td width="16"> @if(file.isDirectory){ <img src="@path/assets/common/images/folder.png"/> } else { <img src="@path/assets/common/images/file.png"/> } </td> <td> @if(file.isDirectory){ <a href="@path/@repository.owner/@repository.name/tree@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a> } else { <a href="@path/@repository.owner/@repository.name/blob@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a> } </td> <td>@helpers.datetime(file.time)</td> <td><a href="@path/@repository.owner/@repository.name/commit/@file.commitId" class="commit-message">@file.message</a> [<a href="@path/@file.committer">@file.committer</a>]</td> </tr> } </table> </div> @readme.map { content => <div class="box"> <div class="box-header">README.md</div> <div class="box-content">@helpers.markdown(content, repository, false, false, false)</div> </div> } }