gitea/templates/repo/view_file.tmpl

37 lines
1.3 KiB
Cheetah
Raw Normal View History

2014-07-25 22:24:27 -06:00
<div class="panel panel-radius" id="repo-readme">
<p class="panel-header">
{{if .ReadmeExist}}
<i class="icon fa fa-book fa-lg"></i>
{{if .ReadmeInHome}}
<strong class="file-name">{{.FileName}}</strong>
{{else}}
<strong>{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
{{else}}
<i class="icon fa fa-file-text-o"></i>
<strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
</p>
<div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view">
{{if .ReadmeExist}}
{{.FileContent | Str2html}}
{{else if not .IsFileText}}
<div class="view-raw">
{{if .IsImageFile}}
<img src="{{.FileLink}}">
{{else}}
<a href="{{.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">View Raw</a>
{{end}}
</div>
2014-07-25 22:24:27 -06:00
{{else if .FileSize}}
<table>
<tbody>
<tr>
<td class="lines-num"></td>
<td class="lines-code"><pre class="prettyprint linenums {{if .FileExt}}lang-{{.FileExt}}{{end}}"><code>{{.FileContent}}</code></pre></td>
</tr>
</tbody>
</table>
{{end}}
</div>
</div>