Skip to content
Open
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
33 changes: 33 additions & 0 deletions webserver/html/ropewiki/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,23 @@
$wgActionPaths[ $action ] = "/$1/$action";
}

// Add a "Request Rename" option in the action menu
$wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skin, &$links ) {
$user = $skin->getUser();
$title = $skin->getTitle();
// Only for logged-in users on main namespace pages
if ( $user->isRegistered() && $title->getNamespace() === NS_MAIN ) {
$links['actions']['request-rename'] = [
'text' => 'Request rename',
'href' => 'Request_Rename',
Copy link
Member

Choose a reason for hiding this comment

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

We should certainly populate this page with something before deploying this change. I think the content of that page can initially be whatever we would tell people today -- "make a request on Facebook" sounds good, though this exists as well probably worth linking to. I think its value is more for transparency (showing people how the system works rather than making it a black box that only special elite people are allowed to touch) than practicality since I don't expect many people to pursue the manual renaming route.

My idiosyncratic nit is that I don't like Title Case for things that aren't proper-noun names so I would prefer Request_rename, though the rational side of my brain tells me I should accept either capitalization :) I mention it here to satisfy the other part of my brain.

'id' => 'ca-request-rename',
'class' => false,
];
}

return true;
};

// Replace page history & source tabs for anonymous visitors
// This doesn't block going directly to the pages, the next code block does that.
$wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skin, &$links ) {
Expand Down Expand Up @@ -349,3 +366,19 @@
}
return true;
};

// Add a "Request Rename" option in the action menu
$wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skin, &$links ) {
$user = $skin->getUser();
$title = $skin->getTitle();
// Only for logged-in users on main namespace pages
if ( $user->isRegistered() && $title->getNamespace() === NS_MAIN ) {
$links['actions']['request-rename'] = [
'text' => 'Request rename',
'href' => 'Request_Rename',
'id' => 'ca-request-rename',
'class' => false,
];
}
return true;
};