Repository navigation
Expand file tree
/
Copy pathimage_diff.tmpl
More file actions
38 lines (38 loc) · 1.61 KB
/
Copy pathimage_diff.tmpl
File metadata and controls
38 lines (38 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{{ $imagePathOld := printf "%s%s/%s" (AppUrlTrimmed) .root.BeforeRawPath (EscapePound .file.OldName) }}
{{ $imagePathNew := printf "%s%s/%s" (AppUrlTrimmed) .root.RawPath (EscapePound .file.Name) }}
{{ $imageInfoOld := imageInfo $imagePathOld }}
{{ $imageInfoNew := imageInfo $imagePathNew }}
<tr>
<th class="halfwidth center">
{{.root.i18n.Tr "repo.diff.file_before"}}
</th>
<th class="halfwidth center">
{{.root.i18n.Tr "repo.diff.file_after"}}
</th>
</tr>
<tr>
<td class="halfwidth center">
<a href="{{$imagePathOld}}" target="_blank">
<img src="{{$imagePathOld}}" class="border red" />
</a>
</td>
<td class="halfwidth center">
<a href="{{$imagePathNew}}" target="_blank">
<img src="{{$imagePathNew}}" class="border green" />
</a>
</td>
</tr>
{{if and $imageInfoOld $imageInfoNew }}
<tr>
<td class="halfwidth center">
{{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{if not (eq $imageInfoOld.Width $imageInfoNew.Width)}}red{{end}}">{{$imageInfoOld.Width}}</span>
|
{{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{if not (eq $imageInfoOld.Height $imageInfoNew.Height)}}red{{end}}">{{$imageInfoOld.Height}}</span>
</td>
<td class="halfwidth center">
{{.root.i18n.Tr "repo.diff.file_image_width"}}: <span class="text {{if not (eq $imageInfoOld.Width $imageInfoNew.Width)}}green{{end}}">{{$imageInfoNew.Width}}</span>
|
{{.root.i18n.Tr "repo.diff.file_image_height"}}: <span class="text {{if not (eq $imageInfoOld.Height $imageInfoNew.Height)}}green{{end}}">{{$imageInfoNew.Height}}</span>
</td>
</tr>
{{end}}