From c970c4ee41bc98515ed37a92dfc7dbe125e213e1 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 14 Jul 2017 16:50:49 -0400 Subject: [PATCH] css: not include line numbers in diff selection (#4584) Changed template file in order to make CSS work properly. --- gogs.go | 2 +- public/css/gogs.css | 3 +++ public/less/_repository.less | 4 ++++ templates/.VERSION | 2 +- templates/repo/diff/section_unified.tmpl | 18 +++++------------- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/gogs.go b/gogs.go index 57e983315..c4b397a9e 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 e3e5b5735..4c3b03db7 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 efbfbbd51..ffa105082 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 c7ddd5de8..e16dd497c 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 0832d39f2..d85ea49d6 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -4,20 +4,12 @@ {{range $k, $line := $section.Lines}} {{if eq .GetType 4}} - - {{/* {{if gt $j 0}}{{end}} */}} - + + {{/* {{if gt $j 0}}{{end}} */}} + {{else}} - - {{if $line.LeftIdx}} - {{$line.LeftIdx}} - {{end}} - - - {{if $line.RightIdx}} - {{$line.RightIdx}} - {{end}} - + + {{end}}
{{$section.ComputedInlineDiffFor $line}}