# HG changeset patch # User Anton Shestakov # Date 2017-12-04 10:26:54 # Node ID 75f9f366e5ccde5846f1825a129890e6346755e9 # Parent dc623009e0b069c176d3e8ae0e1afed6115f22f9 monoblue: render changesets server-side on /graph page diff --git a/contrib/wix/templates.wxs b/contrib/wix/templates.wxs --- a/contrib/wix/templates.wxs +++ b/contrib/wix/templates.wxs @@ -115,6 +115,7 @@ + diff --git a/mercurial/templates/monoblue/graph.tmpl b/mercurial/templates/monoblue/graph.tmpl --- a/mercurial/templates/monoblue/graph.tmpl +++ b/mercurial/templates/monoblue/graph.tmpl @@ -31,7 +31,7 @@
    -
      +
        {nodes%graphentry}
      @@ -52,38 +52,13 @@ var bg = '
    • '; var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size; - var nstyle = 'padding-left: ' + left + 'px;'; - var tagspan = ''; - if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{ - tagspan = ''; - if (cur[6][1]) \{ - tagspan += ''; - tagspan += cur[6][0] + ' '; - } else if (!cur[6][1] && cur[6][0] != 'default') \{ - tagspan += ''; - tagspan += cur[6][0] + ' '; - } - if (cur[7].length) \{ - for (var t in cur[7]) \{ - var tag = cur[7][t]; - tagspan += '' + tag + ' '; - } - } - if (cur[8].length) \{ - for (var t in cur[8]) \{ - var bookmark = cur[8][t]; - tagspan += '' + bookmark + ' '; - } - } - tagspan += ''; + var item = document.querySelector('[data-node="' + cur.node + '"]'); + if (item) \{ + item.style.paddingLeft = left + 'px'; } - var item = '
    • '; - item += '' + cur[3] + ''; - item += '' + tagspan + '' + cur[5] + ', by ' + cur[4] + '
    • '; - - return [bg, item]; + return [bg, '']; } diff --git a/mercurial/templates/monoblue/graphentry.tmpl b/mercurial/templates/monoblue/graphentry.tmpl new file mode 100644 --- /dev/null +++ b/mercurial/templates/monoblue/graphentry.tmpl @@ -0,0 +1,7 @@ +
    • + + {desc|strip|firstline|escape|nonempty} + + {alltags} + {date|rfc822date}, by {author|person} +
    • diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map +++ b/mercurial/templates/monoblue/map @@ -282,6 +282,7 @@ index = index.tmpl urlparameter = '{separator}{name}={value|urlescape}' hiddenformentry = '' graph = graph.tmpl +graphentry = graphentry.tmpl breadcrumb = '> {name|escape} ' searchform = ' 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 @@ -731,6 +731,9 @@ Set up the repo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=monoblue' | egrep $REVLINKS
    • files
    • + third + second + first less more | (0) tip @@ -810,6 +813,8 @@ Set up the repo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=monoblue' | egrep $REVLINKS
    • files
    • + second + first less more | (0) tip