User:Novem Linguae/Scripts/GANReviewTool

Quickly and easily close good article nominations and good article reassessments. Takes care of atoping the discussion, changing talk page templates, changing article templates, and adding/removing the article from one of the WP:GA subpages.

Installation
Go install User:Enterprisey/script-installer, then come back to this page and click the giant blue "Install" button in the infobox on the right.

Or install it manually by adding the below code to your Special:MyPage/common.js file.

Bugs and feature requests
Your feedback is essential. Please report all bugs and feature requests on the talk page.

This user script keeps a log that I monitor. I silently catch and fix a lot of bugs by looking at diffs in the log. I no longer check every diff, but if the script shows you a red "error" message, I will get a ping and I will investigate.

To-do list

 * Features
 * select2 smart combo box for picking the GA subpage
 * Should merge additional templates into Article history
 * Failed GA
 * OTD - example
 * ITN
 * DYK
 * Rearrange Article history to group parameters like this
 * Always place Article history instead of the GA or Failed GA templates?
 * Bugs
 * Should change WikiProject template with importance parameters but no class parameters to include |class=GA
 * When the MOS:TALKORDER of the page is wrong, err on the side of placing GA higher
 * Should handle nested templates, e.g. . Look into MediaWiki:Gadget-libExtraUtil.js or Parsoid API for parsing.
 * Should template parameter escape the GAR/result reason parameter

How to use
Visit a GAN review page. Page title must be in the format "Talk:Page/GA##". There must be no atop template currently on the GAN review page. Associated talk page must have the GA nominee template. If these conditions are met, the script will display.

You choose whether it passes or fails, then click submit.

Algorithm
Displaying the user script uses the following algorithm:


 * Page must end in /GA#
 * No Atop (in other words, not already closed)
 * Talk page must have GA nominee

Passes use the following algorithm:
 * Add atopg to the nomination page
 * Delete GA nominee
 * Add GA or add an entry to Article history
 * Change WikiProject template class parameters to GA
 * Add the article to the appropriate WP:GA subpage
 * Create a log entry

Fails use the following algorithm:
 * Add atopr to the nomination page
 * Delete GA nominee
 * Add FailedGA or add an entry to Article history
 * Create a log entry

http errors
If you get an "http" error while submitting, it means there was a problem with the internet connection during the multi-step submission process, and some of the steps did not get completed. In this situation, you should double check GANReviewTool's work, and fix any missing steps.

If you don't do this, the folks over at Good articles/mismatches will probably catch and fix it in about a week. But it's good to not create a mess.

How to use
Visit a GAR reassessment page. GANReviewTool needs the following to detect the page as a valid GAR and to show the GARCloser panel: If these conditions are met, the script will display the GARCloser panel. If you can't get GARCloser to run on the page, please make sure all the above criteria are met.
 * GAR reassessment page title must be in the format "Talk:Page/GA##" or "Wikipedia:Good article reassessment/ABC".
 * There must be no atop template currently on the GAR reassessment page.
 * Individual reassessments (not community reassessments) must contain
 * Article talk page must have the GAR/link template.

For "Wikipedia:Good article reassessment/ABC" style pages, you must visit the subpage. The GARCloser panel does not appear on the index page Good article reassessment.