mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Switch plain links to OOUI buttons in /history and diffs"
This commit is contained in:
commit
fce4b4c305
|
@ -12,19 +12,29 @@ class AbuseFilterViewDiff extends AbuseFilterView {
|
|||
public function show() {
|
||||
$show = $this->loadData();
|
||||
$out = $this->getOutput();
|
||||
$out->enableOOUI();
|
||||
|
||||
$links = [];
|
||||
if ( $this->mFilter ) {
|
||||
$links['abusefilter-history-backedit'] = $this->getTitle( $this->mFilter );
|
||||
$links['abusefilter-diff-backhistory'] = $this->getTitle( 'history/' . $this->mFilter );
|
||||
$links['abusefilter-history-backedit'] =
|
||||
$this->getTitle( $this->mFilter )->getFullURL();
|
||||
$links['abusefilter-diff-backhistory'] =
|
||||
$this->getTitle( 'history/' . $this->mFilter )->getFullURL();
|
||||
}
|
||||
|
||||
foreach ( $links as $msg => $title ) {
|
||||
$links[$msg] = $this->linkRenderer->makeLink( $title, $this->msg( $msg )->text() );
|
||||
foreach ( $links as $msg => $href ) {
|
||||
$links[$msg] =
|
||||
new OOUI\ButtonWidget( [
|
||||
'label' => $this->msg( $msg )->text(),
|
||||
'href' => $href
|
||||
] );
|
||||
}
|
||||
|
||||
$backlinks = $this->getLanguage()->pipeList( $links );
|
||||
$out->addHTML( Xml::tags( 'p', null, $backlinks ) );
|
||||
$backlinks =
|
||||
new OOUI\HorizontalLayout( [
|
||||
'items' => $links
|
||||
] );
|
||||
$out->addHTML( $backlinks );
|
||||
|
||||
if ( $show ) {
|
||||
$out->addHTML( $this->formatDiff() );
|
||||
|
|
|
@ -15,6 +15,7 @@ class AbuseFilterViewHistory extends AbuseFilterView {
|
|||
*/
|
||||
public function show() {
|
||||
$out = $this->getOutput();
|
||||
$out->enableOOUI();
|
||||
$filter = $this->getRequest()->getText( 'filter' ) ?: $this->mFilter;
|
||||
|
||||
if ( $filter ) {
|
||||
|
@ -34,18 +35,22 @@ class AbuseFilterViewHistory extends AbuseFilterView {
|
|||
// Useful links
|
||||
$links = [];
|
||||
if ( $filter ) {
|
||||
$links['abusefilter-history-backedit'] = $this->getTitle( $filter );
|
||||
$links['abusefilter-history-backedit'] = $this->getTitle( $filter )->getFullURL();
|
||||
}
|
||||
|
||||
foreach ( $links as $msg => $title ) {
|
||||
$links[$msg] = $this->linkRenderer->makeLink(
|
||||
$title,
|
||||
new HtmlArmor( $this->msg( $msg )->parse() )
|
||||
);
|
||||
$links[$msg] =
|
||||
new OOUI\ButtonWidget( [
|
||||
'label' => $this->msg( $msg )->parse(),
|
||||
'href' => $title
|
||||
] );
|
||||
}
|
||||
|
||||
$backlinks = $this->getLanguage()->pipeList( $links );
|
||||
$out->addHTML( Xml::tags( 'p', null, $backlinks ) );
|
||||
$backlinks =
|
||||
new OOUI\HorizontalLayout( [
|
||||
'items' => $links
|
||||
] );
|
||||
$out->addHTML( $backlinks );
|
||||
|
||||
// For user
|
||||
$user = User::getCanonicalName( $this->getRequest()->getText( 'user' ), 'valid' );
|
||||
|
|
Loading…
Reference in a new issue