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.

image_diff.tmpl 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {{if or .blobBase .blobHead}}
  2. <tr>
  3. <td colspan="2">
  4. <div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
  5. <div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
  6. <div class="new-menu-inner">
  7. <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
  8. {{if and .blobBase .blobHead}}
  9. <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
  10. <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
  11. {{end}}
  12. </div>
  13. </div>
  14. <div class="gt-hidden">
  15. <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.Index}}">
  16. <div class="diff-side-by-side">
  17. {{if .blobBase}}
  18. <span class="side">
  19. <p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p>
  20. <span class="before-container"><img class="image-before" /></span>
  21. <p>
  22. <span class="bounds-info-before">
  23. {{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
  24. &nbsp;|&nbsp;
  25. {{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
  26. &nbsp;|&nbsp;
  27. </span>
  28. {{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span>
  29. </p>
  30. </span>
  31. {{end}}
  32. {{if .blobHead}}
  33. <span class="side">
  34. <p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p>
  35. <span class="after-container"><img class="image-after" /></span>
  36. <p>
  37. <span class="bounds-info-after">
  38. {{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
  39. &nbsp;|&nbsp;
  40. {{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
  41. &nbsp;|&nbsp;
  42. </span>
  43. {{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span>
  44. </p>
  45. </span>
  46. {{end}}
  47. </div>
  48. </div>
  49. {{if and .blobBase .blobHead}}
  50. <div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
  51. <div class="diff-swipe">
  52. <div class="swipe-frame">
  53. <span class="before-container"><img class="image-before" /></span>
  54. <span class="swipe-container">
  55. <span class="after-container"><img class="image-after" /></span>
  56. </span>
  57. <span class="swipe-bar">
  58. <span class="handle top-handle"></span>
  59. <span class="handle bottom-handle"></span>
  60. </span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.Index}}">
  65. <div class="diff-overlay">
  66. <div class="overlay-frame">
  67. <div class="ui centered">
  68. <input type="range" min="0" max="100" value="50" />
  69. </div>
  70. <span class="before-container"><img class="image-before"/></span>
  71. <span class="after-container"><img class="image-after" /></span>
  72. </div>
  73. </div>
  74. </div>
  75. {{end}}
  76. </div>
  77. <div class="ui active centered inline loader gt-mb-4"></div>
  78. </div>
  79. </td>
  80. </tr>
  81. {{end}}