2017-10-27 11:40:54 +05:30
|
|
|
<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
|
2015-12-08 04:00:52 +05:30
|
|
|
<h4 class="ui top attached header" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
|
2017-12-31 06:17:52 +05:30
|
|
|
<div class="ui stackable grid">
|
|
|
|
<div class="ten wide column">
|
|
|
|
{{if .ReadmeExist}}
|
|
|
|
<i class="book icon ui left"></i>
|
|
|
|
{{if .ReadmeInList}}
|
|
|
|
<strong>{{.FileName}}</strong>
|
2016-08-28 17:26:41 +05:30
|
|
|
{{else}}
|
2017-12-31 06:17:52 +05:30
|
|
|
<strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
|
2016-08-28 17:26:41 +05:30
|
|
|
{{end}}
|
2017-12-31 06:17:52 +05:30
|
|
|
{{else}}
|
|
|
|
<i class="file text outline icon ui left"></i>
|
|
|
|
<strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div class="six wide right aligned column">
|
|
|
|
{{if not .ReadmeInList}}
|
|
|
|
<div class="ui right file-actions">
|
|
|
|
<div class="ui buttons">
|
|
|
|
{{if not .IsViewCommit}}
|
|
|
|
<a class="ui button" href="{{.RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_permalink"}}</a>
|
|
|
|
{{end}}
|
|
|
|
<a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a>
|
|
|
|
<a class="ui button" href="{{EscapePound $.RawFileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
|
|
|
|
</div>
|
|
|
|
{{if .Repository.CanEnableEditor}}
|
|
|
|
{{if .CanEditFile}}
|
|
|
|
<a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-pencil btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
|
|
|
{{else}}
|
|
|
|
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
|
|
|
{{end}}
|
|
|
|
{{if .CanDeleteFile}}
|
|
|
|
<a href="{{.RepoLink}}/_delete/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-trashcan btn-octicon btn-octicon-danger poping up" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
|
|
|
{{else}}
|
|
|
|
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2016-08-11 18:18:08 +05:30
|
|
|
{{end}}
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2017-12-31 06:17:52 +05:30
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
</h4>
|
2017-12-31 06:17:52 +05:30
|
|
|
<div class="ui attached table unstackable segment">
|
2017-10-17 04:47:22 +05:30
|
|
|
<div class="file-view {{if .IsMarkup}}markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji">
|
|
|
|
{{if .IsMarkup}}
|
2017-12-01 01:08:33 +05:30
|
|
|
{{if .FileContent}}{{.FileContent | Safe}}{{end}}
|
2017-10-17 04:47:22 +05:30
|
|
|
{{else if .IsRenderedHTML}}
|
|
|
|
<pre>{{if .FileContent}}{{.FileContent | Str2html}}{{end}}</pre>
|
2016-08-30 14:38:38 +05:30
|
|
|
{{else if not .IsTextFile}}
|
2015-12-25 16:15:07 +05:30
|
|
|
<div class="view-raw ui center">
|
2015-12-08 04:00:52 +05:30
|
|
|
{{if .IsImageFile}}
|
2016-08-30 14:38:38 +05:30
|
|
|
<img src="{{EscapePound $.RawFileLink}}">
|
2016-12-20 13:39:11 +05:30
|
|
|
{{else if .IsVideoFile}}
|
|
|
|
<video controls src="{{EscapePound $.RawFileLink}}">
|
|
|
|
<strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong>
|
|
|
|
</video>
|
2016-04-27 07:18:44 +05:30
|
|
|
{{else if .IsPDFFile}}
|
2017-08-23 20:28:05 +05:30
|
|
|
<iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{else}}
|
2016-08-30 14:38:38 +05:30
|
|
|
<a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{else if .FileSize}}
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2016-07-12 03:51:26 +05:30
|
|
|
{{if .IsFileTooLarge}}
|
|
|
|
<td><strong>{{.i18n.Tr "repo.file_too_large"}}</strong></td>
|
|
|
|
{{else}}
|
2016-08-10 01:05:20 +05:30
|
|
|
<td class="lines-num">{{.LineNums}}</td>
|
2015-12-17 08:43:12 +05:30
|
|
|
<td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
|
2016-07-12 03:51:26 +05:30
|
|
|
{{end}}
|
2015-12-08 04:00:52 +05:30
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-11 18:18:08 +05:30
|
|
|
|
|
|
|
<script>
|
|
|
|
function submitDeleteForm() {
|
|
|
|
var message = prompt("{{.i18n.Tr "repo.delete_confirm_message"}}\n\n{{.i18n.Tr "repo.delete_commit_summary"}}", "Delete '{{.TreeName}}'");
|
|
|
|
if (message != null) {
|
|
|
|
$("#delete-message").val(message);
|
|
|
|
$("#delete-file-form").submit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|