Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | * Binds events for each of the controls |
81 | 81 | */ |
82 | 82 | $.articleFeedbackv5special.setBinds = function() { |
83 | | - $( '#articleFeedbackv5-filter' ).bind( 'change', function( e ) { |
| 83 | + $( '#articleFeedbackv5-filter-select' ).bind( 'change', function( e ) { |
84 | 84 | $.articleFeedbackv5special.filter = $(this).val(); |
85 | 85 | $.articleFeedbackv5special.continue = null; |
86 | 86 | $.articleFeedbackv5special.loadFeedback( true ); |
— | — | @@ -93,15 +93,15 @@ |
94 | 94 | $.articleFeedbackv5special.sortDirection = 'desc'; |
95 | 95 | $.articleFeedbackv5special.sort = id; |
96 | 96 | $.articleFeedbackv5special.continue = null; |
97 | | - $.articleFeedbackv5special.loadFeedback( true ); |
98 | 97 | |
99 | 98 | // unless we're flipping the direction on the current sort. |
100 | | -console.log('id is ' + id + ', old id is ' + oldId); |
101 | 99 | if( id == oldId |
102 | 100 | && $.articleFeedbackv5special.sortDirection == 'desc') { |
103 | 101 | $.articleFeedbackv5special.sortDirection = 'asc'; |
104 | 102 | } |
105 | | - // draw arrow |
| 103 | + |
| 104 | + $.articleFeedbackv5special.loadFeedback( true ); |
| 105 | + // draw arrow and load feedback posts |
106 | 106 | $.articleFeedbackv5special.drawSortArrow(); |
107 | 107 | |
108 | 108 | return false; |
— | — | @@ -125,10 +125,13 @@ |
126 | 126 | } ); |
127 | 127 | $( '.articleFeedbackv5-helpful-link' ).live( 'click', function( e ) { |
128 | 128 | $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-helpful-link-' ), 'helpful' ); |
| 129 | + $(this).addClass('active'); |
| 130 | + |
129 | 131 | return false; |
130 | 132 | } ); |
131 | 133 | $( '.articleFeedbackv5-unhelpful-link' ).live( 'click', function( e ) { |
132 | 134 | $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-unhelpful-link-' ), 'unhelpful' ); |
| 135 | + $(this).addClass('active'); |
133 | 136 | return false; |
134 | 137 | } ); |
135 | 138 | } |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | $rows = $dbr->select( |
147 | 147 | array( 'aft_article_feedback', 'aft_article_answer', |
148 | 148 | 'aft_article_field', 'aft_article_field_option', |
149 | | - 'user' |
| 149 | + 'user', 'page' |
150 | 150 | ), |
151 | 151 | array( 'af_id', 'af_bucket_id', 'afi_name', 'afo_name', |
152 | 152 | 'aa_response_text', 'aa_response_boolean', |
— | — | @@ -154,13 +154,17 @@ |
155 | 155 | 'af_user_ip', 'af_hide_count', 'af_abuse_count', |
156 | 156 | 'af_helpful_count', 'af_unhelpful_count', 'af_delete_count', |
157 | 157 | '(SELECT COUNT(*) FROM revision WHERE rev_id > af_revision_id AND rev_page = '.( integer ) $pageId.') AS age', |
158 | | - 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness' |
| 158 | + 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness', |
| 159 | + 'page_latest', 'af_revision_id' |
159 | 160 | ), |
160 | 161 | array( 'af_id' => $ids ), |
161 | 162 | __METHOD__, |
162 | 163 | array( 'ORDER BY' => $order ), |
163 | 164 | array( |
164 | | - 'user' => array( |
| 165 | + 'page' => array( |
| 166 | + 'JOIN', 'page_id = af_page_id' |
| 167 | + ), |
| 168 | + 'user' => array( |
165 | 169 | 'LEFT JOIN', 'user_id = af_user_id' |
166 | 170 | ), |
167 | 171 | 'aft_article_field' => array( |
— | — | @@ -243,6 +247,7 @@ |
244 | 248 | } |
245 | 249 | |
246 | 250 | protected function renderFeedback( $record ) { |
| 251 | + global $wgArticlePath; |
247 | 252 | switch( $record[0]->af_bucket_id ) { |
248 | 253 | case 1: $content .= $this->renderBucket1( $record ); break; |
249 | 254 | case 2: $content .= $this->renderBucket2( $record ); break; |
— | — | @@ -268,19 +273,37 @@ |
269 | 274 | $details = Html::openElement( 'div', array( |
270 | 275 | 'class' => 'articleFeedbackv5-comment-details' |
271 | 276 | ) ) |
272 | | - . Html::element( 'div', array( |
| 277 | + . Html::openElement( 'div', array( |
273 | 278 | 'class' => 'articleFeedbackv5-comment-details-date' |
274 | | - ), date( 'r', $record[0]->af_created ) ) |
275 | | - . Html::openElement( 'div', array( |
276 | | - 'class' => 'articleFeedbackv5-comment-details-permalink' |
277 | | - ) ) |
| 279 | + ) ) |
278 | 280 | .Html::element( 'a', array( |
279 | 281 | 'href' => "#id=$id" |
280 | | - ), wfMessage( 'articlefeedbackv5-comment-link' ) ) |
| 282 | + ), date( 'M j, Y H:i', strtotime($record[0]->af_created) ) ) |
281 | 283 | . Html::closeElement( 'div' ) |
282 | | - . Html::element( 'div', array( |
| 284 | +# Remove for now, pending feedback. |
| 285 | +# . Html::openElement( 'div', array( |
| 286 | +# 'class' => 'articleFeedbackv5-comment-details-permalink' |
| 287 | +# ) ) |
| 288 | +# .Html::element( 'a', array( |
| 289 | +# 'href' => "#id=$id" |
| 290 | +# ), wfMessage( 'articlefeedbackv5-comment-link' ) ) |
| 291 | +# . Html::closeElement( 'div' ) |
| 292 | + |
| 293 | + . Html::openElement( 'div', array( |
283 | 294 | 'class' => 'articleFeedbackv5-comment-details-updates' |
284 | | - ), wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ) ) |
| 295 | + ) ) |
| 296 | + . Linker::link( |
| 297 | + Title::newFromText( 'Greg' ), |
| 298 | + wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ), |
| 299 | + array(), |
| 300 | + array( |
| 301 | + 'action' => 'historysubmit', |
| 302 | + 'diff' => $record[0]->page_latest, |
| 303 | + 'oldid' => $record[0]->af_revision_id |
| 304 | + ) |
| 305 | + ) |
| 306 | +# ), wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ) ) |
| 307 | + . Html::closeElement( 'div' ) |
285 | 308 | . Html::closeElement( 'div' ); |
286 | 309 | ; |
287 | 310 | |
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php |
— | — | @@ -128,7 +128,6 @@ |
129 | 129 | # $out->addWikiMsg( 'articlefeedbackv5-overall-rating', $rating ); |
130 | 130 | # } |
131 | 131 | |
132 | | - $out->addWikiMsg( 'articlefeedbackv5-special-title' ); |
133 | 132 | |
134 | 133 | $out->addJsConfigVars( 'afPageId', $pageId ); |
135 | 134 | $out->addModules( 'jquery.articleFeedbackv5.special' ); |
— | — | @@ -160,7 +159,7 @@ |
161 | 160 | $opts[ (string) $key ] = $filter; |
162 | 161 | } |
163 | 162 | |
164 | | - $filterSelect = new XmlSelect( false, 'articleFeedbackv5-filter' ); |
| 163 | + $filterSelect = new XmlSelect( false, 'articleFeedbackv5-filter-select' ); |
165 | 164 | $filterSelect->addOptions( $opts ); |
166 | 165 | |
167 | 166 | $out->addHTML( |