Commit 0cc54198 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

First version of the wizard pages.

parent 681f09c6
......@@ -234,12 +234,11 @@ if session.role in (ADMIN, USER):
selectorTitle='Fill all fields')
harvesterLeaf = Window(closable=True,
height=300,
items=[dict(xtype='xwizardharvester')],
layout='fit',
modal=True,
title='Wizard to Create an harvester...',
width=400)
title='Wizard...',
width=300)
marc12Leaf = PanelWithUrlSelector(virtdb.marc12_selector,
selectorTitle='Fill all fields',
......
......@@ -7,6 +7,16 @@
extend: 'Ext.panel.Panel',
alias: 'widget.xwizardharvester',
requires: [
'Ext.layout.container.Card',
'Ext.layout.container.Form'
],
uses: [
'App.form.field.ComboBox',
'Ext.form.field.Combobox',
'Ext.form.RadioGroup',
'Ext.form.field.Text'
],
// predefine configuration options
bodyStyle: 'padding:15px',
......@@ -23,7 +33,8 @@
text: 'finish'
}],
defaults: {
border: false
border: false,
layout: 'form'
},
layout: 'card',
......@@ -44,7 +55,12 @@
me.items = [
me.configurePage0(),
me.configurePage1()];
me.configurePage1(),
me.configurePage2(),
me.configurePage3(),
me.configurePage4(),
me.configurePage5()
];
//initialise the base class
me.callParent(arguments);
......@@ -61,31 +77,221 @@
me.buttonPrev.setHandler(function(){me.navigate(-1);}, me);
},
// private
// return the configuration of the welcome page
configurePage0: function() {
"use strict";
var cfg,
me = this;
me = this,
text;
text = [
"<p>The wizard will create one harvester to:",
"<ol>",
"<li>select publications in the <i>inspirehep.net</i> store</li>",
"<li>associate the found publications to one of your projects</li>",
"</ol></p>"
];
cfg = {
html: 'Hello word',
title: 'Introduction'
items: [{
border: false,
html: text.join(" ")
}]
};
return cfg;
},
// private
// return the configuration of the page to select the publication category
configurePage1: function() {
"use strict";
var categories,
cfg,
me = this,
text;
text = [
"<p>Select the <i>category of publication</i>, ",
"you are looking for in the <i>inspirehep.net</i> store:</p>"
];
categories = Ext.create('Ext.data.Store', {
fields: ['category'],
data : [
{"category":"article"},
{"category":"proceeding"}
]
});
cfg = {
items: [{
border: false,
html: text.join(" ")
}, {
displayField: 'category',
queryMode: 'local',
name: 'category',
store: categories,
valueField: 'category',
xtype: 'combobox'
}]
};
return cfg;
},
// private
// return the configuration of the page to select the publication producer
configurePage2: function() {
"use strict";
var cfg,
me = this;
me = this,
text;
text = [
"<p>The publication are produced by:</p>"
];
cfg = {
items: [{
border: false,
html: text.join(" ")
}, {
allowBlank: false,
columns: 1,
items: [{
boxLabel:'International collaboration / experiment',
inputValue: 'collaboration',
name: 'producer'
}, {
boxLabel: 'People not belonging to a collaboration',
inputValue: 'team',
name: 'producer'
}],
vertical: true,
xtype: 'radiogroup'
}]
};
return cfg;
},
// private
// return the configuration of the page to select
// international collaboration
configurePage3: function() {
"use strict";
var cfg,
me = this,
text1,
text2;
text1 = [
"<p>Enter the name of the collaboration:</p>"
];
text2 = [
"<p>Collaborations, know by the store <i>inspirehep.net</i>,",
"can be found at",
"<a href='https://inspirehep.net/collection/Experiments'",
"target='_blank'>",
"https://inspirehep.net/collection/Experiments</a>.</p>"
];
cfg = {
items: [{
border: false,
html: text1.join(" ")
}, {
name: 'collaboration',
xtype: 'textfield'
}, {
border: false,
html: text2.join(" ")
}]
};
return cfg;
},
// private
// return the configuration of the page to select a list of people
configurePage4: function() {
"use strict";
var cfg,
me = this,
text1,
text2;
text1 = [
"<p>Enter the name of the people:",
"<ul><li>one name per line.</li>",
"<li>the syntax is either <i>j doe</i> or <i>doe</i>",
"when the full name is <i>John Doe</i></li>",
"</ul></p>"
];
text2 = [
"<p>Launch the contextual menu, on the list, to add more entries,",
"to modify the order or to delete an item.</p>"
];
cfg = {
items: [{
border: false,
html: text1.join(" ")
}, {
hideHeader: true,
minimumRows: 4,
name: 'team',
xtype: 'xlistfield'
}, {
border: false,
html: text2.join(" ")
}]
};
return cfg;
},
// private
// return the configuration of the page to select the project
configurePage5: function() {
"use strict";
var cfg,
me = this,
text;
text = [
"Associate the found publications to my project:"
];
cfg = {
html: 'on the second page',
title: 'Category of publications'
items: [{
border: false,
html: text.join(" ")
}, {
displayField: 'ProjectsProject',
queryMode: 'remote',
name: 'project',
store: 'projectsStore',
valueField: 'ProjectsId',
xtype: 'xcombobox'
}]
};
return cfg;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment