1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-23 08:47:42 -05:00
forgejo/templates/repo/view_file.tmpl

45 lines
1.9 KiB
Cheetah
Raw Normal View History

2014-09-27 05:08:57 -04:00
<div class="panel panel-radius" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
2014-07-26 00:24:27 -04:00
<p class="panel-header">
{{if .ReadmeExist}}
<i class="icon fa fa-book fa-lg"></i>
{{if .ReadmeInList}}
2014-07-26 00:24:27 -04:00
<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>
2014-07-26 00:24:27 -04:00
{{end}}
{{if not .ReadmeInList}}
<a class="right" href="{{.RepoLink}}/commits/{{.BranchName}}/{{.TreeName}}">
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_history"}}</button>
</a>
<a class="right" href="{{.FileLink}}">
<button class="btn btn-medium btn-gray btn-left-radius btn-comb">{{.i18n.Tr "repo.file_raw"}}</button>
</a>
{{end}}
2014-07-26 00:24:27 -04:00
</p>
2014-09-27 05:08:57 -04:00
<div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view" id="repo-code-view">
2014-07-26 00:24:27 -04:00
{{if .ReadmeExist}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
{{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">{{.i18n.Tr "repo.file_view_raw"}}</a>
{{end}}
</div>
2014-07-26 00:24:27 -04: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>