diff --git a/src/modules/submissions.js b/src/modules/submissions.js index 52440da..c1d5589 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 @@ -2216,6 +2220,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 ); @@ -2325,6 +2335,10 @@ ' WikiProject banner' + ( ( wikiProjectsToRemove.length === 1 ) ? '' : 's' ); } + if ( 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 d824a8c..cb219b4 100644 --- a/src/templates/tpl-submissions.html +++ b/src/templates/tpl-submissions.html @@ -120,6 +120,11 @@ +
+ + +
+