Matěj Suchánek has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/390629 )
Change subject: Add form field to filter history by filter
......................................................................
Add form field to filter history by filter
So that users have no longer to modify the URL.
Links like "Special:AbuseFilter/history/1" will still
work but request parameters have higher priority.
Change-Id: I2d8c26d3350fdd4052b68c7bced10e3fae859d18
---
M i18n/en.json
M i18n/qqq.json
M includes/Views/AbuseFilterViewHistory.php
3 files changed, 12 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter
refs/changes/29/390629/1
diff --git a/i18n/en.json b/i18n/en.json
index df36d71..5408567 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -318,6 +318,7 @@
"abusefilter-history-filterid": "Filter",
"abusefilter-history-select-legend": "Refine search",
"abusefilter-history-select-user": "User:",
+ "abusefilter-history-select-filter": "Filter ID:",
"abusefilter-history-select-submit": "Refine",
"abusefilter-history-diff": "Changes",
"abusefilter-history-error-hidden": "The filter you requested is
hidden, and you cannot view its history.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 38f17c2..63f10e5 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -349,6 +349,7 @@
"abusefilter-history-filterid": "{{Identical|Filter}}",
"abusefilter-history-select-legend": "Used as legend on
[[Special:AbuseFilter/history]]",
"abusefilter-history-select-user": "Used as label for the \"User\"
input box. Field takes a username to filter events by.\n{{Identical|User}}",
+ "abusefilter-history-select-filter": "Used as label for the \"Filter
ID\" input box. Field takes a filter id to filter events by.",
"abusefilter-history-select-submit": "Used as submit button on
[[Special:AbuseFilter/history]]",
"abusefilter-history-diff": "{{Identical|Change}}",
"abusefilter-history-error-hidden": "Error message shown to user if the
filter they are trying to view is hidden and they do not have permission to
view it.",
diff --git a/includes/Views/AbuseFilterViewHistory.php
b/includes/Views/AbuseFilterViewHistory.php
index 8b9abbb..32f44c9 100644
--- a/includes/Views/AbuseFilterViewHistory.php
+++ b/includes/Views/AbuseFilterViewHistory.php
@@ -8,7 +8,7 @@
function show() {
$out = $this->getOutput();
- $filter = $this->mFilter;
+ $filter = $this->getRequest()->getText( 'filter' ) ?:
$this->mFilter;
if ( $filter ) {
$out->setPageTitle( $this->msg( 'abusefilter-history',
$filter ) );
@@ -59,13 +59,20 @@
'default' => $user,
'size' => '45',
'label-message' =>
'abusefilter-history-select-user'
- ]
+ ],
+ 'filter' => [
+ 'type' => 'text',
+ 'name' => 'filter',
+ 'default' => $filter,
+ 'size' => '45',
+ 'label-message' =>
'abusefilter-history-select-filter'
+ ],
];
$htmlForm = HTMLForm::factory( 'table', $formDescriptor,
$this->getContext() );
$htmlForm->setSubmitTextMsg(
'abusefilter-history-select-submit' )
->setWrapperLegendMsg(
'abusefilter-history-select-legend' )
- ->setAction( $this->getTitle( "history/$filter"
)->getLocalURL() )
+ ->setAction( $this->getTitle( 'history'
)->getLocalURL() )
->setMethod( 'get' )
->prepareForm()
->displayForm( false );
--
To view, visit https://gerrit.wikimedia.org/r/390629
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d8c26d3350fdd4052b68c7bced10e3fae859d18
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits