2014-09-27 11:08:57 +02:00
|
|
|
<div class="panel panel-radius" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
|
2014-07-26 06:24:27 +02:00
|
|
|
<p class="panel-header">
|
|
|
|
{{if .ReadmeExist}}
|
|
|
|
<i class="icon fa fa-book fa-lg"></i>
|
2014-10-12 00:02:48 +02:00
|
|
|
{{if .ReadmeInList}}
|
2014-07-26 06:24:27 +02:00
|
|
|
<strong class="file-name">{{.FileName}}</strong>
|
|
|
|
{{else}}
|
|
|
|
<strong>{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
|
|
|
|
{{end}}
|
|
|
|
{{else}}
|
2014-10-12 00:02:48 +02:00
|
|
|
<i class="icon fa fa-file-text-o"></i>
|
|
|
|
<strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
|
2014-07-26 06:24:27 +02:00
|
|
|
{{end}}
|
2014-10-12 00:02:48 +02:00
|
|
|
{{if not .ReadmeInList}}
|
2015-05-14 00:14:24 +02:00
|
|
|
{{if not .IsCommit}}
|
2015-07-28 18:51:40 +02:00
|
|
|
<a class="right" href="{{.RepoLink}}/src/{{.CommitId}}/{{EscapePound .TreeName}}">
|
2015-05-14 00:14:24 +02:00
|
|
|
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_permalink"}}</button>
|
|
|
|
</a>
|
|
|
|
{{end}}
|
2015-07-28 18:51:40 +02:00
|
|
|
<a class="right" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreeName}}">
|
2014-10-12 00:02:48 +02:00
|
|
|
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_history"}}</button>
|
|
|
|
</a>
|
2014-11-07 22:44:25 +01:00
|
|
|
<a class="right" href="{{EscapePound .FileLink}}">
|
2014-10-12 00:02:48 +02:00
|
|
|
<button class="btn btn-medium btn-gray btn-left-radius btn-comb">{{.i18n.Tr "repo.file_raw"}}</button>
|
|
|
|
</a>
|
|
|
|
{{end}}
|
2014-07-26 06:24:27 +02:00
|
|
|
</p>
|
2014-09-27 11:08:57 +02:00
|
|
|
<div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view" id="repo-code-view">
|
2014-07-26 06:24:27 +02:00
|
|
|
{{if .ReadmeExist}}
|
2014-09-13 00:29:58 +02:00
|
|
|
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
|
2014-07-27 00:37:18 +02:00
|
|
|
{{else if not .IsFileText}}
|
|
|
|
<div class="view-raw">
|
|
|
|
{{if .IsImageFile}}
|
2014-11-07 22:44:25 +01:00
|
|
|
<img src="{{EscapePound .FileLink}}">
|
2014-07-27 00:37:18 +02:00
|
|
|
{{else}}
|
2014-11-07 22:44:25 +01:00
|
|
|
<a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
|
2014-07-27 00:37:18 +02:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2014-07-26 06:24:27 +02: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>
|
2015-07-28 18:51:40 +02:00
|
|
|
</div>
|