Extension:PageTriage

From mediawiki.org
This page is a translated version of the page Extension:PageTriage and the translation is 71% complete.
Outdated translations are marked like this.
Extensión matemática MediaWiki
OOjs UI icon advanced-invert.svg
PageTriage
Estado de lanzamiento estable
PagesFeedInfoFlyout.png
Implementación Página especial , Interfaz de usuario
Descripción Facilita la revisión y aprobación de nuevas páginas
Autor(es) Ryan Kaldari, Benny Situ
Última versión 0.3.0 (2018-06-26)
Política de compatibilidad Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.27+
Cambios de la base de datos
Tablas pagetriage_log
pagetriage_page
pagetriage_page_tags
pagetriage_tags
Licencia MIT Licencia
Descarga
Ejemplo Special:NewPagesFeed on the English Wikipedia
  • $wgPageTriageMaxAge
  • $wgTalkPageNoteTemplate
  • $wgPageTriageStickyStatsNav
  • $wgPageTriageNamespaces
  • $wgPageTriageMarkPatrolledLinkExpiry
  • $wgPageTriageDeletionTagsOptionsMessages
  • $wgPageTriageTagsOptionsMessages
  • $wgPageTriageEnabledEchoEvents
  • $wgPageTriageEnableOresFilters
  • $wgPageTriageInfiniteScrolling
  • $wgPageTriageEnableCopyvio
  • $wgPageTriageProjectLink
  • $wgPageTriageCurationModules
  • $wgPageTriageLearnMoreUrl
  • $wgPageTriageDraftNamespaceId
  • $wgPageTriageDeletionTagsOptionsContentLanguageMessages
  • $wgPageTriageRedirectAutoreviewAge
  • $wgPtTemplatePath
  • $wgPageTriageEnableCurationToolbar
  • $wgPageTriageFeedbackUrl
  • $wgPageTriagePagesPerRequest
  • $wgPageTriageNoIndexUnreviewedNewArticles
  • $wgPageTriageStickyControlNav
Traduce el PageTriage extensión si es disponible en translatewiki.net
Asuntos Tareas abiertas · Reportar un bug

PageTriage es una extensión que tiene como objetivo proporcionar una interfaz rica en funciones para clasificar artículos recién creados. Su objetivo es reemplazar la función principal de patrullaje de páginas nuevas al tiempo que agrega funcionalidad adicional para revisar, etiquetar y mejorar nuevos artículos. Agrega una nueva página a Special:NewPagesFeed y una barra de herramientas de revisión de páginas para páginas nuevas para aquellos con el permiso de verificador. Fue desarrollado por el equipo de desarrolladores de caracteísticas de la Fundación Wikimedia. Para detalles adicionales, véase Revisión de páginas.

Una nota importante es que parte de la configuración y el código son específicos de los flujos de trabajo de Wikipedia en inglés y, como está construido ahora, la extensión es prácticamente imposible de internacionalizar. (Véase Phabricator:T50552.)

Descarga

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/PageTriage/ directory of your MediaWiki installation.

If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageTriage.git

Instalación

  • Descarga y extrae los archivos en un directorio denominado «PageTriage» dentro de la carpeta extensions/.
  • Añade el código siguiente al final de LocalSettings.php :
    wfLoadExtension( 'PageTriage' );
    // These two settings are optional, and will enable the Articles-for-Creation mode.
    $wgExtraNamespaces[118] = 'Draft';
    $wgPageTriageDraftNamespaceId = 118;
    
  • Ejecuta la secuencia de actualización, que creará automáticamente las tablas de la base de datos que necesita esta extensión.
  • Yes Hecho – Navega a Special:Version en el wiki para verificar que la extensión se haya instalado correctamente.

Para quienes usan MediaWiki 1.24 o versiones anteriores:

Estas instrucciones describen la nueva forma de instalar extensiones usando wfLoadExtension(). Si necesitas instalar esta extensión en versiones anteriores (MediaWiki 1.24 y anteriores), debes usar lo siguiente en lugar de wfLoadExtension( 'PageTriage' );:

require_once "$IP/extensions/PageTriage/PageTriage.php";

Para ver la extensión en funcionamiento:

La nueva página debería aparecerSin categorías marcada como "Sin categorías", "Huérfana", etc. Para ver la barra de herramientas de revisión de páginas:

  • Inicie sesión como usuario con el permiso 'sysop', o agregue un grupo con el permiso "patrol", y agregue algún usuario a ese grupo, e inicie sesión como ese usuario.
  • Visita Special:NewPagesFeed
  • Ahora debería ver un botón "Revisar" al lado de la nueva página.
  • Haga clic en esto y debería ver la barra de herramientas de revisión de página en la nueva página.

Configuración de extensión

La extensión se basa en el permiso de "verificador". Para obtener más información sobre la configuración de patrullaje, véase Manual:Patrullaje .

Las siguientes variables de configuración se pueden establecer desde su archivo LocalSettings.php:

Variable Default Description
$wgPageTriageEnableCurationToolbar true Establecer en falso para deshabilitar la barra de herramientas de revisión (el valor predeterminado es verdadero)
$wgPageTriageInfiniteScrolling true Si se usa o no el desplazamiento infinito en el nuevo feed de páginas (el valor predeterminado es verdadero)
$wgPageTriageMaxAge 90 The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true).
$wgPageTriageNamespaces NS_MAIN, NS_USER The namespaces that PageTriage is active in.
$wgPageTriageNoIndexUnreviewedNewArticles false Establezca esto en verdadero si los artículos nuevos no revisados deben establecerse en noindex. En otras palabras, si no deben ser indexados por los motores de búsqueda hasta que sean revisados. (el valor predeterminado es falso)

Véase extension.json para la lista completa de variables de configuración.

Configuración en wiki

Es posible configurar gran parte de PageTriage a nivel de wiki a través de las páginas MediaWiki:PageTriageExternalDeletionTagsOptions.js y MediaWiki:PageTriageExternalTagsOptions.js, aunque la estructura de la configuración puede cambiar en el futuro (para acomodar mejor los wikis además de Wikipedia en inglés).

Puede obtener una idea general de cómo funciona la configuración mirando lo siguiente:

Sección de la barra de herramientas Archivo predeterminado Personalización de Wikipedia en inglés
Curation Bar Icon Add Tags Blue.png Añade funciones de análisis sintáctico modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js en:MediaWiki:PageTriageExternalTagsOptions.js
Curation Bar Icon Trash Blue.png Nominar para borrado modules/ext.pageTriage.defaultDeletionTagsOptions/ext.pageTriage.defaultDeletionTagsOptions.js en:MediaWiki:PageTriageExternalDeletionTagsOptions.js

Ambos archivos funcionan de la misma manera.

Hay dos variables jQuery de nivel superior que definen las plantillas de revisión que se enumeran en la barra de herramientas de revisión debajo de los botones Curation Bar Icon Add Tags Blue.png (agregar etiquetas) y Curation Bar Icon Trash Blue.png (nominar para eliminación). Son:

$.pageTriageTagsOptions = {};
$.pageTriageDeletionTagsOptions = { Main: {}, User: {} };

'(Principal)' y 'Usuario:' se refieren al espacio de nombres de la página que se está revisando. Cada subelemento en los tres conjuntos anteriores define las pestañas que se muestran en el lado izquierdo de la barra de herramientas y tiene la siguiente forma:

{
    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 = {} }
}

Luego, las plantillas reales que se enumeran se definen en la variable etiqueta anterior. Cada plantilla de eliminación tiene la siguiente forma:

{
    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).
}

Por el momento, algunas etiquetas deben estar presentes:

  1. $.pageTriageDeletionTagsOptions.Main.xfd.tags.articlefordeletion

Ejemplo

Entonces, si no desea utilizar ninguna de las plantillas de eliminación integradas (que se pueden importar desde NewPagesFeed_Templates.xml , por cierto), puede reemplazarlos por uno solo agregando lo siguiente en la parte inferior de su página de MediaWiki:PageTriageExternalDeletionTagsOptions.js:

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 } };

Client-side hooks

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:

  • pageidID of the page being reviewed.
  • titleTitle of the page, including namespace.
  • reviewerUsername of who is using PageTriage.
  • creatorUsername of the creator of the page.
  • reviewedWhether or not the page is currently or will be marked as reviewed.

Available actions

  • deleteFired when the reviewer tags a page for deletion. The data given to the handler also includes:
    • tagsAn 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.
  • markFired when the review status of a page is changed. Also includes:
    • noteThe personal message the reviewer added for the creator of the page. This may be blank.
  • tagsFired when maintenance tags are added to the page. Also includes:
    • tagsAn array of the titles of all templates that were added to the page.
    • noteThe personal message the reviewer added for the creator of the page. This may be blank.

Example

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 agrega 5 endpoint de API que se pueden usar:

  • api.php?action=pagetriageaction - Marca una página como revisada o no revisada
  • api.php?action=pagetriagelist - Recupera la lista de páginas en la cola y los metadatos asociados To retrieve one page, you must provide the page_id. To provide multiple pages, you must select one of showreviewed/showunreviewed, and one of showredirs/showdeleted/showothers, or no pages will be returned.
  • api.php?action=pagetriagestats - Recupera estadísticas sobre el número de páginas en la cola y los revisores principales
  • api.php?action=pagetriagetagcopyvio - Mark an article as a potential copyright violation.
  • api.php?action=pagetriagetagging - Agregua etiquetas de limpieza o plantillas de eliminación a una página

Special:Log

The following logs are created by the extension:

Speical:Log log_type log_action Description Notes
Deletion tag log pagetriage-deletion delete Logs deletion tagging
Page curation log pagetriage-curation delete, enqueue, reviewed, tag, unreviewed Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed
Potential copyright violation log pagetriage-copyvio insert Allows a bot to log potential copyright violations Doesn't display unless you set $wgPageTriageEnableCopyvio to true

SQL tables

Name Prefix Description Old entries are...
pagetriage_log ptrl_ Log of all "mark as reviewed", "mark as unreviewed", "patrolled", and "autopatroled" actions. One entry each time the status changes. Used by the pagetriagestats API to figure out who the top patrollers are. All entries deleted after 1 year.
pagetriage_page ptrp_ The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query ptrp_reviewed > 0 in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. All articles deleted once ptrp_reviewed > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 30 days regardless of patrol status.
pagetriage_page_tags ptrpt_ Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the unreferenced tag ID. The tag ID is discovered by checking the pagetriage_tags table.

Examples of page_tags that can be stored for a page include: afc_state, afd_status, blp_prod_status, category_count, copyvio, csd_status, linkcount, page_len, prod_status, recreated, reference, rev_count, snippet, user_autoconfirmed, user_block_status, user_bot, user_creation_date, user_editcount, user_experience, user_id, user_name

All article metadata deleted once ptrp_reviewed > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 30 days regardless of patrol status.
pagetriage_tags ptrt_ A dictionary of the page_tags mentioned above, and their corresponding ID number.

Determining if a page is reviewed

Status codes

There are status codes used to track whether a page is reviewed or not. These are the values given when you query patrol_status, ptrp_reviewed, and ptrl_reviewed:

  • Unreviewed
    • 0 - unreviewed
  • Reviewed
    • 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar)
    • 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page)
    • 3 - autopatrolled (someone with the autopatrol user right created the page, or moved the page from a non-tracked namespace to a tracked namespace)
    • no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job)

Via the API

To check the review status of pages using an API query, you can use api.php?action=pagetriagelist&page_id=$PAGEID, and check the patrol_status field. Follow the directions above to interpret the values of this field.

Sample JavaScript code:

async function isReviewed(pageID) {
	let api = new mw.Api();
	let response = await api.get( {
		action: 'pagetriagelist',
		format: 'json',
		page_id: pageID,
	} );

	// no result
	if ( response.pagetriagelist.result !== 'success' || response.pagetriagelist.pages.length === 0 ) {
		return true;
	// 1, 2, or 3
	} else if ( parseInt(response.pagetriagelist.pages[0].patrol_status) > 0 ) {
		return true;
	// 0
	} else {
		return false;
	}
}

Via SQL

To check the review status of pages using an SQL query, you need to query the pagetriage_page table and the ptrp_reviewed field. Follow the directions above to interpret the values of this field.

/* By page_id */
SELECT ptrp_reviewed
FROM pagetriage_page
WHERE ptrp_page_id = 71318376

/* By page_title and page_namespace */
SELECT ptrp_reviewed
FROM pagetriage_page
JOIN page ON page_id = ptrp_page_id
/* For page_title, don't forget to use underscores instead of spaces. */
WHERE page_title = 'Živko_Kostadinović'
	AND page_namespace = 0

NOINDEX

NOINDEX refers to the HTML code <meta name="robots" content="noindex">, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode __NOINDEX__. When $wgPageTriageNoIndexUnreviewedNewArticles is set to true, PageTriage will take over deciding what pages are indexed.

  • If the wikitext has the __NOINDEX__ magic word, noindex the page if ALL of the following are true:
    • Page age is less than $wgPageTriageMaxAge
    • Page is in pagetriage_page table
  • If the wikitext doesn't have the __NOINDEX__ magic word, noindex the page if ALL of the following are true:
    • $wgPageTriageNoIndexUnreviewedNewArticles is turned on
    • Page age is less than $wgPageTriageMaxAge
    • Page is in pagetriage_page table
    • Page is marked as unpatrolled (ptrp_status = 0)

In regards to the requirement "Page is in pagetriage_page table", there are several ways a for a page to get into this table:

  • Not been deleted by a PageTriage cron job
    • One cron job deletes redirects older than $wgPageTriageRedirectAutoreviewAge days old (default 180 days as of Sep 2022), regardless of patrol status
    • Another cron job deletes reviewed pages after 30 days of being reviewed
  • In a namespace that PageTriage is configured to patrol
  • Isn't an article that is so old it predates the installation of PageTriage

Véase también

Notes