Skip to content

Commit 250f123

Browse files
Albert221bkcsoft
authored andcommitted
* Fix fileview rendering bug #2470 (#2477)
1 parent fd85e25 commit 250f123

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

public/css/index.css

+12
Original file line numberDiff line numberDiff line change
@@ -2063,9 +2063,14 @@ footer .ui.language .menu {
20632063
.repository .diff-detail-box span.status.rename {
20642064
background-color: #dad8ff;
20652065
}
2066+
.repository .diff-box {
2067+
display: flex;
2068+
align-items: center;
2069+
}
20662070
.repository .diff-box .count {
20672071
margin-right: 12px;
20682072
font-size: 13px;
2073+
flex: 0 0 auto;
20692074
}
20702075
.repository .diff-box .count .bar {
20712076
background-color: #bd2c00;
@@ -2080,7 +2085,14 @@ footer .ui.language .menu {
20802085
height: 12px;
20812086
}
20822087
.repository .diff-box .file {
2088+
flex: 0 1 100%;
20832089
color: #888;
2090+
word-break: break-all;
2091+
}
2092+
.repository .diff-box .button {
2093+
margin: -5px 0 -5px 12px;
2094+
padding: 8px 10px;
2095+
flex: 0 0 auto;
20842096
}
20852097
.repository .diff-file-box .header {
20862098
background-color: #f7f7f7;

public/less/_repository.less

+12
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,13 @@
888888
}
889889
}
890890
.diff-box {
891+
display: flex;
892+
align-items: center;
893+
891894
.count {
892895
margin-right: 12px;
893896
font-size: 13px;
897+
flex: 0 0 auto;
894898

895899
.bar {
896900
background-color: #bd2c00;
@@ -906,7 +910,15 @@
906910
}
907911
}
908912
.file {
913+
flex: 0 1 100%;
909914
color: #888;
915+
word-break: break-all;
916+
}
917+
918+
.button {
919+
margin: -5px 0 -5px 12px;
920+
padding: 8px 10px;
921+
flex: 0 0 auto;
910922
}
911923
}
912924
.diff-file-box {

templates/repo/diff/box.tmpl

+6-8
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
{{else}}
5555
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}" id="diff-{{.Index}}">
5656
<h4 class="ui top attached normal header">
57-
<div class="diff-counter count ui left">
57+
<div class="diff-counter count">
5858
{{if $file.IsBin}}
5959
{{$.i18n.Tr "repo.diff.bin"}}
6060
{{else if not $file.IsRenamed}}
@@ -68,13 +68,11 @@
6868
</div>
6969
<span class="file">{{if $file.IsRenamed}}{{$file.OldName}} &rarr; {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
7070
{{if not $file.IsSubmodule}}
71-
<div class="ui right">
72-
{{if $file.IsDeleted}}
73-
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
74-
{{else}}
75-
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
76-
{{end}}
77-
</div>
71+
{{if $file.IsDeleted}}
72+
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
73+
{{else}}
74+
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
75+
{{end}}
7876
{{end}}
7977
</h4>
8078
<div class="ui attached table segment">

0 commit comments

Comments
 (0)