Browse Source

* Fix fileview rendering bug #2470 (#2477)

Albert 2 years ago
parent
commit
250f1236dc
3 changed files with 30 additions and 8 deletions
  1. 12 0
      public/css/index.css
  2. 12 0
      public/less/_repository.less
  3. 6 8
      templates/repo/diff/box.tmpl

+ 12 - 0
public/css/index.css

@@ -2063,9 +2063,14 @@ footer .ui.language .menu {
2063 2063
 .repository .diff-detail-box span.status.rename {
2064 2064
   background-color: #dad8ff;
2065 2065
 }
2066
+.repository .diff-box {
2067
+  display: flex;
2068
+  align-items: center;
2069
+}
2066 2070
 .repository .diff-box .count {
2067 2071
   margin-right: 12px;
2068 2072
   font-size: 13px;
2073
+  flex: 0 0 auto;
2069 2074
 }
2070 2075
 .repository .diff-box .count .bar {
2071 2076
   background-color: #bd2c00;
@@ -2080,7 +2085,14 @@ footer .ui.language .menu {
2080 2085
   height: 12px;
2081 2086
 }
2082 2087
 .repository .diff-box .file {
2088
+  flex: 0 1 100%;
2083 2089
   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;
2084 2096
 }
2085 2097
 .repository .diff-file-box .header {
2086 2098
   background-color: #f7f7f7;

+ 12 - 0
public/less/_repository.less

@@ -888,9 +888,13 @@
888 888
 		}
889 889
 	}
890 890
 	.diff-box {
891
+		display: flex;
892
+		align-items: center;
893
+
891 894
 		.count {
892 895
 			margin-right: 12px;
893 896
 			font-size: 13px;
897
+			flex: 0 0 auto;
894 898
 
895 899
 			.bar {
896 900
 				background-color: #bd2c00;
@@ -906,7 +910,15 @@
906 910
 			}
907 911
 		}
908 912
 		.file {
913
+			flex: 0 1 100%;
909 914
 			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;
910 922
 		}
911 923
 	}
912 924
 	.diff-file-box {

+ 6 - 8
templates/repo/diff/box.tmpl

@@ -54,7 +54,7 @@
54 54
 		{{else}}
55 55
 			<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}" id="diff-{{.Index}}">
56 56
 				<h4 class="ui top attached normal header">
57
-					<div class="diff-counter count ui left">
57
+					<div class="diff-counter count">
58 58
 						{{if $file.IsBin}}
59 59
 							{{$.i18n.Tr "repo.diff.bin"}}
60 60
 						{{else if not $file.IsRenamed}}
@@ -68,13 +68,11 @@
68 68
 					</div>
69 69
 					<span class="file">{{if $file.IsRenamed}}{{$file.OldName}} &rarr; {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}}</span>
70 70
 					{{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}}
78 76
 					{{end}}
79 77
 				</h4>
80 78
 				<div class="ui attached table segment">