From c40dc94c37308f9ab132017ecf3d64024bd9564c Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Tue, 1 Oct 2024 13:58:33 +0200 Subject: [PATCH] Separate sub-ref content from main content in ContextItem Bug: T376131 Change-Id: I859298746cf85b75cc27192c1e1c9c136312beea --- modules/ve-cite/i18n/en.json | 2 +- modules/ve-cite/ve.ui.MWReferenceContextItem.js | 9 ++++++--- modules/ve-cite/ve.ui.MWReferenceContextItem.less | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/ve-cite/i18n/en.json b/modules/ve-cite/i18n/en.json index bc13a3524..eb9bddae5 100644 --- a/modules/ve-cite/i18n/en.json +++ b/modules/ve-cite/i18n/en.json @@ -34,7 +34,7 @@ "cite-ve-citationneeded-description": "An editor has indicated that this claim needs a citation to a reliable source.", "cite-ve-citationneeded-reason": "Reason given:", "cite-ve-citationneeded-title": "Citation needed", - "cite-ve-dialog-reference-contextitem-extends": "This reference is a re-use with additional details.", + "cite-ve-dialog-reference-contextitem-extends": "This reference is a re-use with additional details:", "cite-ve-dialog-reference-editing-add-details": "You're adding additional details to this reference:", "cite-ve-dialog-reference-editing-add-details-placeholder": "Write or paste the information you would like to add to this reference here.", "cite-ve-dialog-reference-editing-reused": "This reference is used {{PLURAL:$1|once|2=twice|$1 times}} on this page.", diff --git a/modules/ve-cite/ve.ui.MWReferenceContextItem.js b/modules/ve-cite/ve.ui.MWReferenceContextItem.js index 0c1eeab66..45973bcab 100644 --- a/modules/ve-cite/ve.ui.MWReferenceContextItem.js +++ b/modules/ve-cite/ve.ui.MWReferenceContextItem.js @@ -93,7 +93,10 @@ ve.ui.MWReferenceContextItem.prototype.getReuseWarning = function () { ve.ui.MWReferenceContextItem.prototype.getExtendsWarning = function () { if ( this.model.getAttribute( 'extendsRef' ) ) { return $( '
' ) - .addClass( 've-ui-mwReferenceContextItem-muted' ) + .addClass( [ + 've-ui-mwReferenceContextItem-muted', + 've-ui-mwReferenceContextItemSubNote' + ] ) .text( ve.msg( 'cite-ve-dialog-reference-contextitem-extends' ) ); } }; @@ -155,9 +158,9 @@ ve.ui.MWReferenceContextItem.prototype.setup = function () { ve.ui.MWReferenceContextItem.prototype.renderBody = function () { this.$body.empty().append( this.getParentRef(), + this.getExtendsWarning(), this.getRendering(), - this.getReuseWarning(), - this.getExtendsWarning() + this.getReuseWarning() ); }; diff --git a/modules/ve-cite/ve.ui.MWReferenceContextItem.less b/modules/ve-cite/ve.ui.MWReferenceContextItem.less index 4e5e7b6ff..30847d2e0 100644 --- a/modules/ve-cite/ve.ui.MWReferenceContextItem.less +++ b/modules/ve-cite/ve.ui.MWReferenceContextItem.less @@ -23,5 +23,9 @@ + .ve-ui-mwReferenceContextItem-muted { margin-top: 0.5em; } + + + .ve-ui-mwReferenceContextItemSubNote { + margin-bottom: 0.5em; + } } }