You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lfs_file.tmpl 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
  2. <div class="user-main-content twelve wide column content repository file list">
  3. <div class="tab-size-8 non-diff-file-content">
  4. <h4 class="ui top attached header">
  5. <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
  6. <div class="ui right">
  7. {{if .EscapeStatus.Escaped}}
  8. <a class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a>
  9. <a class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a>
  10. {{end}}
  11. <a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
  12. </div>
  13. </h4>
  14. <div class="ui attached table unstackable segment">
  15. {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
  16. <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
  17. {{if .IsMarkup}}
  18. {{if .FileContent}}{{.FileContent | Safe}}{{end}}
  19. {{else if .IsPlainText}}
  20. <pre>{{if .FileContent}}{{.FileContent | Safe}}{{end}}</pre>
  21. {{else if not .IsTextFile}}
  22. <div class="view-raw">
  23. {{if .IsImageFile}}
  24. <img src="{{$.RawFileLink}}">
  25. {{else if .IsVideoFile}}
  26. <video controls src="{{$.RawFileLink}}">
  27. <strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong>
  28. </video>
  29. {{else if .IsAudioFile}}
  30. <audio controls src="{{$.RawFileLink}}">
  31. <strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
  32. </audio>
  33. {{else if .IsPDFFile}}
  34. <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "diff.view_file"}}"></div>
  35. {{else}}
  36. <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
  37. {{end}}
  38. </div>
  39. {{else if .FileSize}}
  40. <table>
  41. <tbody>
  42. <tr>
  43. {{if .IsFileTooLarge}}
  44. <td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td>
  45. {{else}}
  46. <td class="lines-num">{{.LineNums}}</td>
  47. <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol>{{.FileContent}}</ol></code></pre></td>
  48. {{end}}
  49. </tr>
  50. </tbody>
  51. </table>
  52. {{end}}
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. {{template "repo/settings/layout_footer" .}}