Patchwork [2,of,5] hgweb: code selection without line numbers in file diff and changeset views

login
register
mail settings
Submitter Alexander Plavin
Date May 31, 2013, 10:35 a.m.
Message ID <b05d1e3d588bc747083c.1369996509@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1675/
State Rejected, archived
Headers show

Comments

Alexander Plavin - May 31, 2013, 10:35 a.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1369931030 -14400
#      Thu May 30 20:23:50 2013 +0400
# Node ID b05d1e3d588bc747083ced741c29829c55c73cd8
# Parent  fb5ca82f275afc3cbacd10441a9f55f1730a538d
hgweb: code selection without line numbers in file diff and changeset views

File diff and changeset views display lines the same way as file code view, as
HTML ordered list, so that line numbers are not selected with the code itself.

Patch

diff -r fb5ca82f275a -r b05d1e3d588b mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/changeset.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -77,7 +77,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r fb5ca82f275a -r b05d1e3d588b mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/filediff.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -68,7 +68,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r fb5ca82f275a -r b05d1e3d588b mercurial/templates/paper/map
--- a/mercurial/templates/paper/map	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/map	Thu May 30 20:23:50 2013 +0400
@@ -84,11 +84,11 @@ 
     <td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td>
   </tr>'
 
-diffblock = '<div class="source bottomline parity{parity}"><pre>{lines}</pre></div>'
-difflineplus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="plusline">{line|escape}</span>'
-difflineminus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="minusline">{line|escape}</span>'
-difflineat = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="atline">{line|escape}</span>'
-diffline = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}'
+diffblock = '<div class="bottomline parity{parity}"><ol class="parity{parity}">{lines}</ol></div>'
+difflineplus = '<li class="source" id="{lineid}"><div class="plusline">{line|escape|spaceifempty}</div></li>'
+difflineminus = '<li class="source" id="{lineid}"><div class="minusline">{line|escape|spaceifempty}</div></li>'
+difflineat = '<li class="source" id="{lineid}"><div class="atline">{line|escape|spaceifempty}</div></li>'
+diffline = '<li class="source" id="{lineid}"><div>{line|escape|spaceifempty}</div></li>'
 
 comparisonblock ='
   <tbody class="block">
diff -r fb5ca82f275a -r b05d1e3d588b mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/static/style-paper.css	Thu May 30 20:23:50 2013 +0400
@@ -96,9 +96,9 @@ 
 .indexlinks { white-space:nowrap; }
 .parity0 { background-color: #f0f0f0; }
 .parity1 { background-color: white; }
-.plusline { color: green; }
-.minusline { color: #dc143c; } /* crimson */
-.atline { color: purple; }
+.plusline { color: green !important; }
+.minusline { color: #dc143c !important; } /* crimson */
+.atline { color: purple !important; }
 
 .diffstat-file {
   white-space: nowrap;