diff --git a/extension.json b/extension.json index ff37869e25..a194c1e9aa 100644 --- a/extension.json +++ b/extension.json @@ -1678,6 +1678,7 @@ "visualeditor-dialog-transclusion-deprecated-parameter", "visualeditor-dialog-transclusion-deprecated-parameter-description", "visualeditor-dialog-transclusion-loading", + "visualeditor-dialog-transclusion-more-template-description", "visualeditor-dialog-transclusion-multiple-mode", "visualeditor-dialog-transclusion-no-template-description", "visualeditor-dialog-transclusion-options", diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json index ba917856ae..805e055f93 100644 --- a/modules/ve-mw/i18n/en.json +++ b/modules/ve-mw/i18n/en.json @@ -200,6 +200,7 @@ "visualeditor-dialog-transclusion-deprecated-parameter": "Deprecated field", "visualeditor-dialog-transclusion-deprecated-parameter-description": "Field is deprecated. $1", "visualeditor-dialog-transclusion-loading": "Loading...", + "visualeditor-dialog-transclusion-more-template-description": "There might be some additional information about the \"$1\" template on [[{{ns:template}}:$1|its page]].", "visualeditor-dialog-transclusion-multiple-mode": "Show options", "visualeditor-dialog-transclusion-no-template-description": "The \"$1\" template doesn't yet have a description, but there might be some information on the [[$1|template's page]].", "visualeditor-dialog-transclusion-options": "Options", diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json index c0e95fa704..993f354738 100644 --- a/modules/ve-mw/i18n/qqq.json +++ b/modules/ve-mw/i18n/qqq.json @@ -213,6 +213,7 @@ "visualeditor-dialog-transclusion-deprecated-parameter": "Tooltip for deprecated parameter indicator", "visualeditor-dialog-transclusion-deprecated-parameter-description": "Label describing that a parameter is deprecated.\n\nParameters:\n* $1 - Description given in TemplateData for why parameter is deprecated, which may be empty.", "visualeditor-dialog-transclusion-loading": "Title for the transclusion dialog while its contents are loading.\n{{Identical|Loading}}", + "visualeditor-dialog-transclusion-more-template-description": "Message to user that additional template information might be available for a template.\n\nParameters:\n* $1 - the title of the template", "visualeditor-dialog-transclusion-multiple-mode": "Label for button that shows advanced options in transclusion dialog", "visualeditor-dialog-transclusion-no-template-description": "Message to user that no template information is available for the template.\n\nParameters:\n* $1 - the title of the template", "visualeditor-dialog-transclusion-options": "Label for section with options for templates, content or parameters.\n{{Identical|Options}}", diff --git a/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js b/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js index ead9b61eaf..b7d293aecb 100644 --- a/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js +++ b/modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js @@ -17,7 +17,7 @@ * @param {Object} [config] Configuration options */ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) { - var title; + var title = template.getTitle() ? mw.Title.newFromText( template.getTitle() ) : null; // Configuration initialization config = ve.extendObject( { @@ -56,14 +56,21 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) { this.$description.addClass( 've-ui-mwTemplatePage-description' ); if ( this.spec.getDescription() ) { this.$description.text( this.spec.getDescription() ); + if ( title ) { + this.$description.append( + $( '
' ), + $( '' ) + .addClass( 've-ui-mwTemplatePage-description-extra' ) + .html( mw.message( + 'visualeditor-dialog-transclusion-more-template-description', + title.getRelativeText( mw.config.get( 'wgNamespaceIds' ).template ) + ).parse() ) + ); + } } else { - title = this.template.getTitle(); // The transcluded page may be dynamically generated or unspecified in the DOM // for other reasons (bug 66724). In that case we can't tell the user what // the template is called nor link to the template page. - if ( title ) { - title = mw.Title.newFromText( title ); - } if ( title ) { this.$description .addClass( 've-ui-mwTemplatePage-description-missing' ) diff --git a/modules/ve-mw/ui/themes/default/pages/ve.ui.MWTemplatePage.css b/modules/ve-mw/ui/themes/default/pages/ve.ui.MWTemplatePage.css index 4bb9a0fce0..8781d166ed 100644 --- a/modules/ve-mw/ui/themes/default/pages/ve.ui.MWTemplatePage.css +++ b/modules/ve-mw/ui/themes/default/pages/ve.ui.MWTemplatePage.css @@ -18,6 +18,7 @@ color: #555; } +.ve-ui-mwTemplatePage-description-extra, .ve-ui-mwTemplatePage-description-missing { font-style: italic; }