2015-11-14 17:34:01 +08:00
|
|
|
<div id="file-content">
|
2015-12-08 06:30:52 +08:00
|
|
|
<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">
|
2015-12-09 13:32:53 +08:00
|
|
|
{{if not .IsViewCommit}}
|
2015-12-08 06:30:52 +08:00
|
|
|
<a class="ui button" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_permalink"}}</a>
|
|
|
|
{{end}}
|
|
|
|
<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">
|
2016-03-03 08:18:58 +08:00
|
|
|
<div class="file-view {{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}} has-emoji">
|
2015-12-08 06:30:52 +08:00
|
|
|
{{if .ReadmeExist}}
|
|
|
|
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
|
|
|
|
{{else if not .IsFileText}}
|
2015-12-25 18:45:07 +08:00
|
|
|
<div class="view-raw ui center">
|
2015-12-08 06:30:52 +08:00
|
|
|
{{if .IsImageFile}}
|
|
|
|
<img src="{{EscapePound .FileLink}}">
|
2016-04-27 09:48:44 +08:00
|
|
|
{{else if .IsPDFFile}}
|
|
|
|
<iframe width="100%" height="600px" src="{{AppSubUrl}}/plugins/pdfjs-1.4.20/web/viewer.html?file={{EscapePound .FileLink}}"></iframe>
|
2015-12-08 06:30:52 +08:00
|
|
|
{{else}}
|
|
|
|
<a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{else if .FileSize}}
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2016-07-12 06:21:26 +08:00
|
|
|
{{if .IsFileTooLarge}}
|
|
|
|
<td><strong>{{.i18n.Tr "repo.file_too_large"}}</strong></td>
|
|
|
|
{{else}}
|
2015-12-08 06:30:52 +08:00
|
|
|
<td class="lines-num"></td>
|
2015-12-17 11:13:12 +08:00
|
|
|
<td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
|
2016-07-12 06:21:26 +08:00
|
|
|
{{end}}
|
2015-12-08 06:30:52 +08:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|