Ver código fonte

css: not include line numbers in diff selection (#4584)

Changed template file in order to make CSS work properly.
Unknwon 6 anos atrás
pai
commit
c970c4ee41

+ 1 - 1
gogs.go

@@ -16,7 +16,7 @@ import (
 	"github.com/gogits/gogs/pkg/setting"
 )
 
-const APP_VER = "0.11.24.0627"
+const APP_VER = "0.11.25.0714"
 
 func init() {
 	setting.AppVer = APP_VER

+ 3 - 0
public/css/gogs.css

@@ -2140,6 +2140,9 @@ footer .ui.language .menu {
   padding: 0 5px;
   user-select: none;
 }
+.repository .diff-file-box .code-diff .lines-num::before {
+  content: attr(data-line-number);
+}
 .repository .diff-file-box .code-diff .lines-num.lines-num-old,
 .repository .diff-file-box .code-diff .lines-num.lines-num-new {
   cursor: pointer;

+ 4 - 0
public/less/_repository.less

@@ -1057,6 +1057,10 @@
 				padding: 0 5px;
 				user-select: none;
 
+				&::before {
+					content: attr(data-line-number);
+				}
+
 				&.lines-num-old, &.lines-num-new {
 					cursor: pointer;
 					&:hover {

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.24.0627
+0.11.25.0714

+ 5 - 13
templates/repo/diff/section_unified.tmpl

@@ -4,20 +4,12 @@
 	{{range $k, $line := $section.Lines}}
 		<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
 			{{if eq .GetType 4}}
-			<td colspan="2" class="lines-num">
-				{{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
-			</td>
+				<td colspan="2" class="lines-num">
+					{{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
+				</td>
 			{{else}}
-			<td class="lines-num lines-num-old" {{if $line.LeftIdx}}id="diff-{{$file.Index}}L{{$line.LeftIdx}}"{{end}}>
-				{{if $line.LeftIdx}}
-					<span>{{$line.LeftIdx}}</span>
-				{{end}}
-			</td>
-			<td class="lines-num lines-num-new" {{if $line.RightIdx}}id="diff-{{$file.Index}}R{{$line.RightIdx}}"{{end}}>
-				{{if $line.RightIdx}}
-					<span>{{$line.RightIdx}}</span>
-				{{end}}
-			</td>
+				<td class="lines-num lines-num-old" {{if $line.LeftIdx}} id="diff-{{$file.Index}}L{{$line.LeftIdx}}" data-line-number="{{$line.LeftIdx}}"{{end}}></td>
+				<td class="lines-num lines-num-new" {{if $line.RightIdx}} id="diff-{{$file.Index}}R{{$line.RightIdx}}" data-line-number="{{$line.RightIdx}}"{{end}}></td>
 			{{end}}
 			<td class="lines-code">
 				<pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.ComputedInlineDiffFor $line}}</code></pre>