Content deleted Content added
Updating published sources: PERTableUpdater: * Update for category rename. |
Updating published sources: PERTableUpdater: * Use classes rather than hard-coding colors, so the specific colors can be determined by community consensus and can be overridden by individual editors. |
||
Line 31:
@ISA=qw/AnomieBOT::Task/;
my %protact=(
'modify' => 'Modified',
Line 169 ⟶ 163:
# Fields are:
# 0: Namespaces to color
# 1: "Tag", also used in the name of the subpage the table is put on
# 2: Category name, no prefix
Line 175 ⟶ 169:
# 4: URL fragment for request links
# 5: NID component of the urn links
# 6: List of
# 0: unprotected
# 1: semi-protected
Line 189 ⟶ 183:
# 11: MediaWiki-namespace CSS/JS page
my @data=(
[[10,828],'PER','Wikipedia fully-protected edit requests','protected','editprotected','x-wp-editprotected',[qw/
[[10,828],'TPER','Wikipedia template-protected edit requests','template-protected','edittemplateprotected','x-wp-edittemplateprotected',[qw/
[[10,828],'EPER','Wikipedia extended-confirmed-protected edit requests','extended-confirmed-protected','editextendedprotected','x-wp-editextendedprotected',[qw/
[[10,828],'SPER','Wikipedia semi-protected edit requests','semi-protected','editsemiprotected','x-wp-editsemiprotected',[qw/
[[],'IPER','Wikipedia interface-protected edit requests','interface-protected','editinterfaceprotected','x-wp-editinterfaceprotected',[qw/
[[0],'EDITREQ','Wikipedia requested edits','COI','requestedit','x-wp-requestedit',[qw/
);
my $starttime=time;
for my $data (@data){
my ($
my $iter=$api->iterator(
generator => 'categorymembers',
Line 364 ⟶ 358:
$pd->{'color'}=$colors->[10] if($protscore & 0x4000);
$pd->{'color'}=$colors->[11] if($protscore & 0x8000);
$pd->{'color'}='
if($pd->{'reason'} eq ''){
Line 410 ⟶ 404:
my $txt = qq(<noinclude>{{User:AnomieBOT/PERTableHeader}}</noinclude>\n);
$txt.=qq(<div class="veblenbot-pertable">\n);
$txt.=qq(<templatestyles src="Template:Edit_fully-protected/color_legend/styles.css"/>\n);
$txt.=qq({| class="wikitable" style="padding:0em"\n);
$txt.=qq(|-\n);
Line 424 ⟶ 419:
$txt.=qq(! class = "unsortable" | Last protection log entry\n);
for my $p (sort { my $x = $a->{'touched'} <=> $b->{'touched'}; $x = $a->{'title'} cmp $b->{'title'} if $x == 0; return $x; } @pages){
my $c=
my $t=$p->{'title'};
my $et=encodetitle($p->{'logtitle'});
Line 430 ⟶ 425:
my $pt=$p->{'prottype'};
my $r=$p->{'reason'};
$txt.=qq(|- class="protectededit-legend-$c"\n);
$txt.=qq(| [[:$t]] ([[$tt#$tgt|request]])\n);
$txt.=strftime("| %F %H:%M\n", gmtime $p->{'touched'});
|