aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-07-14 16:50:49 -0400
committerUnknwon <u@gogs.io>2017-07-14 16:50:49 -0400
commitc970c4ee41bc98515ed37a92dfc7dbe125e213e1 (patch)
treee9ae7c8b98c360bb836b368c2175637e8fc10f80
parent3a6623104f7725905e2b14582579abea1590cec3 (diff)
css: not include line numbers in diff selection (#4584)
Changed template file in order to make CSS work properly.
-rw-r--r--gogs.go2
-rw-r--r--public/css/gogs.css3
-rw-r--r--public/less/_repository.less4
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/diff/section_unified.tmpl18
5 files changed, 14 insertions, 15 deletions
diff --git a/gogs.go b/gogs.go
index 57e98331..c4b397a9 100644
--- a/gogs.go
+++ b/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
diff --git a/public/css/gogs.css b/public/css/gogs.css
index e3e5b573..4c3b03db 100644
--- a/public/css/gogs.css
+++ b/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;
diff --git a/public/less/_repository.less b/public/less/_repository.less
index efbfbbd5..ffa10508 100644
--- a/public/less/_repository.less
+++ b/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 {
diff --git a/templates/.VERSION b/templates/.VERSION
index c7ddd5de..e16dd497 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.11.24.0627 \ No newline at end of file
+0.11.25.0714 \ No newline at end of file
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl
index 0832d39f..d85ea49d 100644
--- a/templates/repo/diff/section_unified.tmpl
+++ b/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>