2015-11-14 12:34:01 +03:00
<div id="file-content">
<h4 class="ui top attached header" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
{{if .ReadmeExist}}
<i class="book icon ui left"></i>
{{if .ReadmeInList}}
<strong>{{.FileName}}</strong>
{{else}}
<strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}</span>
{{end}}
{{else}}
<i class="file text outline icon ui left"></i>
<strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}</span>
{{end}}
{{if not .ReadmeInList}}
<div class="ui right">
<div class="ui small grey basic buttons">
{{if not .IsCommit}}
<a class="ui button" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_permalink"}}</a>
2014-10-12 02:02:48 +04:00
{{end}}
2015-11-14 12:34:01 +03:00
<a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_history"}}</a>
<a class="ui button" href="{{EscapePound .FileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
</div>
</div>
{{end}}
</h4>
<div class="ui attached table segment">
2015-11-15 22:50:35 +03:00
<div class="file-view {{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}}">
2015-11-14 12:34:01 +03:00
{{if .ReadmeExist}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
2014-07-27 02:37:18 +04:00
{{else if not .IsFileText}}
<div class="view-raw">
2015-11-14 12:34:01 +03:00
{{if .IsImageFile}}
<img src="{{EscapePound .FileLink}}">
{{else}}
<a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
{{end}}
2014-07-27 02:37:18 +04:00
</div>
2015-11-14 12:34:01 +03:00
{{else if .FileSize}}
2014-07-26 08:24:27 +04:00
<table>
2015-11-14 12:34:01 +03:00
<tbody>
<tr>
<td class="lines-num"></td>
<td class="lines-code"><pre class="{{if .FileExt}}lang-{{.FileExt}}{{end}}"><code><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
</tr>
</tbody>
2014-07-26 08:24:27 +04:00
</table>
2015-11-14 12:34:01 +03:00
{{end}}
2014-07-26 08:24:27 +04:00
</div>
2015-11-14 12:34:01 +03:00
</div>
</div>