Skip to content

Commit 1687aa5

Browse files
silverwindlafriks
authored andcommitted
Improve suppressed diff boxes (#3193)
1 parent f94c1b3 commit 1687aa5

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

public/css/index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/less/_base.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ body {
99
img {
1010
border-radius: 3px;
1111
}
12+
.rounded {
13+
border-radius: .28571429rem !important;
14+
}
1215
pre, code {
1316
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
1417
&.raw {

public/less/_repository.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@
922922
}
923923
}
924924
.file {
925-
flex: 0 1 100%;
925+
flex: 1;
926926
color: #888;
927927
word-break: break-all;
928928
}

templates/repo/diff/box.tmpl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
{{if not .IsBin}}
1818
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
1919
<span class="bar">
20-
<span class="pull-left add"></span>
21-
<span class="pull-left del"></span>
20+
<div class="pull-left add"></div>
21+
<div class="pull-left del"></div>
2222
</span>
2323
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
2424
{{else}}
@@ -36,19 +36,26 @@
3636
{{range $i, $file := .Diff.Files}}
3737
{{if $file.IsIncomplete}}
3838
<div class="diff-file-box diff-box file-content">
39-
<h4 class="ui top attached normal header">
40-
{{$.i18n.Tr "repo.diff.file_suppressed"}}
39+
<h4 class="ui top attached normal header rounded">
4140
<div class="diff-counter count ui left">
4241
{{if not $file.IsRenamed}}
4342
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
4443
<span class="bar">
45-
<span class="pull-left add"></span>
46-
<span class="pull-left del"></span>
44+
<div class="pull-left add"></div>
45+
<div class="pull-left del"></div>
4746
</span>
4847
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
4948
{{end}}
5049
</div>
5150
<span class="file">{{$file.Name}}</span>
51+
<div>{{$.i18n.Tr "repo.diff.file_suppressed"}}</div>
52+
{{if not $file.IsSubmodule}}
53+
{{if $file.IsDeleted}}
54+
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
55+
{{else}}
56+
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
57+
{{end}}
58+
{{end}}
5259
</h4>
5360
</div>
5461
{{else}}
@@ -60,8 +67,8 @@
6067
{{else if not $file.IsRenamed}}
6168
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
6269
<span class="bar">
63-
<span class="pull-left add"></span>
64-
<span class="pull-left del"></span>
70+
<div class="pull-left add"></div>
71+
<div class="pull-left del"></div>
6572
</span>
6673
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
6774
{{end}}

0 commit comments

Comments
 (0)