mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
55 lines
1.9 KiB
HTML
55 lines
1.9 KiB
HTML
@(branch: String,
|
|
repository: service.RepositoryService.RepositoryInfo,
|
|
pathList: List[String],
|
|
content: util.JGitUtil.ContentInfo,
|
|
latestCommit: util.JGitUtil.CommitInfo)(implicit context: app.Context)
|
|
@import context._
|
|
@import view.helpers._
|
|
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
|
@html.header("code", repository)
|
|
@tab(branch, repository, "files")
|
|
<div class="head">
|
|
<a href="@url(repository)/tree/@branch">@repository.name</a> /
|
|
@pathList.zipWithIndex.map { case (section, i) =>
|
|
@if(i == pathList.length - 1){
|
|
@section
|
|
} else {
|
|
<a href="@url(repository)/tree/@branch/@pathList.take(i + 1).mkString("/")">@section</a> /
|
|
}
|
|
}
|
|
</div>
|
|
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<th style="font-weight: normal;">
|
|
<div class="pull-left">
|
|
@avatar(latestCommit, 20)
|
|
<a href="@url(latestCommit.committer)" class="username strong">@latestCommit.committer</a>
|
|
<span class="muted">@datetime(latestCommit.time)</span>
|
|
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
|
|
</div>
|
|
<div class="btn-group pull-right">
|
|
<a class="btn btn-mini" href="?raw=true">Raw</a>
|
|
<a class="btn btn-mini" href="@url(repository)/commits/@branch/@pathList.mkString("/")">History</a>
|
|
</div>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
@if(content.viewType == "text"){
|
|
<pre class="prettyprint linenums blob">@content.content.get</pre>
|
|
}
|
|
@if(content.viewType == "image"){
|
|
<img src="?raw=true"/>
|
|
}
|
|
@if(content.viewType == "large" || content.viewType == "binary"){
|
|
<div style="text-align: center">
|
|
<a href="?raw=true">View Raw</a><br>
|
|
(Sorry about that, but we can't show files that are this big right now)
|
|
</div>
|
|
}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
}
|