Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
  2. <h4 class="ui top attached header" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
  3. <div class="ui stackable grid">
  4. <div class="ten wide column">
  5. {{if .ReadmeExist}}
  6. <i class="book icon ui left"></i>
  7. {{if .ReadmeInList}}
  8. <strong>{{.FileName}}</strong>
  9. {{else}}
  10. <strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
  11. {{end}}
  12. {{else}}
  13. <i class="file text outline icon ui left"></i>
  14. <strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
  15. {{end}}
  16. </div>
  17. <div class="six wide right aligned column">
  18. {{if not .ReadmeInList}}
  19. <div class="ui right file-actions">
  20. <div class="ui buttons">
  21. {{if not .IsViewCommit}}
  22. <a class="ui button" href="{{.RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_permalink"}}</a>
  23. {{end}}
  24. <a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a>
  25. <a class="ui button" href="{{EscapePound $.RawFileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
  26. </div>
  27. {{if .Repository.CanEnableEditor}}
  28. {{if .CanEditFile}}
  29. <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>
  30. {{else}}
  31. <i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
  32. {{end}}
  33. {{if .CanDeleteFile}}
  34. <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>
  35. {{else}}
  36. <i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
  37. {{end}}
  38. {{end}}
  39. </div>
  40. {{end}}
  41. </div>
  42. </div>
  43. </h4>
  44. <div class="ui attached table unstackable segment">
  45. <div class="file-view {{if .IsMarkup}}markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji">
  46. {{if .IsMarkup}}
  47. {{if .FileContent}}{{.FileContent | Safe}}{{end}}
  48. {{else if .IsRenderedHTML}}
  49. <pre>{{if .FileContent}}{{.FileContent | Str2html}}{{end}}</pre>
  50. {{else if not .IsTextFile}}
  51. <div class="view-raw ui center">
  52. {{if .IsImageFile}}
  53. <img src="{{EscapePound $.RawFileLink}}">
  54. {{else if .IsVideoFile}}
  55. <video controls src="{{EscapePound $.RawFileLink}}">
  56. <strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong>
  57. </video>
  58. {{else if .IsAudioFile}}
  59. <audio controls src="{{EscapePound $.RawFileLink}}">
  60. <strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong>
  61. </audio>
  62. {{else if .IsPDFFile}}
  63. <iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
  64. {{else}}
  65. <a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
  66. {{end}}
  67. </div>
  68. {{else if .FileSize}}
  69. <table>
  70. <tbody>
  71. <tr>
  72. {{if .IsFileTooLarge}}
  73. <td><strong>{{.i18n.Tr "repo.file_too_large"}}</strong></td>
  74. {{else}}
  75. <td class="lines-num">{{.LineNums}}</td>
  76. <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
  77. {{end}}
  78. </tr>
  79. </tbody>
  80. </table>
  81. {{end}}
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. function submitDeleteForm() {
  87. var message = prompt("{{.i18n.Tr "repo.delete_confirm_message"}}\n\n{{.i18n.Tr "repo.delete_commit_summary"}}", "Delete '{{.TreeName}}'");
  88. if (message != null) {
  89. $("#delete-message").val(message);
  90. $("#delete-file-form").submit()
  91. }
  92. }
  93. </script>