mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Move HTML templates for the repository viewer to repo.html package.
This commit is contained in:
71
src/main/twirl/repo/blob.scala.html
Normal file
71
src/main/twirl/repo/blob.scala.html
Normal file
@@ -0,0 +1,71 @@
|
||||
@(branch: String, repository: app.RepositoryInfo, pathList: List[String], content: app.ContentInfo, latestCommit: app.CommitInfo)(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 (path, i) =>
|
||||
@if(i == pathList.length - 1){
|
||||
@path
|
||||
} else {
|
||||
<a href="@path/@repository.owner/@repository.name/tree/@branch/@pathList.take(i + 1).mkString("/")">@path</a> /
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th style="font-weight: normal;">
|
||||
<div class="pull-left">
|
||||
<a href="@path/@latestCommit.committer">@latestCommit.committer</a>
|
||||
<span class="description">@helpers.datetime(latestCommit.time)</span>
|
||||
@helpers.cut(latestCommit.message, 100)<br>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn btn-mini" href="?raw=true">Raw</a>
|
||||
<a class="btn btn-mini" href="@path/@repository.owner/@repository.name/commits/@branch/@pathList.mkString("/")">History</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@if(content.viewType == "text"){
|
||||
<pre class="prettyprint linenums">@content.content.get</pre>
|
||||
}
|
||||
@if(content.viewType == "image"){
|
||||
<img src="?raw=true"/>
|
||||
}
|
||||
@if(content.viewType == "large"){
|
||||
<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>
|
||||
|
||||
<link href="@path/assets/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"/>
|
||||
<script src="@path/assets/google-code-prettify/prettify.js"></script>
|
||||
<style type="text/css">
|
||||
li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9 {
|
||||
list-style-type: decimal;
|
||||
background: white;
|
||||
}
|
||||
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
pre.prettyprint {
|
||||
border: none;
|
||||
background-color: white;
|
||||
padding-left: 20px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){ prettyPrint(); });
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user