summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff_box.tmpl
blob: 179e1cb3cf74284b785b6f9e55df0cbde8a4b46a (plain)
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
39
40
41
{{if .DiffNotAvailable}}
	<h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
	<div class="diff-detail-box diff-box">
		<div>
			<i class="fa fa-retweet"></i>
			{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
			<div class="ui right">
				<a class="ui tiny basic toggle button" href="?style={{if .Style}}inline{{else}}split{{end}}">{{ if .Style }}{{.i18n.Tr "repo.diff.show_inline_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
				<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
			</div>
		</div>
		<ol class="detail-files hide" id="diff-files">
			{{range .Diff.Files}}
				<li>
					<div class="diff-counter count pull-right">
						{{if not .IsBin}}
							<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
							<span class="bar">
								<span class="pull-left add"></span>
								<span class="pull-left del"></span>
							</span>
							<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
						{{else}}
							<span>{{$.i18n.Tr "repo.diff.bin"}}</span>
						{{end}}
					</div>
					<!-- todo finish all file status, now modify, add, delete and rename -->
					<span class="status {{DiffTypeToStr .Type}} poping up" data-content="{{DiffTypeToStr .Type}}" data-variation="inverted tiny" data-position="right center">&nbsp;</span>
					<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
				</li>
			{{end}}
		</ol>
	</div>

	{{if .Style}}
		{{ template "repo/diff_box_split" . }}
	{{else}}
		{{ template "repo/diff_box_inline" . }}
	{{end}}
{{end}}