Open main menu

User:Evad37/rater

< User:Evad37
Rater
Description Helps assess pages for WikiProjects
Author Evad37
Status Beta
Updated See history
Skin support
  • Vector
  • Monobook
  • Modern
  • Cologne Blue
  • Timeless
  • MinervaNeue
Source

Rater (source) helps fill in assessments and other parameters for WikiProject banners. Find it in the same menu as "Move" (for moving a page) – this is the "More" dropdown menu on the default Vector skin. Rater is available from either the page itself or its talk page, in all namespaces, apart from Special pages and base User and User talk pages (but is still available for userspace drafts in subpages).

Contents

InstallationEdit

To install the script, add the line:

importScript('User:Evad37/rater.js'); // [[User:Evad37/rater]]

to Special:MyPage/common.js.

Autostart settingEdit

You can automatically bring up the rater for pages without any WikiProject banners, for specified namespaces. For mainspace, also add the following line to Special:MyPage/common.js.

rater_autostartNamespaces = 0;

For a different namespace, lookup the namespace number, and use that number instead of 0.

  • For example, Category namespace is number 14, so you would instead add the line rater_autostartNamespaces = 14;

Multiple namespaces can be specified by using comma-separated numbers within square brackets ([ ]).

  • For example, to use in File (6), Template (10), and Portal (100) namespaces, you would instead add the line rater_autostartNamespaces = [6, 10, 100];

To turn off autostart, remove the whole rater_autostartNamespaces line from Special:MyPage/common.js.

FeaturesEdit

For each banner:

  •   Remove a banner template
  •   Clear parameters for a banner template (e.g. if a page has become a redirect or disambiguation page)
  •   Bypass redirects (e.g. turn {{MILHIST|...}} into {{WikiProject Military history|...}} or wrappers
  • Set class and importance from a dropdown selection menus.
    Non-standard rating such as Future class and Bottom importance will be available iff the banner supports them.
  • For WikiProject Biography, |listas= is automatically filled based on the page title
    Autofill is noted in display, in case the normal last, first other+ pattern isn't suitable
  • Edit parameter values
  •   Remove a parameter
  •   Add a parameter
    Parameter suggestions are available as you type, if there is TemplateData on the template documentation
  • Parameter display depends on whether the TemplateData has been set up (see § TemplateData quick tutorial below)
    • If there is no TemplateData, or no label defined, the parameter name is shown in code formatting
    • If there is a label, that label is shown (in normal formatting) with a tooltip displaying the parameter name
    • If there is also a description, that is also shown in the label's tooltip

Other actions:

  •   Add a new banner template
    Project suggestions are available as you type, based on Category:WikiProject banners with quality assessment
  •   Remove all banner templates
  •   Clear parameters for all banner templates
  •   Bypass all redirects and wrappers
  •   Set class/importance for all banners (standard ratings only)

After making changes, you can show a preview, show a diff, or just save the changes. If not already present, the {{WikiProject banner shell}} template is automatically added when there are three or more banners.

TemplateData quick tutorialEdit

TemplateData stores template/parameter information in a machine-readable format, for use by VisualEditor and other tools. Rater uses this TemplateData to provide parameter suggestions.

 
Popup window that appears after clicking "Manage TemplateData" button
 
Screen for entering detailed information for a parameter

To quickly set up TemplateData for a template:

  1. Edit the template's documentation, and click the Manage TemplateData button near the top of the page
  2. In the popup window, under Template parameters, click the "Add ## suggested parameters" button
  3. (Optional) For each parameter, click on it to fill in detailed information for that parameter (see below)
  4. Click the Apply button – the <templatedata>...</templatedata> block is inserted into the edit window
  5. (Recommended) Add {{TemplateData header}} above the <templatedata> line
  6. Save the page

Tips:

  • You may need to null edit the template itself after adding or modifying TemplateData
  • You can collapse the TemplateData so that it doesn't overwhelm the documentation page:
    • Add {{cot|TemplateData}} above the <templatedata> line and {{cob}} below the </templatedata> line
  • Add {{Cleanup TemplateData}} if the TemplateData is crude, incomplete, or otherwise in need of cleanup

Detailed information for parametersEdit

For each parameter listed under Template parameters, you enter click on it to add further details about that parameter. Rater uses the following fields:

Aliases
Alternative parameter names that are exactly equivalent.
Rater will recognise aliases, but save to the default parameter name.
Label
Human-readable title for the parameter.
Rater will display the label instead of the parameter name, which will instead be shown in a tooltip.
Description
Description of the specific parameter; can include usage instructions; must be plain text ([[wikilinks]], '''bold''', etc will not work).
Rater will show the description in the label's tooltip.
Autovalue
Standard value to pre-fill the parameter with.
Rater will prefill manually-added parameters with this vaue.
Required
Filling out the parameter is mandatory for all uses of this template.
Rater will always show this parameter.
Suggested
Most users of the template will probably want to fill it in.
Rater will show this parameter when the banner is initially loaded or added.
Allowed values – this feature is missing from TemplateData, see phab:T53375. The following will work for Rater (but not other tools such as VisualEditor):
Set of available values for a parameter. Must be a well-formed array:
  • Starting with [
  • Then a comma-separated list of values, each within single quotation marks
  • Ending with ]
(e.g. ['Value1', 'Value2', 'Value3'])
Must be placed in the Description field.
Example: Priority for Task Force X. Set to one of: ['low', 'mid', 'high', 'top']
Rater will show a checkbox or dropdown menu instead of a text input:
  • Single value – Checkbox (checked = set to that value; unchecked = do not set parameter)
  • Two values – Checkbox (checked = set to first value; unchecked = set to second value)
  • More than two values – Dropdown menu

See alsoEdit