r109258 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109257‎ | r109258 | r109259 >
Date:00:23, 18 January 2012
Author:gregchiasson
Status:resolved (Comments)
Tags:aft 
Comment:
AFT5 - more HTML chanes
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -60,6 +60,8 @@
6161 'articlefeedbackv5-special-filter-label-before' => 'Show only:',
6262 'articlefeedbackv5-special-filter-label-after' => '',
6363 'articlefeedbackv5-special-showing' => '$1 feedback posts on this page', // FIXME: Needs plural support on $1.
 64+ 'articleFeedbackv5-link' => 'Permanent link',
 65+ 'articleFeedbackv5-updates-since' => '$1 Edits since post',
6466 'articlefeedbackv5-special-more' => 'More',
6567 'articlefeedbackv5-special-pagetitle' => 'Feedback: $1',
6668
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -207,12 +207,31 @@
208208 $can_delete = 1;
209209 $id = $record[0]->af_id;
210210
211 - $header_links = Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-head' ) )
212 - . Html::element( 'a', array( 'class' => 'articleFeedbackv5-comment-name', 'href' => 'profilepage or whatever' ), $id )
213 - . Html::element( 'span', array( 'class' => 'articleFeedbackv5-comment-timestamp' ), $record[0]->af_created )
214 - . wfMessage( 'articlefeedbackv5-form-optionid', $record[0]->af_bucket_id )->escaped()
215 - . Html::closeElement( 'p' );
 211+# $header_links = Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-head' ) )
 212+# . Html::element( 'a', array( 'class' => 'articleFeedbackv5-comment-name', 'href' => 'profilepage or whatever' ), $id )
 213+# . Html::openElement( 'div', array(
 214+# . Html::element( 'span', array( 'class' => 'articleFeedbackv5-comment-timestamp' ), $record[0]->af_created )
 215+# . wfMessage( 'articlefeedbackv5-form-optionid', $record[0]->af_bucket_id )->escaped()
 216+# . Html::closeElement( 'p' );
216217
 218+ $details = Html::openElement( 'div', array(
 219+ 'class' => 'articleFeedbackv5-comment-details'
 220+ ) )
 221+ . Html::element( 'div', array(
 222+ 'class' => 'articleFeedbackv5-comment-details-date'
 223+ ), date( 'r', $record[0]->af_created ) )
 224+ . Html::openElement( 'div', array(
 225+ 'class' => 'articleFeedbackv5-comment-details-permalink'
 226+ ) )
 227+ .Html::element( 'a', array(
 228+ 'href' => '#'
 229+ ), wfMessage( 'articlefeedbackv5-comment-link' ) )
 230+ . Html::closeElement( 'div' )
 231+ . Html::element( 'div', array(
 232+ 'class' => 'articleFeedbackv5-comment-details-updates'
 233+ ), wfMessage( 'articleFeedbackv5-updates-since', 0 ) );
 234+;
 235+
217236 $footer_links = Html::openElement( 'p', array( 'class' => 'articleFeedbackv5-comment-foot' ) )
218237 . Html::openElement( 'ul' )
219238 . ( $can_upvote ? Html::rawElement( 'li', array(), Html::element( 'a', array(
@@ -247,9 +266,10 @@
248267
249268 # TODO: permalinks
250269 return Html::openElement( 'div', array( 'class' => 'articleFeedbackv5-feedback' ) )
251 - . $tools
252270 . $header_links
253271 . $content
 272+ . $details
 273+ . $tools
254274 . $footer_links
255275 . $rate
256276 . Html::closeElement( 'div' );
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -159,7 +159,9 @@
160160 'articlefeedbackv5-abuse-saved',
161161 'articlefeedbackv5-hide-saved',
162162 'articlefeedbackv5-delete-saved',
163 - 'articlefeedbackv5-helpful-saved'
 163+ 'articlefeedbackv5-helpful-saved',
 164+ 'articlefeedbackv5-comment-link'
 165+
164166 ),
165167 ),
166168 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r109262AFT5 - followup to r109258 - bad HTML, should be fixed now.gregchiasson00:28, 18 January 2012
r110070ATF5 - fix issues from r109258 (not calling text() on messages) - one of the ...gregchiasson19:56, 26 January 2012

Comments

#Comment by Raymond (talk | contribs)   08:24, 18 January 2012

Value for $1 is 0 always?

+		), wfMessage( 'articleFeedbackv5-updates-since', 0 ) );

Otherwise the message 'articleFeedbackv5-updates-since' needs PLURAL.

#Comment by Catrope (talk | contribs)   01:37, 26 January 2012
+		), date( 'r', $record[0]->af_created ) )

You can also use our core functions here: wfTimestamp( TS_RFC2822, $record[0]->af_created ) .

+		), wfMessage( 'articlefeedbackv5-comment-link' ) )
[...]
+		), wfMessage( 'articleFeedbackv5-updates-since', 0 ) );

Don't use implicit stringification of Message objects, actually call ->text() or ->plain() here, whichever one you need.

OK otherwise.

Status & tagging log