githaven-fork/templates/repo/single_file.tmpl
2014-03-25 00:09:58 +08:00

40 lines
1.6 KiB
Cheetah

<div class="panel panel-default file-content">
<div class="panel-heading file-head">
{{if .ReadmeExist}}
<i class="icon fa fa-book"></i>
{{.FileName}}
{{else}}
<i class="icon fa fa-file-text-o"></i>
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span>
<div class="btn-group pull-right">
<a class="btn btn-default hidden" href="#">Edit</a>
<a class="btn btn-default" href="{{.FileLink}}">Raw</a>
<a class="btn btn-default hidden" href="#">Blame</a>
<a class="btn btn-default hidden" href="#">History</a>
<a class="btn btn-danger hidden" href="#">Delete</a>
</div>
{{end}}
</div>
{{if not .FileIsText}}
<div class="panel-footer text-center">
<a href="{{.FileLink}}" class="btn btn-default btn-lg">View Raw</a>
</div>
{{else}}
{{if .ReadmeExist}}
<div class="panel-body file-body markdown">
{{.FileContent|str2html}}
</div>
{{else}}
<div class="panel-body file-body file-code code-view">
<table>
<tbody>
<tr>
<td class="lines-num"></td>
<td class="lines-code markdown"><pre class="prettyprint linenums{{if .FileExt}} lang-{{.FileExt}}{{end}}">{{.FileContent}}</pre></td>
</tr>
</tbody>
</table>
</div>
{{end}}
{{end}}
</div>