Extension:PageTriage
![]() État de la version : stable |
|
---|---|
![]() |
|
Implémentation | Page spéciale , Interface utilisateur |
Description | Facilite la révision et l'approbation des nouvelles pages |
Auteur(s) | Ryan Kaldari, Benny Situ |
Dernière version | 0.3.0 (2018-06-26) |
Politique de compatibilité | Versions ponctuelles alignées avec MediaWiki. Le master n'est pas compatible arrière. |
MediaWiki | 1.27+ |
Modifie la base de données |
Oui |
Tables | pagetriage_log pagetriage_page pagetriage_page_tags pagetriage_tags |
Licence | Licence MIT |
Téléchargement | |
Exemple | Special:NewPagesFeed on the English Wikipedia |
|
|
|
|
|
|
Traduire l’extension PageTriage sur translatewiki.net si elle y est disponible | |
Problèmes | Tâches ouvertes · Signaler un bogue |
PageTriage est une extension qui vise à fournir une interface riche en fonctionnalités pour trier les articles nouvellement créés. Il est destiné à remplacer la fonction principale « nouvelle patrouille de page » tout en ajoutant des fonctionnalités supplémentaires pour la révision, le balisage et l'amélioration de nouveaux articles. It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission. It was developed by the Wikimedia Foundation's Features Engineering team. Pour les détails supplémentaires voir Page Curation.
An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalize. (Voir Phabricator:T50552.)
Téléchargement
Cette extension peut être récupérée directement depuis Git [?]:
- Naviguer dans le code
- Certaines extensions étiquettent les versions stables.
- Naviguer dans les Étiquettes
- Sélectionner l'étiquette
- Cliquer sur snapshot (instantané)
- Chaque branche correspond à une version antérieure de MediaWiki. Il y a aussi une branche master (maître) qui contient la dernière version alpha (elle peut nécessiter une version alpha de MediaWiki)
- Naviguer dans les branches
- Sélectionnez le nom d'une branche
- Cliquez sur « Continuer »
Décompressez l'instantané et placez-le dans le répertoire extensions/PageTriage/ de votre installation MediaWiki.
Si vous êtes familier de Git et si vous avez un accès au shell de votre serveur, vous pouvez aussi obtenir l'extension de la manière suivante:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageTriage.git
Installation
- Téléchargez et placez le(s) fichiers (s) dans un répertoire appelé
PageTriage
dans votre dossierextensions/
. - Ajoutez le code suivant à la fin de votre fichier LocalSettings.php :
wfLoadExtension( 'PageTriage' ); // These two settings are optional, and will enable the Articles-for-Creation mode. $wgExtraNamespaces[118] = 'Draft'; $wgPageTriageDraftNamespaceId = 118;
- Exécutez le script de mise à jour qui va créer automatiquement les tables de base de données dont cette extension a besoin.
- Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.
Pour les utilisateurs de MediaWiki 1.24 ou précédents :
Les instructions ci-dessus décrivent la nouvelle procédure pour installer cette extension en utilisant wfLoadExtension()
.
Si vous avez besoin d'installer cette extension sur les précédentes versions de MediaWiki (1.24 ou antérieur), à la place de wfLoadExtension( 'PageTriage' );
, vous devez utiliser :
require_once "$IP/extensions/PageTriage/PageTriage.php";
To actually see the extension working:
- Add a new stub page as an anonymous user.
- Visitez Special:NewPagesFeed (Fil des nouvelles pages)
La nouvelle page devrait apparaître, marquée comme « Aucune catégorie », « Orpheline », etc. To see the page curation toolbar:
- Login as a user with the 'sysop' permission, or add a group with the "patrol" permission, and add some user to that group, and login as that user.
- Visit Special:NewPagesFeed
- Now you should see a "Relecture" button next to the new page.
- Click this and you should see the page curation toolbar on the new page.
Configuration de l'extension
The extension is based on the 'patrol' right. For more information about configuring patrolling, see Patrouillage .
The following configuration variables can be set from your LocalSettings.php file:
- $wgPageTriageEnableCurationToolbar: Set to false to disable the curation toolbar (default is true)
- $wgPageTriageInfiniteScrolling: Whether or not to use infinite scrolling in the new pages feed (default is true)
- $wgPageTriageNoIndexUnreviewedNewArticles: Set this to true if new, unreviewed articles should be set to noindex. In other words, if they should not be indexed by search engines until they are reviewed. (default is false)
- $wgPageTriageMaxAge: The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true) (default is 90).
- $wgPageTriageNamespaces: The namespaces that PageTriage is active in. (default is NS_MAIN and NS_USER).
Voir extension.json pour la liste complète des variables de configuration.
Configuration sur le wiki
It is possible to configure much of PageTriage on-wiki via the pages MediaWiki:PageTriageExternalDeletionTagsOptions.js
and MediaWiki:PageTriageExternalTagsOptions.js
, although the structure of the configuration may change in the future (to better accommodate wikis besides English Wikipedia).
You can get a general idea of how the configuration works by looking at the following:
Section de la boîte à outils | Fichier par défaut | Personnalisation de la Wikipédia en anglais |
---|---|---|
Ajouter des balises | modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js | en:MediaWiki:PageTriageExternalTagsOptions.js |
Marquer à supprimer | modules/ext.pageTriage.defaultDeletionTagsOptions/ext.pageTriage.defaultDeletionTagsOptions.js | en:MediaWiki:PageTriageExternalDeletionTagsOptions.js |
Both of these files operate in much the same way.
There are two top-level jQuery variables that define the curation templates that are listed in the curation toolbar under the (add tags) and (nominate for deletion) buttons. Ce sont :
$.pageTriageTagsOptions = {};
$.pageTriageDeletionTagsOptions = { Main: {}, User: {} };
The 'Main' and 'User' refer to the namespace of the page being curated. Each sub-item in the three sets above defines the tabs shown at the left side of the toolbar, and has the following form:
{
label: 'Short title',
desc: 'A longer description.', // Text only, no HTML or Wikitext markup
multiple: false, // Whether more than one of the tags can selected at once.
tags: { tag1 = {}, tag2 = {} }
}
Then the actual templates that are listed are defined under the above tags
variable. Each deletion template has the following form:
{
tag: 'Actual_template_name', // Without the 'Template:' prefix.
label: 'Friendly template title',
desc: 'A longer description.', // Text only, no HTML or Wikitext markup
code: '',
params: {},
anchor: '',
talkpagenotiftopictitle: 'message-name', // The message name (e.g. pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title) used as the section/topic title when posting to the editing user's talk page. Usually, you can reuse one of the existing messages (currently pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title, pagetriage-del-tags-prod-notify-topic-title, pagetriage-del-tags-xfd-notify-topic-title). If you need a new one, file a task so $wgPageTriageDeletionTagsOptionsContentLanguageMessages or the PageTriage repository can be updated.
talkpagenotiftpl: 'Template_name' // The template that will be added to the editing user's talk page, not including the talk page heading (handled by talkpagenotiftopictitle).
}
At the moment, some tags must be present:
$.pageTriageDeletionTagsOptions.Main.xfd.tags.articlefordeletion
Exemple
So, if you don't want to use any of the built-in deletion templates (which can be imported from NewPagesFeed_Templates.xml, by the way) then you can replace them all with a single one by adding the following at the bottom of your MediaWiki:PageTriageExternalDeletionTagsOptions.js
page:
var deletionSection = {
label: 'Deletion',
desc: 'Nominate for deletion.',
multiple: false,
tags: {
articlefordeletion: {
tag: 'delete',
label: 'Delete',
desc: 'Nominate this page for deletion.',
code: '',
params: {},
anchor: '',
talkpagenotiftopictitle: 'pagetriage-del-tags-xfd-notify-topic-title',
talkpagenotiftpl: 'Deletion notification'
}
}
};
$.pageTriageDeletionTagsOptions = { Main: { xfd: deletionSection }, User: { xfd: deletionSection } };
Accroches côté client
PageTriage provides a specialized action queue system to allow other scripts and gadgets to integrate with it. This is similar to mw.hook
except that it uses promises. This is done using the mw.pageTriage.actionQueue
module. See the comments in the source code for documentation on how the system works.
The actionQueue module is available after the mw.hook ext.pageTriage.toolbar.ready
fires.
PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:
pageid
— ID de la page en cours de révision.title
— Titre de la page, y compris l'espace de noms.reviewer
— Username of who is using PageTriage.creator
— Username of the creator of the page.reviewed
— Whether or not the page is currently or will be marked as reviewed.
Actions disponibles
delete
— Fired when the reviewer tags a page for deletion. The data given to the handler also includes:tags
— An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.
mark
— Fired when the review status of a page is changed. Also includes:note
— The personal message the reviewer added for the creator of the page. This may be blank.
tags
— Fired when maintenance tags are added to the page. Also includes:tags
— An array of the titles of all templates that were added to the page.note
— The personal message the reviewer added for the creator of the page. This may be blank.
Exemple
To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit Sandbox after a page has been marked as reviewed, you could use:
$( function () {
// You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time.
mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) {
// Listen for the 'mark' action.
queue.add( 'mark', function ( data ) {
return new mw.Api().edit( 'Sandbox', function ( revision ) {
// Replace 'foo' with the note the reviewer left.
return revision.content.replace( 'foo', data.note );
} );
} );
} );
} );
API
PageTriage adds 5 API endpoints which can be used:
api.php?action=pagetriagestats
- Retrieves stats about the number of pages in the queue and the top reviewersapi.php?action=pagetriagelist
- Retrieves the list of pages in the queue and associated metadataapi.php?action=pagetriageaction
- Mark a page as reviewed or unreviewedapi.php?action=pagetriagetagging
- Add clean-up tags or deletion templates to a pageapi.php?action=pagetriagetemplate
- Internal API for fetching Backbone templates for use in the JS application
To check if a page has recently been marked as reviewed using an API query, you can use api.php?action=pagetriagelist&page_id=$PAGEID
. The patrol_status
field indicates whether the page is unreviewed (0), reviewed (1), patrolled (2), or autopatrolled (3). Log entries are kept, but pagetriagelist data is removed from the database after one year.
Voir aussi
Cette extension est utilisée par au moins un des projets Wikimédia. Cela signifie probablement que l’extension est assez stable et fonctionnelle pour être utilisée sur des sites à fort trafic. Recherchez le nom de cette extension dans le CommonSettings.php de Wikimédia et dans le fichier de configuration InitialiseSettings.php pour situer les endroits où elle est installée. Une liste complète des extensions installées sur un Wiki donné peut être visualisée sur la page Special:Version de ce wiki. |