(refs #865)Fix presentation of file finder and blow view

This commit is contained in:
Naoki Takezoe
2015-08-08 21:11:34 +09:00
parent bb10365b8b
commit 687a4f14e1
2 changed files with 43 additions and 50 deletions

View File

@@ -47,57 +47,50 @@
} }
} }
</div> </div>
<div class="box-header">
<table class="table table-bordered blobview"> @avatar(latestCommit, 20)
<tr> @user(latestCommit.authorName, latestCommit.authorEmailAddress, "username strong")
<th style="font-weight: normal;"> <span class="muted">@helper.html.datetimeago(latestCommit.commitTime)</span>
<div class="pull-left"> <a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
@avatar(latestCommit, 20) <div class="btn-group pull-right">
@user(latestCommit.authorName, latestCommit.authorEmailAddress, "username strong") @if(hasWritePermission && content.viewType == "text" && repository.branchList.contains(branch)){
<span class="muted">@helper.html.datetimeago(latestCommit.commitTime)</span> <a class="btn btn-mini" href="@url(repository)/edit/@encodeRefName(branch)/@pathList.mkString("/")">Edit</a>
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a> }
</div> <a class="btn btn-mini" href="?raw=true">Raw</a>
<div class="btn-group pull-right"> @if(content.viewType == "text"){
@if(hasWritePermission && content.viewType == "text" && repository.branchList.contains(branch)){ <a class="btn btn-mini blame-action" href="@url(repository)/blame/@latestCommit.id/@pathList.mkString("/")" data-url="@url(repository)/get-blame/@latestCommit.id/@pathList.mkString("/")" data-repository="@url(repository)">Blame</a>
<a class="btn btn-mini" href="@url(repository)/edit/@encodeRefName(branch)/@pathList.mkString("/")">Edit</a> }
} <a class="btn btn-mini" href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")">History</a>
<a class="btn btn-mini" href="?raw=true">Raw</a> @if(hasWritePermission){
@if(content.viewType == "text"){ <a class="btn btn-mini btn-danger" href="@url(repository)/remove/@encodeRefName(branch)/@pathList.mkString("/")">Delete</a>
<a class="btn btn-mini blame-action" href="@url(repository)/blame/@latestCommit.id/@pathList.mkString("/")" data-url="@url(repository)/get-blame/@latestCommit.id/@pathList.mkString("/")" data-repository="@url(repository)">Blame</a> }
} </div>
<a class="btn btn-mini" href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")">History</a> </div>
@if(hasWritePermission){ @if(content.viewType == "text"){
<a class="btn btn-mini btn-danger" href="@url(repository)/remove/@encodeRefName(branch)/@pathList.mkString("/")">Delete</a> @defining(isRenderable(pathList.reverse.head)){ isRrenderable =>
} @if(!isBlame && isRrenderable) {
</div> <div class="box-content-bottom markdown-body" style="border: none; padding-left: 16px; padding-right: 16px;">
</th> @renderMarkup(pathList, content.content.get, branch, repository, false, false, true)
</tr> </div>
<tr> } else {
<td> <div class="box-content-bottom">
@if(content.viewType == "text"){ <pre class="prettyprint linenums blob @if(!isRrenderable){ no-renderable } ">@content.content.get</pre>
@defining(isRenderable(pathList.reverse.head)){ isRrenderable =>
@if(!isBlame && isRrenderable) {
<div class="box-content markdown-body" style="border: none; padding-left: 16px; padding-right: 16px;">
@renderMarkup(pathList, content.content.get, branch, repository, false, false, true)
</div>
} else {
<pre class="prettyprint linenums blob @if(!isRrenderable){ no-renderable } ">@content.content.get</pre>
}
}
}
@if(content.viewType == "image"){
<img src="?raw=true"/>
}
@if(content.viewType == "large" || content.viewType == "binary"){
<div style="text-align: center; padding-top: 20px; padding-bottom: 20px;">
<a href="?raw=true">View Raw</a><br>
<br>
(Sorry about that, but we can't show files that are this big right now)
</div> </div>
} }
</td> }
</tr> }
</table> @if(content.viewType == "image"){
<div class="box-content-bottom">
<img src="?raw=true"/>
</div>
}
@if(content.viewType == "large" || content.viewType == "binary"){
<div class="box-content-bottom" style="text-align: center; padding-top: 20px; padding-bottom: 20px;">
<a href="?raw=true">View Raw</a><br>
<br>
(Sorry about that, but we can't show files that are this big right now)
</div>
}
} }
} }
<script src="@assets/vendors/jquery/jquery.ba-hashchange.js"></script> <script src="@assets/vendors/jquery/jquery.ba-hashchange.js"></script>

View File

@@ -28,7 +28,7 @@
<tbody class="tree-browser-result-template"> <tbody class="tree-browser-result-template">
<tr class="tree-browser-result"> <tr class="tree-browser-result">
<td class="icon"><span class="icon icon-chevron-right"></span></td> <td class="icon"><span class="icon icon-chevron-right"></span></td>
<td class="icon"><img src="@assets/common/images/file.png"/></td> <td class="icon"><i class="octicon octicon-file-text"></i></td>
<td> <td>
<a href="@url(repository)/blob/@encodeRefName(branch)"></a> <a href="@url(repository)/blob/@encodeRefName(branch)"></a>
</td> </td>