r25383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25382‎ | r25383 | r25384 >
Date:23:32, 31 August 2007
Author:david
Status:old
Tags:
Comment:
Fixed HTML/CSS bug that made history look wrong. Also ripped out the temporarily unused history pager.
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtPages.php (modified) (history)
  • /branches/liquidthreads/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: branches/liquidthreads/skins/monobook/main.css
@@ -185,8 +185,9 @@
186186 /* display: none;*/
187187 }
188188
189 -.lqt_thread_changed_by_history .lqt_post {
190 - padding: .5em 1.5em .5em 1.5em;
 189+.lqt_post_changed_by_history {
 190+/* padding: .5em 1.5em .5em 1.5em;*/
 191+ padding: 0.5em 1em;
191192 background-color: #eeeeee;
192193 border: solid 1pt #ffaa66;
193194 display: table; width: auto;
Index: branches/liquidthreads/extensions/LqtPages.php
@@ -516,99 +516,8 @@
517517 }
518518 }
519519
520 -/**
521 - * @addtogroup Pager
522 - */
523 -class ThreadHistoryPager extends PageHistoryPager {
524 - protected $thread;
525 -
526 - function __construct( $thread ) {
527 - // mPageHistory = this in the PageHistoryPager methods now.
528 - parent::__construct($this);
529 - $this->thread = $thread;
530 - }
531520
532 - function getQueryInfo() {
533 - return array(
534 - 'tables' => 'historical_thread',
535 - 'fields' => 'hthread_id, hthread_revision, hthread_contents, hthread_change_type, hthread_change_object',
536 - 'conds' => array('hthread_id' => $this->thread->id() ),
537 - 'options' => array()
538 - );
539 - }
540521
541 - function getIndexField() {
542 - return 'hthread_revision';
543 - }
544 -
545 - /**
546 - * Returns a row from the history printout.
547 - *
548 - * @param object $row The database row corresponding to the line (or is it the previous line?).
549 - * @param object $next The database row corresponding to the next line (or is it this one?).
550 - * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
551 - * @param $notificationtimestamp
552 - * @param bool $latest Whether this row corresponds to the page's latest revision.
553 - * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
554 - * @return string HTML output for the row
555 - */
556 - function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
557 -
558 - $hthread = HistoricalThread::fromTextRepresentation($row->hthread_contents);
559 - return $this->rowForThread($hthread);
560 - }
561 -
562 - private function rowForThread($t) {
563 - global $wgLang, $wgOut; // TODO global.
564 -
565 - /* TODO: best not to refer to LqtView class directly. */
566 - /* We don't use oldid because that has side-effects. */
567 - $result = array();
568 - $change_names = array(Threads::CHANGE_EDITED_ROOT => "Comment text edited:",
569 - Threads::CHANGE_EDITED_SUMMARY => "Summary changed:",
570 - Threads::CHANGE_REPLY_CREATED => "New reply created:",
571 - Threads::CHANGE_NEW_THREAD => "New thread created:",
572 - Threads::CHANGE_DELETED => "Deleted:",
573 - Threads::CHANGE_UNDELETED => "Undeleted:");
574 - $change_label = array_key_exists($t->changeType(), $change_names) ? $change_names[$t->changeType()] : "";
575 -
576 - $url = LqtView::permalinkUrlWithQuery( $this->thread, 'lqt_oldid=' . $t->revisionNumber() );
577 -
578 - $p = new Parser(); $sig = $wgOut->parse( $p->getUserSig( $t->changeUser() ), false );
579 -
580 - $result[] = "<tr>";
581 - $result[] = "<td><a href=\"$url\">" . $wgLang->timeanddate($t->timestamp()) . "</a></td>";
582 - $result[] = "<td>" . $sig . "</td>";
583 - $result[] = "<td>$change_label</td>";
584 - $result[] = "<td>" . $t->changeComment() . "</td>";
585 - $result[] = "</tr>";
586 - return implode('', $result);
587 - }
588 -
589 - function getNotificationTimestamp() {
590 - return "foo";
591 - }
592 -/*
593 - function formatRow( $row ) {
594 - return '<li>' . $row->hthread_revision;
595 - }
596 -*/
597 - function getStartBody() {
598 - $this->mLastRow = false;
599 - $this->mCounter = 1;
600 -
601 - // Due to the screwy way we're doing history, the last revision we show,
602 - // that is, the current revision, is in the thread table, not the
603 - // historical_thread table. aurggghhh!
604 - // TODO paging.
605 - return '<table>' . $this->rowForThread($this->thread);
606 - }
607 -
608 - function getEndBody() {
609 - return '</table>';
610 - }
611 -}
612 -
613522 class ThreadHistoryListingView extends ThreadPermalinkView {
614523
615524 private function rowForThread($t) {
@@ -674,15 +583,13 @@
675584
676585 /* TOOD: customize tabs so that History is highlighted. */
677586
678 - function threadDivClass($thread) {
679 - // efVarDump($this->output, $thread->changeObject()->id());
 587+ function postDivClass($thread) {
680588 $is_changed_thread = $thread->changeObject() &&
681589 $thread->changeObject()->id() == $thread->id();
682 -
683590 if ( $is_changed_thread )
684 - return 'lqt_thread lqt_thread_changed_by_history';
 591+ return 'lqt_post_changed_by_history';
685592 else
686 - return 'lqt_thread';
 593+ return 'lqt_post';
687594 }
688595
689596
Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -556,7 +556,7 @@
557557
558558 /* $color_number = $this->selectNewUserColor( $thread->root()->originalAuthor() );
559559 $this->openDiv( "lqt_post lqt_post_color_$color_number" );*/
560 - $this->openDiv( 'lqt_post' );
 560+ $this->openDiv( $this->postDivClass($thread) );
561561
562562 if( $this->methodAppliesToThread( 'edit', $thread ) ) {
563563 $this->showPostEditingForm( $thread );
@@ -584,8 +584,8 @@
585585 }
586586 }
587587
588 - function threadDivClass( $thread ) {
589 - return 'lqt_thread';
 588+ function postDivClass( $thread ) {
 589+ return 'lqt_post';
590590 }
591591
592592 function showThread( $thread ) {
@@ -629,7 +629,7 @@
630630 $this->output->addHTML("<p class=\"lqt_summary_notice\">If this discussion seems to be concluded, you are encouraged to <a href=\"{$this->permalinkUrl($thread, 'summarize')}\">write a summary</a>. There have been no changes here for at least $this->archive_start_days days.</p>");
631631 }
632632
633 - $this->openDiv($this->threadDivClass($thread), "lqt_thread_id_{$thread->id()}");
 633+ $this->openDiv('lqt_thread', "lqt_thread_id_{$thread->id()}");
634634
635635 $this->showRootPost( $thread );
636636 $this->indent();

Status & tagging log