Display indicators for required parameters in template dialog

Update submodule for changes in OOUI (I1c047b55c7a0d5cf3e0aa0cc3f9a4da7d45c0304)

Change-Id: I8f84a9ae277e5093356f591f7a56e8cebf4a1893
This commit is contained in:
Trevor Parscal 2014-01-14 11:16:49 -08:00 committed by Roan Kattouw
parent 66d2d3da54
commit c8f7845def
5 changed files with 22 additions and 1 deletions

View file

@ -669,6 +669,7 @@ $wgResourceModules += array(
'visualeditor-dialog-transclusion-remove-content',
'visualeditor-dialog-transclusion-remove-param',
'visualeditor-dialog-transclusion-remove-template',
'visualeditor-dialog-transclusion-required-parameter',
'visualeditor-dialog-transclusion-title',
'visualeditor-dialog-transclusion-wikitext-label',
'visualeditor-dialogbutton-media-tooltip',

View file

@ -26,6 +26,17 @@ ve.dm.MWTemplateParameterModel = function VeDmMWTemplateParameterModel( template
/* Methods */
/**
* Check if parameter is required.
*
* @method
* @param {string} name Parameter name
* @returns {boolean} Parameter is required
*/
ve.dm.MWTemplateParameterModel.prototype.isRequired = function () {
return this.template.getSpec().isParameterRequired( this.name );
};
/**
* Get template parameter is part of.
*

View file

@ -83,6 +83,7 @@
"visualeditor-dialog-transclusion-remove-content": "Remove content",
"visualeditor-dialog-transclusion-remove-param": "Remove parameter",
"visualeditor-dialog-transclusion-remove-template": "Remove template",
"visualeditor-dialog-transclusion-required-parameter": "Required parameter",
"visualeditor-dialog-transclusion-title": "Transclusion",
"visualeditor-dialogbutton-media-tooltip": "Media",
"visualeditor-dialogbutton-meta-tooltip": "Page settings",

View file

@ -88,6 +88,7 @@
"visualeditor-dialog-transclusion-remove-content": "Label for button that removes content between transclusion parts",
"visualeditor-dialog-transclusion-remove-param": "Label for button that removes a parameter from a template",
"visualeditor-dialog-transclusion-remove-template": "Label for button that removes a template from a transclusion.\n{{Identical|Remove template}}",
"visualeditor-dialog-transclusion-required-parameter": "Tooltip for required parameter indicator",
"visualeditor-dialog-transclusion-title": "{{Identical|Transclusion}}",
"visualeditor-dialogbutton-media-tooltip": "{{Identical|Media}}",
"visualeditor-dialogbutton-meta-tooltip": "{{Identical|Page settings}}",

View file

@ -18,7 +18,14 @@
*/
ve.ui.MWTemplateParameterPage = function VeUiMWTemplateParameter( parameter, name, config ) {
// Configuration initialization
config = ve.extendObject( { 'icon': 'parameter', 'movable': false, 'level': 1 }, config );
config = ve.extendObject(
parameter.isRequired() ? {
'indicator': 'required',
'indicatorLabel': ve.msg( 'visualeditor-dialog-transclusion-required-parameter' )
} : {},
{ 'icon': 'parameter', 'movable': false, 'level': 1 },
config
);
// Parent constructor
OO.ui.PageLayout.call( this, name, config );