diff --git a/src/modules/submissions.js b/src/modules/submissions.js index 48ec26d6..8b5f9f8a 100644 --- a/src/modules/submissions.js +++ b/src/modules/submissions.js @@ -622,6 +622,10 @@ this.text = this.text.replace( /^\s*/, '' ); }; + AFCH.Text.prototype.getAfcComments = function () { + return this.text.match( /\{\{\s*afc comment[\s\S]+?\(UTC\)\}\}/gi ); + }; + AFCH.Text.prototype.removeAfcTemplates = function () { // FIXME: Awful regex to remove the old submission templates // This is bad. It works for most cases but has a hellish time @@ -2210,6 +2214,12 @@ // ARTICLE // ------- + // get comments left by reviewers to put on talk page + var comments = []; + if ( data.copyComments ) { + comments = newText.getAfcComments(); + } + newText.removeAfcTemplates(); newText.updateCategories( data.newCategories ); @@ -2324,6 +2334,10 @@ ' WikiProject banner' + ( ( wikiProjectsToRemove.length === 1 ) ? '' : 's' ); } + if ( comments && comments.length > 0 ) { + talkText += '== Comments left by AfC reviewers ==\n' + comments.join( '\n\n' ); + } + talkPage.edit( { contents: talkText, summary: summary diff --git a/src/templates/tpl-submissions.html b/src/templates/tpl-submissions.html index 031bc9e1..80a34d2d 100644 --- a/src/templates/tpl-submissions.html +++ b/src/templates/tpl-submissions.html @@ -120,6 +120,11 @@ +
+ + +
+