Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag: {{R to scientific name}}: add support for picking type #1878

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions modules/friendlytag.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,28 @@ Twinkle.tag.redirectList = {
{ tag: 'R from gene symbol', description: 'redirect from a Human Genome Organisation (HUGO) symbol for a gene to an article about the gene', restriction: 'insideMainspaceOnly' }
],
Organisms: [
{ tag: 'R to scientific name', description: 'redirect from the common name to the scientific name', restriction: 'insideMainspaceOnly' },
{ tag: 'R from scientific name', description: 'redirect from the scientific name to the common name', restriction: 'insideMainspaceOnly' },
{
tag: 'R to scientific name',
description: 'redirect from the common name to the scientific name',
subgroup: {
name: 'toScientificName',
type: 'input',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we do this as a drop-down list instead? https://en.wikipedia.org/wiki/Drop-down_list

the morebits library probably has something like this, although it may be called something else.

can the drop-down list preload these values? https://en.wikipedia.org/wiki/Template:R_to_scientific_name#Usage

label: 'Type of organism',
tooltip: 'Specify more precisely the type of organism involved, to put the article in the appropriate subcategory. For example, fungus'
},
restriction: 'insideMainspaceOnly'
},
{
tag: 'R from scientific name',
description: 'redirect from the scientific name to the common name',
subgroup: {
name: 'fromScientificName',
type: 'input',
label: 'Type of organism',
tooltip: 'Specify more precisely the type of organism involved, to put the article in the appropriate subcategory. For example, fungus'
},
restriction: 'insideMainspaceOnly'
},
{ tag: 'R from alternative scientific name', description: 'redirect from an alternative scientific name to the accepted scientific name', restriction: 'insideMainspaceOnly' },
{ tag: 'R from scientific abbreviation', description: 'redirect from a scientific abbreviation', restriction: 'insideMainspaceOnly' },
{ tag: 'R to monotypic taxon', description: 'redirect from the only lower-ranking member of a monotypic taxon to its monotypic taxon', restriction: 'insideMainspaceOnly' },
Expand Down Expand Up @@ -1821,6 +1841,10 @@ Twinkle.tag.callbacks = {
}
} else if (tagName === 'R avoided double redirect' && params.doubleRedirectTarget) {
tagText += '|1=' + params.doubleRedirectTarget;
} else if (tagName === 'R to scientific name' && params.toScientificName) {
tagText += '|1=' + params.toScientificName;
} else if (tagName === 'R from scientific name' && params.fromScientificName) {
tagText += '|1=' + params.fromScientificName;
}
tagText += '}}';

Expand Down
Loading