本站源代码
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

80 lines
2.8KB

  1. {{ $imagePathOld := printf "%s/%s" .root.BeforeRawPath (EscapePound .file.OldName) }}
  2. {{ $imagePathNew := printf "%s/%s" .root.RawPath (EscapePound .file.Name) }}
  3. <tr>
  4. <th class="halfwidth center">
  5. {{.root.i18n.Tr "repo.diff.file_before"}}
  6. </th>
  7. <th class="halfwidth center">
  8. {{.root.i18n.Tr "repo.diff.file_after"}}
  9. </th>
  10. </tr>
  11. <tr>
  12. <td class="halfwidth center">
  13. {{if or .file.IsDeleted (not .file.IsCreated)}}
  14. <a href="{{$imagePathOld}}" target="_blank">
  15. <img src="{{$imagePathOld}}" class="border red" />
  16. </a>
  17. {{end}}
  18. </td>
  19. <td class="halfwidth center">
  20. {{if or .file.IsCreated (not .file.IsDeleted)}}
  21. <a href="{{$imagePathNew}}" target="_blank">
  22. <img src="{{$imagePathNew}}" class="border green" />
  23. </a>
  24. {{end}}
  25. </td>
  26. </tr>
  27. {{ $imageInfoBase := (call .root.ImageInfoBase .file.OldName) }}
  28. {{ $imageInfoHead := (call .root.ImageInfo .file.Name) }}
  29. {{if or $imageInfoBase $imageInfoHead }}
  30. <tr>
  31. <td class="halfwidth center">
  32. {{if $imageInfoBase }}
  33. {{ $classWidth := "" }}
  34. {{ $classHeight := "" }}
  35. {{ $classByteSize := "" }}
  36. {{if $imageInfoHead}}
  37. {{if not (eq $imageInfoBase.Width $imageInfoHead.Width)}}
  38. {{ $classWidth = "red" }}
  39. {{end}}
  40. {{if not (eq $imageInfoBase.Height $imageInfoHead.Height)}}
  41. {{ $classHeight = "red" }}
  42. {{end}}
  43. {{if not (eq $imageInfoBase.ByteSize $imageInfoHead.ByteSize)}}
  44. {{ $classByteSize = "red" }}
  45. {{end}}
  46. {{end}}
  47. {{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{$classWidth}}">{{$imageInfoBase.Width}}</span>
  48. &nbsp;|&nbsp;
  49. {{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{$classHeight}}">{{$imageInfoBase.Height}}</span>
  50. &nbsp;|&nbsp;
  51. {{.root.i18n.Tr "repo.diff.file_byte_size"}}: <span class="text {{$classByteSize}}">{{FileSize $imageInfoBase.ByteSize}}</span>
  52. {{end}}
  53. </td>
  54. <td class="halfwidth center">
  55. {{if $imageInfoHead }}
  56. {{ $classWidth := "" }}
  57. {{ $classHeight := "" }}
  58. {{ $classByteSize := "" }}
  59. {{if $imageInfoBase}}
  60. {{if not (eq $imageInfoBase.Width $imageInfoHead.Width)}}
  61. {{ $classWidth = "green" }}
  62. {{end}}
  63. {{if not (eq $imageInfoBase.Height $imageInfoHead.Height)}}
  64. {{ $classHeight = "green" }}
  65. {{end}}
  66. {{if not (eq $imageInfoBase.ByteSize $imageInfoHead.ByteSize)}}
  67. {{ $classByteSize = "green" }}
  68. {{end}}
  69. {{end}}
  70. {{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{$classWidth}}">{{$imageInfoHead.Width}}</span>
  71. &nbsp;|&nbsp;
  72. {{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{$classHeight}}">{{$imageInfoHead.Height}}</span>
  73. &nbsp;|&nbsp;
  74. {{.root.i18n.Tr "repo.diff.file_byte_size"}}: <span class="text {{$classByteSize}}">{{FileSize $imageInfoHead.ByteSize}}</span>
  75. {{end}}
  76. </td>
  77. </tr>
  78. {{end}}
上海开阖软件有限公司 沪ICP备12045867号-1