From ad476e858ddf7d8d01a84f08554f06c7c865a535 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sat, 21 Jan 2012 15:58:29 +0100 Subject: [PATCH] show diff on commit panel --- .../sonia.repository.commitpanel.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js index 6ea9949329..b6b457b854 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js @@ -39,7 +39,6 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, { changeset: null, // templates - template: null, templateCommit: '
\n\

Commit {id}

\n\
\n\ @@ -57,14 +56,25 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
  • {.}
  • \n\ ', + // header panel + commitPanel: null, + diffPanel: null, + initComponent: function(){ - var template = this.templateCommit + this.templateModifications; - this.template = new Ext.XTemplate(template); + this.commitPanel = new Ext.Panel({ + tpl: new Ext.XTemplate(this.templateCommit + this.templateModifications) + }); + + this.diffPanel = new Sonia.panel.SyntaxHighlighterPanel({ + syntax: 'diff', + contentUrl: restUrl + 'repositories/' + this.repository.id + '/diff?revision=' + this.revision + }); var config = { bodyCssClass: 'x-panel-mc', padding: 10, - layout: 'fit' + layout: 'fit', + items: [this.commitPanel, this.diffPanel] } Ext.apply(this, Ext.apply(this.initialConfig, config)); @@ -77,7 +87,7 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, { update: function(changeset) { this.changeset = changeset; console.debug(changeset); - this.template.overwrite(this.body, this.changeset); + this.commitPanel.tpl.overwrite(this.commitPanel.body, this.changeset); }, loadChangeset: function(){