From patchwork Mon Dec 4 12:40:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4,of,6] gitweb: render changesets server-side on /graph page From: Anton Shestakov X-Patchwork-Id: 25919 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 04 Dec 2017 20:40:41 +0800 # HG changeset patch # User Anton Shestakov # Date 1512380625 -28800 # Mon Dec 04 17:43:45 2017 +0800 # Node ID a7a3300dd1e3270f57689c653a37f4a679c27bdf # Parent 01869367acccffd4d80d49de578a322b6a370553 # EXP-Topic hgweb-more-info gitweb: 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 @@ -85,6 +85,7 @@ + diff --git a/mercurial/templates/gitweb/graph.tmpl b/mercurial/templates/gitweb/graph.tmpl --- a/mercurial/templates/gitweb/graph.tmpl +++ b/mercurial/templates/gitweb/graph.tmpl @@ -39,7 +39,7 @@ graph |
    -
      +
        {nodes%graphentry}
      @@ -58,39 +58,13 @@ graph.vertex = function(x, y, radius, co 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 + ''; - item += '' + cur[5] + ', by ' + cur[4] + '
    • '; - - return [bg, item]; + return [bg, '']; } diff --git a/mercurial/templates/gitweb/graphentry.tmpl b/mercurial/templates/gitweb/graphentry.tmpl new file mode 100644 --- /dev/null +++ b/mercurial/templates/gitweb/graphentry.tmpl @@ -0,0 +1,7 @@ +
    • + + {desc|strip|firstline|escape|nonempty} + + {alltags} + {date|age}, by {author|person} +
    • diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map +++ b/mercurial/templates/gitweb/map @@ -262,6 +262,7 @@ filecompchild = ' ' shortlog = shortlog.tmpl graph = graph.tmpl +graphentry = graphentry.tmpl phasetag = '{ifeq(phase, 'public', '', '{phase|escape} ')}' obsoletetag = '{if(obsolete, 'obsolete ')}' instabilitytag = '{instability|escape} ' diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t +++ b/tests/test-hgweb-commands.t @@ -1782,7 +1782,35 @@ Overviews
        -
          +