mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
added getRepositoryUrlWithUsername method to InfoPanel
This commit is contained in:
@@ -219,6 +219,28 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, {
|
|||||||
actionLinkTemplate: '<a style="cursor: pointer;">{0}</a>',
|
actionLinkTemplate: '<a style="cursor: pointer;">{0}</a>',
|
||||||
|
|
||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
|
// TODO i18n
|
||||||
|
var 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)
|
||||||
|
}];
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
title: this.item.name,
|
title: this.item.name,
|
||||||
padding: 5,
|
padding: 5,
|
||||||
@@ -233,31 +255,10 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, {
|
|||||||
defaults: {
|
defaults: {
|
||||||
style: 'font-size: 12px'
|
style: 'font-size: 12px'
|
||||||
},
|
},
|
||||||
// TODO i18n
|
items: items
|
||||||
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)
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug(config);
|
|
||||||
this.modifyDefaultConfig(config);
|
this.modifyDefaultConfig(config);
|
||||||
console.debug(config);
|
|
||||||
|
|
||||||
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||||
Sonia.repository.InfoPanel.superclass.initComponent.apply(this, arguments);
|
Sonia.repository.InfoPanel.superclass.initComponent.apply(this, arguments);
|
||||||
@@ -266,6 +267,18 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, {
|
|||||||
modifyDefaultConfig: function(config){
|
modifyDefaultConfig: function(config){
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getRepositoryUrlWithUsername: function(){
|
||||||
|
var uri = this.item.url;
|
||||||
|
if ( state.user.name != 'anonymous' ){
|
||||||
|
var index = uri.indexOf("://");
|
||||||
|
if ( index > 0 ){
|
||||||
|
index += 3;
|
||||||
|
uri = uri.substring(0, index) + state.user.name + "@" + uri.substring(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return uri;
|
||||||
|
},
|
||||||
|
|
||||||
getRepositoryTypeText: function(t){
|
getRepositoryTypeText: function(t){
|
||||||
var text = null;
|
var text = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user