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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {{template "base/head" .}}
  2. <div class="repository settings lfs">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container repository file list">
  6. {{template "base/alert" .}}
  7. <div class="tab-size-8 non-diff-file-content">
  8. <h4 class="ui top attached header">
  9. <a href="{{.LFSFilesLink}}">{{.i18n.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
  10. <div class="ui right">
  11. <a class="ui blue show-panel button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{$.i18n.Tr "repo.settings.lfs_findcommits"}}</a>
  12. </div>
  13. </h4>
  14. <div class="ui attached table unstackable segment">
  15. <div class="file-view {{if .IsMarkup}}markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji">
  16. {{if .IsMarkup}}
  17. {{if .FileContent}}{{.FileContent | Safe}}{{end}}
  18. {{else if .IsRenderedHTML}}
  19. <pre>{{if .FileContent}}{{.FileContent | Str2html}}{{end}}</pre>
  20. {{else if not .IsTextFile}}
  21. <div class="view-raw ui center">
  22. {{if .IsImageFile}}
  23. <img src="{{EscapePound $.RawFileLink}}">
  24. {{else if .IsVideoFile}}
  25. <video controls src="{{EscapePound $.RawFileLink}}">
  26. <strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong>
  27. </video>
  28. {{else if .IsAudioFile}}
  29. <audio controls src="{{EscapePound $.RawFileLink}}">
  30. <strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong>
  31. </audio>
  32. {{else if .IsPDFFile}}
  33. <iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
  34. {{else}}
  35. <a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
  36. {{end}}
  37. </div>
  38. {{else if .FileSize}}
  39. <table>
  40. <tbody>
  41. <tr>
  42. {{if .IsFileTooLarge}}
  43. <td><strong>{{.i18n.Tr "repo.file_too_large"}}</strong></td>
  44. {{else}}
  45. <td class="lines-num">{{.LineNums}}</td>
  46. <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
  47. {{end}}
  48. </tr>
  49. </tbody>
  50. </table>
  51. {{end}}
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. {{template "base/footer" .}}