Open main menu
This page is a translated version of the page Extension:PageTriage and the translation is 43% complete.

Other languages:
English • ‎dansk • ‎español • ‎français • ‎português do Brasil • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
PageTriage
发布状态: 稳定版
PagesFeedInfoFlyout.png
实现 Special page , User interface
描述 Facilitates reviewing and approving new pages
作者 Ryan Kaldari, Benny Situ
最新版本 0.3.0 (2018-06-26)
兼容性方针 发行分支
MediaWiki 1.27+ . PageTriage master should only be used with core's master; otherwise, use matching branches (e.g. PageTriage REL1_27 with core REL1_27, or matching WMF release branches).
数据更新
许可协议 MIT License
下载
例子 Special:NewPagesFeed on the English Wikipedia
  • $wgPageTriageCacheVersion
  • $wgPageTriageCurationModules
  • $wgPageTriageDeletionTagsOptionsContentLanguageMessages
  • $wgPageTriageDeletionTagsOptionsMessages
  • $wgPageTriageDraftNamespaceId
  • $wgPageTriageEnableCurationToolbar
  • $wgPageTriageEnabledEchoEvents
  • $wgPageTriageFeedbackUrl
  • $wgPageTriageInfiniteScrolling
  • $wgPageTriageLearnMoreUrl
  • $wgPageTriageMarkPatrolledLinkExpiry
  • $wgPageTriageMaxAge
  • $wgPageTriageNamespaces
  • $wgPageTriageNoIndexTemplates
  • $wgPageTriageNoIndexUnreviewedNewArticles
  • $wgPageTriagePagesPerRequest
  • $wgPageTriageProjectLink
  • $wgPageTriageStickyControlNav
  • $wgPageTriageStickyStatsNav
  • $wgPtTemplatePathPageTriageTagsOptionsMessages
  • $wgTalkPageNoteTemplate
翻译PageTriage扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

PageTriage is an extension that aims to provide a feature-rich interface for triaging newly-created articles. It is intended to replace the new page patrol core function while adding additional functionality for reviewing, tagging, and improving new 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. 额外的详细信息参见页面屏模

重要提醒:部分配置和代码专用于英语维基百科的工作流,并使扩展目前几乎不可能国际化。 (参见Phabricator:T50552。)

Contents

下载

此扩展可直接从Git检索到 [?]:

  • 浏览代码
  • 部分扩展有稳定版本标签。
  • 每个分支与过去的MediaWiki发布版本相关联。 这里也有一个“主线”分支,包含最新alpha版本(可能需要MediaWiki的alpha版本)。

提取快照,并将它放置在您的MediaWiki安装副本的extensions/PageTriage/目录中。

如果您对git熟悉,并且拥有您服务器的shell访问权,您也可以通过以下方法获得扩展:

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

安装

  • 下载文件,并将其放置在您extensions/文件夹中的PageTriage目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'PageTriage' );
    // These two settings are optional, and will enable the Articles-for-Creation mode.
    $wgExtraNamespaces[118] = 'Draft';
    $wgPageTriageDraftNamespaceId = 118;
    
  • 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'PageTriage' );,您需要使用:

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

To actually see the extension working:

The new page should appear, flagged as "无分类", "孤立", 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.
  • 访问Special:NewPagesFeed
  • Now you should see a "巡查" button next to the new page.
  • Click this and you should see the page curation toolbar on the new page.

扩展配置

The extension is based on the 'patrol' right. For more information about configuring patrolling, see 手册:巡查 .

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

有关配置变量的完整列表,请参阅extension.json

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

通过查看以下内容,您可以大致了解配置的工作原理:

Toolbar section 默认文件 英语维基百科定制
  添加标签 modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js en:MediaWiki:PageTriageExternalTagsOptions.js
  提请删除 modules/ext.pageTriage.defaultDeletionTagsOptions/ext.pageTriage.defaultDeletionTagsOptions.js en:MediaWiki:PageTriageExternalDeletionTagsOptions.js

这两个文件的运行方式大致相同。

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. 这些是:

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

目前,有些标签必须存在:

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

示例

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


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 reviewers
  • api.php?action=pagetriagelist - Retrieves the list of pages in the queue and associated metadata
  • api.php?action=pagetriageaction - Mark a page as reviewed or unreviewed
  • api.php?action=pagetriagetagging - Add clean-up tags or deletion templates to a page
  • api.php?action=pagetriagetemplate - Internal API for fetching Backbone templates for use in the JS application

参见