Commit e0a2769d authored by Ostrzyciel nożyczek's avatar Ostrzyciel nożyczek

Add caption field and make description optional

parent c19f31fd
......@@ -64,9 +64,7 @@
label: mw.message( 'mwe-upwiz-caption' ).text(),
help: mw.message( 'mwe-upwiz-tooltip-caption' ).text()
} );
if ( mw.UploadWizard.config.wikibase.enabled ) {
this.mainFields.push( this.captionsDetailsField );
}
this.mainFields.push( this.captionsDetailsField );
// descriptions
// Description is not required if a campaign provides alternative wikitext fields,
......@@ -77,7 +75,7 @@
mw.UploadWizard.config.fields[ 0 ].wikitext
);
this.descriptionsDetails = new uw.MultipleLanguageInputWidget( {
required: descriptionRequired,
required: false,
// Messages: mwe-upwiz-desc-add-0, mwe-upwiz-desc-add-n
label: mw.message( 'mwe-upwiz-desc-add' ),
error: mw.message( 'mwe-upwiz-error-bad-descriptions' ),
......@@ -86,7 +84,7 @@
maxLength: mw.UploadWizard.config.maxDescriptionLength
} );
this.descriptionsDetailsField = new uw.FieldLayout( this.descriptionsDetails, {
required: descriptionRequired,
required: false,
label: mw.message( 'mwe-upwiz-desc' ).text(),
help: mw.message( 'mwe-upwiz-tooltip-description' ).text()
} );
......@@ -135,7 +133,7 @@
this.$form = $( '<form id="mwe-upwiz-detailsform' + this.upload.index + '"></form>' ).addClass( 'detailsForm' );
this.$form.append(
this.titleDetailsField.$element,
mw.UploadWizard.config.wikibase.enabled ? this.captionsDetailsField.$element : null,
this.captionsDetailsField.$element,
this.descriptionsDetailsField.$element,
this.deedChooserDetailsField.$element,
this.dateDetailsField.$element,
......@@ -743,6 +741,7 @@
// https://commons.wikimedia.org/wiki/Template:Information
// can we be more slick and do this with maps, applys, joins?
information = {
caption: '',
// {{lang|description in lang}}* required
description: '',
// YYYY, YYYY-MM, or YYYY-MM-DD required - use jquery but allow editing, then double check for sane date.
......@@ -757,6 +756,8 @@
'other versions': ''
};
information.caption = this.captionsDetails.getWikiText();
information.description = this.descriptionsDetails.getWikiText();
$.each( this.campaignDetailsFields, function ( i, layout ) {
......
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