Index: trunk/extensions/PageTriage/SpecialPageTriage.php |
— | — | @@ -219,7 +219,7 @@ |
220 | 220 | <input type="radio" name="mwe-pt-filter-radio" id="mwe-pt-filter-bot-edits" /> <%= gM( 'pagetriage-filter-bot-edits' ) %> <br/> |
221 | 221 | <input type="radio" name="mwe-pt-filter-radio" id="mwe-pt-filter-user-selected" /> <%= gM( 'pagetriage-filter-user-heading' ) %> |
222 | 222 | <div class="mwe-pt-control-options"> |
223 | | - <span class="mwe-pt-filter-sub-input"><input type=text id="mwe-pt-filter-username" /></span> |
| 223 | + <span class="mwe-pt-filter-sub-input"><input type=text id="mwe-pt-filter-user" /></span> |
224 | 224 | </div> |
225 | 225 | </div> |
226 | 226 | </div> |
Index: trunk/extensions/PageTriage/sql/PageTriagePage.sql |
— | — | @@ -2,8 +2,10 @@ |
3 | 3 | CREATE TABLE /*_*/pagetriage_page ( |
4 | 4 | ptrp_page_id int unsigned NOT NULL PRIMARY KEY, |
5 | 5 | ptrp_reviewed tinyint unsigned not null default 0, |
| 6 | + ptrp_deleted tinyint unsigned not null default 0, |
6 | 7 | ptrp_timestamp varbinary(14) NOT NULL COMMENT 'when the page was created' |
7 | 8 | ) /*$wgDBTableOptions*/; |
8 | 9 | |
9 | | -CREATE INDEX /*i*/ptrp_reviewed_timestamp_page_id ON /*_*/pagetriage_page (ptrp_reviewed, ptrp_timestamp, ptrp_page_id); |
10 | | -CREATE INDEX /*i*/ptrp_timestamp_page_id ON /*_*/pagetriage_page (ptrp_timestamp, ptrp_page_id); |
| 10 | +CREATE INDEX /*i*/ptrp_reviewed_timestamp_page_id ON /*_*/pagetriage_page (ptrp_reviewed, ptrp_timestamp, ptrp_page_id, ptrp_deleted); |
| 11 | +CREATE INDEX /*i*/ptrp_timestamp_page_id ON /*_*/pagetriage_page (ptrp_timestamp, ptrp_page_id, ptrp_deleted); |
| 12 | +CREATE INDEX /*i*/ptrp_deleted_reviewed_etc ON /*_*/pagetriage_page (ptrp_deleted, ptrp_timestamp, ptrp_page_id, ptrp_reviewed); |
Index: trunk/extensions/PageTriage/sql/PageTriagePageDeleted.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +-- temporary patch for devs who don't want to replace their tables. will delete this later. |
| 3 | + |
| 4 | +alter table pagetriage_page add ptrp_deleted tinyint unsigned not null default 0 after ptrp_reviewed; |
| 5 | +alter table pagetriage_page drop index /*i*/ptrp_reviewed_timestamp_page_id; |
| 6 | +alter table pagetriage_page drop index /*i*/ptrp_timestamp_page_id; |
| 7 | + |
| 8 | +CREATE INDEX /*i*/ptrp_reviewed_timestamp_page_id ON /*_*/pagetriage_page (ptrp_reviewed, ptrp_timestamp, ptrp_page_id, ptrp_deleted); |
| 9 | +CREATE INDEX /*i*/ptrp_deleted_reviewed_etc ON /*_*/pagetriage_page (ptrp_deleted, ptrp_timestamp, ptrp_page_id, ptrp_reviewed); |
| 10 | +CREATE INDEX /*i*/ptrp_timestamp_page_id ON /*_*/pagetriage_page (ptrp_timestamp, ptrp_page_id, ptrp_deleted); |
Property changes on: trunk/extensions/PageTriage/sql/PageTriagePageDeleted.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 11 | + native |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listControlNav.js |
— | — | @@ -140,11 +140,9 @@ |
141 | 141 | apiParams['showreviewed'] = '1'; |
142 | 142 | } |
143 | 143 | |
144 | | - /* |
145 | 144 | if( $('#mwe-pt-filter-nominated-for-deletion').prop('checked') ) { |
146 | | - apiParams[''] = '1'; |
| 145 | + apiParams['showdeleted'] = '1'; |
147 | 146 | } |
148 | | - */ |
149 | 147 | |
150 | 148 | if( $('#mwe-pt-filter-bot-edits').prop('checked') ) { |
151 | 149 | apiParams['showbots'] = '1'; |
— | — | @@ -153,13 +151,12 @@ |
154 | 152 | if( $('#mwe-pt-filter-redirects').prop('checked') ) { |
155 | 153 | apiParams['showredirs'] = '1'; |
156 | 154 | } |
| 155 | + |
| 156 | + if( $('#mwe-pt-filter-user-selected').prop('checked') && $('#mwe-pt-filter-user').val() ) { |
| 157 | + apiParams['username'] = $('#mwe-pt-filter-user').val(); |
| 158 | + } |
157 | 159 | |
158 | | - /* |
159 | | - api doesn't support these. |
160 | | - if( $('#mwe-pt-filter-user').val() ) { |
161 | | - apiParams[''] = $('#mwe-pt-filter-user').val(); |
162 | | - } |
163 | | - |
| 160 | + /* api doesn't support this yet |
164 | 161 | if( $('#mwe-pt-filter-tag').val() ) { |
165 | 162 | apiParams[''] = $('#mwe-pt-filter-tag').val(); |
166 | 163 | } |
— | — | @@ -210,13 +207,18 @@ |
211 | 208 | } |
212 | 209 | |
213 | 210 | this.menuCheckboxUpdate( $( '#mwe-pt-filter-reviewed-edits' ), 'showreviewed', 'pagetriage-filter-stat-reviewed'); |
214 | | - // api doesn't suppor this one. |
215 | | - //this.menuCheckboxUpdate( $( '#mwe-pt-filter-nominated-for-deletion' ' ), '', ''); |
| 211 | + this.menuCheckboxUpdate( $( '#mwe-pt-filter-nominated-for-deletion' ), 'showdeleted', 'pagetriage-filter-stat-nominated-for-deletion'); |
216 | 212 | this.menuCheckboxUpdate( $( '#mwe-pt-filter-bot-edits' ), 'showbots', 'pagetriage-filter-stat-bots'); |
217 | 213 | this.menuCheckboxUpdate( $( '#mwe-pt-filter-redirects' ), 'showredirs', 'pagetriage-filter-stat-redirects'); |
218 | 214 | |
219 | | - /* api doesn't support these |
220 | | - $( '#mwe-pt-filter-user' ).val( this.model.getParam('') ); |
| 215 | + var username = this.model.getParam( 'username' ); |
| 216 | + if( username ) { |
| 217 | + this.newFilterStatus.push( gM( 'pagetriage-filter-stat-username', username ) ); |
| 218 | + $( '#mwe-pt-filter-user-selected' ).prop( 'checked', true ); |
| 219 | + } |
| 220 | + $( '#mwe-pt-filter-user' ).val( username ); |
| 221 | + |
| 222 | + /* api doesn't support this |
221 | 223 | $( '#mwe-pt-filter-tag' ).val( this.model.getParam('') ); |
222 | 224 | */ |
223 | 225 | |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.models/ext.pageTriage.article.js |
— | — | @@ -63,11 +63,11 @@ |
64 | 64 | initialize: function( options ) { |
65 | 65 | this.eventBus = options.eventBus; |
66 | 66 | this.eventBus.bind( "filterSet", this.setParams ); |
67 | | - //this.eventBus.bind( "paramsSet", this.fetch ); |
68 | 67 | }, |
69 | 68 | |
70 | 69 | url: function() { |
71 | 70 | var url = mw.util.wikiScript( 'api' ) + '?action=pagetriagelist&format=json&' + $.param( this.apiParams ); |
| 71 | + console.log( 'fetch url: ' + url ); |
72 | 72 | return url; |
73 | 73 | }, |
74 | 74 | |
Index: trunk/extensions/PageTriage/api/ApiPageTriageList.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | // Start building the massive filter which includes meta data |
59 | 59 | $tables = array( 'pagetriage_page', 'page' ); |
60 | 60 | $conds = array( 'ptrp_page_id = page_id' ); |
61 | | - |
| 61 | + |
62 | 62 | // Include reviewed |
63 | 63 | if ( !$opts['showreviewed'] ) { |
64 | 64 | $conds['ptrp_reviewed'] = 0; |
— | — | @@ -66,6 +66,10 @@ |
67 | 67 | if ( !$opts['showredirs'] ) { |
68 | 68 | $conds['page_is_redirect'] = 0; |
69 | 69 | } |
| 70 | + // Include marked for deletion |
| 71 | + if ( !$opts['showdeleted'] ) { |
| 72 | + $conds['ptrp_deleted'] = 0; |
| 73 | + } |
70 | 74 | // Show by namespace |
71 | 75 | if ( array_key_exists( 'namespace', $opts ) ) { |
72 | 76 | $conds['page_namespace'] = $opts['namespace']; |
— | — | @@ -117,7 +121,7 @@ |
118 | 122 | // bots |
119 | 123 | 'showbots' => array( 'name' => 'user_bot', 'op' => '=', 'val' => '1' ), |
120 | 124 | // user name |
121 | | - 'username' => array( 'name' => 'user_name', 'op' => '=', 'val' => $opts['username'] ) |
| 125 | + 'username' => array( 'name' => 'user_name', 'op' => '=', 'val' => false ) // false means use the actual value |
122 | 126 | ); |
123 | 127 | |
124 | 128 | $tags = ArticleMetadata::getValidTags(); |
— | — | @@ -125,8 +129,14 @@ |
126 | 130 | // only single tag search is allowed |
127 | 131 | foreach ( $searchableTags as $key => $val ) { |
128 | 132 | if ( $opts[$key] ) { |
129 | | - $tagConds = " ptrpt_page_id = ptrp_page_id AND ptrpt_tag_id = '" . $tags[$val['name']] . "' AND |
130 | | - ptrpt_value " . $val['op'] . " " . $dbr->addQuotes( $val['val'] ); |
| 133 | + if( $val['val'] === false ) { |
| 134 | + // if val is false, use the value that was supplied via the api call |
| 135 | + $tagConds = " ptrpt_page_id = ptrp_page_id AND ptrpt_tag_id = '" . $tags[$val['name']] . "' AND |
| 136 | + ptrpt_value " . $val['op'] . " " . $dbr->addQuotes( $opts['key'] ); |
| 137 | + } else { |
| 138 | + $tagConds = " ptrpt_page_id = ptrp_page_id AND ptrpt_tag_id = '" . $tags[$val['name']] . "' AND |
| 139 | + ptrpt_value " . $val['op'] . " " . $dbr->addQuotes( $val['val'] ); |
| 140 | + } |
131 | 141 | break; |
132 | 142 | } |
133 | 143 | } |
Index: trunk/extensions/PageTriage/PageTriage.i18n.php |
— | — | @@ -62,13 +62,15 @@ |
63 | 63 | 'pagetriage-more' => 'More', |
64 | 64 | 'pagetriage-filter-stat-all' => 'All', |
65 | 65 | 'pagetriage-filter-stat-namespace' => 'Namespace: $1', |
66 | | - 'pagetriage-filter-stat-reviewed' => 'Reviewed', |
| 66 | + 'pagetriage-filter-stat-reviewed' => 'Include reviewed', |
67 | 67 | 'pagetriage-filter-stat-bots' => 'Bots', |
68 | | - 'pagetriage-filter-stat-redirects' => 'Redirects', |
| 68 | + 'pagetriage-filter-stat-redirects' => 'Include redirects', |
| 69 | + 'pagetriage-filter-stat-nominated-for-deletion' => 'Include deleted', |
69 | 70 | 'pagetriage-filter-stat-no-categories' => 'No categories', |
70 | 71 | 'pagetriage-filter-stat-orphan' => 'Orphans', |
71 | 72 | 'pagetriage-filter-stat-non-autoconfirmed' => 'New editors', |
72 | 73 | 'pagetriage-filter-stat-blocked' => 'Blocked users', |
| 74 | + 'pagetriage-filter-stat-username' => 'Username: $1', |
73 | 75 | |
74 | 76 | ); |
75 | 77 | |
— | — | @@ -127,10 +129,12 @@ |
128 | 130 | 'pagetriage-filter-stat-reviewed' => 'Status display component for reviewed pages', |
129 | 131 | 'pagetriage-filter-stat-bots' => 'Status display component for bot-created pages', |
130 | 132 | 'pagetriage-filter-stat-redirects' => 'Status display component for redirects', |
| 133 | + 'pagetriage-filter-stat-nominated-for-deletion' => 'Status dispay component for articles nominated for deletion', |
131 | 134 | 'pagetriage-filter-stat-no-categories' => 'Status display component for articles with no categories', |
132 | 135 | 'pagetriage-filter-stat-orphan' => 'Status display component for orphan articles', |
133 | 136 | 'pagetriage-filter-stat-non-autoconfirmed' => 'Status display component for articles by non-autoconfirmed editors', |
134 | 137 | 'pagetriage-filter-stat-blocked' => 'Status display component for articles by blocked users', |
| 138 | + 'pagetriage-filter-stat-username' => 'Status display component for filter by username. $1 is the username.', |
135 | 139 | |
136 | 140 | |
137 | 141 | |
Index: trunk/extensions/PageTriage/PageTriage.php |
— | — | @@ -258,6 +258,7 @@ |
259 | 259 | 'pagetriage-filter-stat-reviewed', |
260 | 260 | 'pagetriage-filter-stat-bots', |
261 | 261 | 'pagetriage-filter-stat-redirects', |
| 262 | + 'pagetriage-filter-stat-nominated-for-deletion', |
262 | 263 | 'pagetriage-filter-stat-all', |
263 | 264 | 'pagetriage-filter-stat-no-categories', |
264 | 265 | 'pagetriage-filter-stat-orphan', |