diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.repository.js b/scm-webapp/src/main/webapp/resources/js/sonia.repository.js index 80eace7e8d..a375deabdf 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.repository.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.repository.js @@ -196,60 +196,91 @@ Ext.reg('repositoryGrid', Sonia.repository.Grid); Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, { - tpl: 'Name: {name}
\n\ - Type: {type}
\n\ - URL : {url}
\n\ -
ChangesetViewer', + linkTemplate: '{0}', + actionLinkTemplate: '{0}', initComponent: function(){ - if (typeof this.tpl === 'string') { - this.tpl = new Ext.XTemplate(this.tpl); - } var config = { title: this.item.name, padding: 5, bodyCssClass: 'x-panel-mc', - listeners: { - click: { - fn: this.onLinkClick, - scope: this, - delegate: 'a' + layout: 'table', + layoutConfig: { + columns: 2, + tableAttrs: { + style: 'width: 80%;' } - } + }, + defaults: { + style: 'font-size: 12px' + }, + // TODO i18n + items: [{ + xtype: 'label', + text: 'Name: ' + },{ + xtype: 'box', + html: this.item.name + },{ + xtype: 'label', + text: 'Type: ' + },{ + xtype: 'box', + html: this.getRepositoryTypeText(this.item.type) + },{ + xtype: 'label', + text: 'Url: ' + },{ + xtype: 'box', + html: String.format(this.linkTemplate, this.item.url) + },{ + xtype: 'box', + height: 10, + colspan: 2 + },{ + xtype: 'link', + colspan: 2, + text: 'ChangesetViewer', + listeners: { + click: { + fn: this.openChangesetViewer, + scope: this + } + } + }] } Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.InfoPanel.superclass.initComponent.apply(this, arguments); }, - onLinkClick: function(e, t){ - if ( t.id == 'changesetviewer' ){ - var changesetViewer = { - id: this.item.id + '-changesetViewer', - title: 'ChangesetViewer ' + this.item.name, - repository: this.item, - xtype: 'repositoryChangesetViewerPanel', - closable: true, - autoScroll: true + getRepositoryTypeText: function(t){ + var text = null; + for ( var i=0; i