# HG changeset patch # User Anton Shestakov # Date 2018-01-05 10:46:06 # Node ID 5afe0ca59b073180701621b34657c52b335224e2 # Parent fb2e59e92651c33918987b9bbf84cedb37ac2557 paper: make actual changeset entries have backgrounds on /graph This patch removes a separate container for backgrounds only and puts backgrounds on changeset elements themselves. This makes it so that JS code doesn't need to create background elements separately anymore. There's a bit of manipulating positions of elements: every changeset entry has a "fg" element that gets a higher z-index than element. This prioritizes text information, so that even if it somehow gets close to the graph drawn on (which has z-index of 5), it'll still be on top of it. This can happen if commit message has a long first line and browser window is narrow, for example. diff --git a/mercurial/templates/paper/graph.tmpl b/mercurial/templates/paper/graph.tmpl --- a/mercurial/templates/paper/graph.tmpl +++ b/mercurial/templates/paper/graph.tmpl @@ -50,21 +50,14 @@
-
    -
      {nodes%graphentry}
    +
      {nodes%graphentry}
    diff --git a/mercurial/templates/paper/graphentry.tmpl b/mercurial/templates/paper/graphentry.tmpl --- a/mercurial/templates/paper/graphentry.tmpl +++ b/mercurial/templates/paper/graphentry.tmpl @@ -1,7 +1,9 @@
  • - - {desc|strip|firstline|escape|nonempty} - - {alltags} -
    {date|rfc822date}, by {author|person}
    +
    + + {desc|strip|firstline|escape|nonempty} + + {alltags} +
    {date|rfc822date}, by {author|person}
    +
  • diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css --- a/mercurial/templates/static/style-paper.css +++ b/mercurial/templates/static/style-paper.css @@ -460,22 +460,19 @@ canvas { } ul#graphnodes { - position: absolute; - z-index: 10; - top: -1.0em; - list-style: none inside none; - padding: 0; -} - -ul#nodebgs { list-style: none inside none; padding: 0; margin: 0; - top: -0.7em; } -ul#graphnodes li, ul#nodebgs li { +ul#graphnodes li { height: 39px; + overflow: visible; +} + +ul#graphnodes li .fg { + position: absolute; + z-index: 10; } ul#graphnodes li .info { diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t --- a/tests/test-hgweb-empty.t +++ b/tests/test-hgweb-empty.t @@ -294,21 +294,14 @@ Some tests for hgweb in an empty reposit
    -
      -
        +
          diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t +++ b/tests/test-hgweb-symrev.t @@ -59,9 +59,9 @@ Set up the repo less more | rev 2: (0) tip - third - second - first + third + second + first less more | rev 2: (0) tip @@ -126,8 +126,8 @@ Set up the repo less more | rev 1: (0) tip - second - first + second + first less more | rev 1: (0) tip @@ -259,9 +259,9 @@ Set up the repo less more | rev 2: (0) tip - third - second - first + third + second + first less more | rev 2: (0) tip @@ -326,8 +326,8 @@ Set up the repo less more | rev 1: (0) tip - second - first + second + first less more | rev 1: (0) tip