Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | 'code-signoff-struckdate' => '$1 (struck $2)', |
121 | 121 | 'code-pathsearch-legend' => 'Search revisions in this repo by path', |
122 | 122 | 'code-pathsearch-path' => 'Path:', |
123 | | - 'code-pathsearch-filter' => 'Filter applied:', |
| 123 | + 'code-pathsearch-filter' => 'Show only:', |
124 | 124 | 'code-revfilter-cr_status' => 'Status = $1', |
125 | 125 | 'code-revfilter-cr_author' => 'Author = $1', |
126 | 126 | 'code-revfilter-ct_tag' => 'Tag = $1', |
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -221,30 +221,40 @@ |
222 | 222 | * @return string |
223 | 223 | */ |
224 | 224 | function showForm( $pager ) { |
225 | | - global $wgScript; |
| 225 | + global $wgScript, $wgRequest; |
226 | 226 | |
| 227 | + $states = CodeRevision::getPossibleStates(); |
| 228 | + $name = $this->mRepo->getName(); |
| 229 | + |
| 230 | + $title = SpecialPage::getTitleFor( 'Code', $name ); |
| 231 | + $options = array(Xml::option('', $title, $wgRequest->getVal('title') == $title ) ); |
| 232 | + |
| 233 | + |
| 234 | + foreach ($states as $key => $state) { |
| 235 | + $title = SpecialPage::getTitleFor( 'Code', $name . "/status/$state" ); |
| 236 | + $options[] = Xml::option( |
| 237 | + wfMsgHtml( "code-status-".$state ), |
| 238 | + $title, |
| 239 | + $wgRequest->getVal('title') == $title |
| 240 | + ); |
| 241 | + } |
| 242 | + |
227 | 243 | $ret = "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" . |
228 | 244 | '<table width="100%"><tr><td>' . |
229 | 245 | Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
230 | 246 | Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, |
231 | | - $this->getPathsAsString(), array( 'dir' => 'ltr' ) ) . |
| 247 | + $this->getPathsAsString(), array( 'dir' => 'ltr' ) ) . ' ' . |
| 248 | + Xml::label( wfMsg( 'code-pathsearch-filter' ), 'code-status-filter' ) . ' ' . |
| 249 | + Xml::openElement( 'select', array( 'id' => 'code-status-filter', 'name' => 'title' ) ) . |
| 250 | + "\n" . |
| 251 | + implode( "\n", $options ) . |
| 252 | + "\n" . |
| 253 | + Xml::closeElement( 'select' ) . |
232 | 254 | ' ' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
233 | | - $pager->getHiddenFields( array( 'path' ) ) . |
| 255 | + $pager->getHiddenFields( array( 'path', 'title' ) ) . |
234 | 256 | Xml::closeElement( 'form' ) . |
235 | | - '</td>'; |
| 257 | + '</td></tr></table></fieldset>' ; |
236 | 258 | |
237 | | - if ( strlen( $this->mAppliedFilter ) ) { |
238 | | - $ret .= '<td>' . |
239 | | - Xml::openElement( 'form', array( 'action' => $pager->getTitle()->getLocalURL(), 'method' => 'get' ) ) . |
240 | | - Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . ' <strong>' . |
241 | | - Xml::span( $this->mAppliedFilter, '' ) . '</strong> ' . |
242 | | - Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) . |
243 | | - Xml::closeElement( 'form' ) . |
244 | | - '</td>'; |
245 | | - } |
246 | | - |
247 | | - $ret .= "</tr></table></fieldset>" ; |
248 | | - |
249 | 259 | return $ret; |
250 | 260 | } |
251 | 261 | |