Index: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php |
— | — | @@ -301,11 +301,15 @@ |
302 | 302 | } |
303 | 303 | |
304 | 304 | function showReplyForm( $thread ) { |
| 305 | + $html = Xml::openElement( 'div', |
| 306 | + array( 'class' => 'lqt-reply-form' ) ); |
| 307 | + $this->output->addHTML( $html ); |
305 | 308 | if ( $thread->root()->getTitle()->userCan( 'edit' ) ) { |
306 | | - $this->showEditingFormInGeneral( null, 'reply', $thread ); |
| 309 | + $this->showEditingFormInGeneral( null, 'reply', $thread ); |
307 | 310 | } else { |
308 | 311 | $this->showReplyProtectedNotice( $thread ); |
309 | 312 | } |
| 313 | + $this->output->addHTML('</div>'); |
310 | 314 | } |
311 | 315 | |
312 | 316 | function showSummarizeForm( $thread ) { |
— | — | @@ -1558,6 +1562,10 @@ |
1559 | 1563 | $this->showThreadReplies( $thread, $startAt, $maxCount, $showThreads, |
1560 | 1564 | $cascadeOptions ); |
1561 | 1565 | } elseif ( $hasSubthreads && !$showThreads ) { |
| 1566 | + if ($replyTo) { |
| 1567 | + $this->showReplyForm( $thread ); |
| 1568 | + } |
| 1569 | + |
1562 | 1570 | // Add a "show subthreads" link. |
1563 | 1571 | $link = $this->getShowReplies( $thread ); |
1564 | 1572 | |
— | — | @@ -1575,10 +1583,8 @@ |
1576 | 1584 | $class = 'lqt-thread-replies lqt-thread-replies-'. |
1577 | 1585 | $this->threadNestingLevel; |
1578 | 1586 | $html = Xml::openElement( 'div', array( 'class' => $class ) ); |
1579 | | - $html .= Xml::openElement( 'div', |
1580 | | - array( 'class' => 'lqt-reply-form' ) ); |
1581 | 1587 | $this->output->addHTML( $html ); |
1582 | | - |
| 1588 | + |
1583 | 1589 | $this->showReplyForm( $thread ); |
1584 | 1590 | |
1585 | 1591 | $finishDiv = Xml::tags( 'div', |
— | — | @@ -1594,6 +1600,22 @@ |
1595 | 1601 | $finishHTML .= Xml::closeElement( 'div' ); // lqt-thread-replies |
1596 | 1602 | $this->output->addHTML( $finishHTML ); |
1597 | 1603 | } |
| 1604 | + } elseif ( !$hasSubthreads && $replyTo ) { |
| 1605 | + $class = 'lqt-thread-replies lqt-thread-replies-'. |
| 1606 | + $this->threadNestingLevel; |
| 1607 | + $html = Xml::openElement( 'div', array( 'class' => $class ) ); |
| 1608 | + $this->output->addHTML( $html ); |
| 1609 | + |
| 1610 | + $this->showReplyForm( $thread ); |
| 1611 | + |
| 1612 | + $html = Xml::tags( 'div', |
| 1613 | + array( 'class' => 'lqt-replies-finish' ), |
| 1614 | + Xml::tags( 'div', |
| 1615 | + array( 'class' => |
| 1616 | + 'lqt-replies-finish-corner' |
| 1617 | + ), ' ' ) ); |
| 1618 | + $html .= Xml::closeElement( 'div' ); |
| 1619 | + $this->output->addHTML( $html ); |
1598 | 1620 | } |
1599 | 1621 | |
1600 | 1622 | if ( $this->threadNestingLevel == 1 ) { |
— | — | @@ -1616,10 +1638,7 @@ |
1617 | 1639 | // Check if we're actually replying to this thread. |
1618 | 1640 | if ( $this->methodAppliesToThread( 'reply', $thread ) ) { |
1619 | 1641 | // As with above, flush HTML to avoid refactoring EditPage. |
1620 | | - $this->output->addHTML( Xml::openElement( 'div', |
1621 | | - array( 'class' => 'lqt-reply-form' ) ) ); |
1622 | 1642 | $this->showReplyForm( $thread ); |
1623 | | - $this->output->addHTML( Xml::closeElement( 'div' ) ); |
1624 | 1643 | return; |
1625 | 1644 | } elseif ( !$thread->canUserReply( $this->user ) ) { |
1626 | 1645 | return; |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php |
— | — | @@ -307,11 +307,15 @@ |
308 | 308 | } |
309 | 309 | |
310 | 310 | function showReplyForm( $thread ) { |
| 311 | + $html = Xml::openElement( 'div', |
| 312 | + array( 'class' => 'lqt-reply-form' ) ); |
| 313 | + $this->output->addHTML( $html ); |
311 | 314 | if ( $thread->root()->getTitle()->userCan( 'edit' ) ) { |
312 | | - $this->showEditingFormInGeneral( null, 'reply', $thread ); |
| 315 | + $this->showEditingFormInGeneral( null, 'reply', $thread ); |
313 | 316 | } else { |
314 | 317 | $this->showReplyProtectedNotice( $thread ); |
315 | 318 | } |
| 319 | + $this->output->addHTML('</div>'); |
316 | 320 | } |
317 | 321 | |
318 | 322 | function showSummarizeForm( $thread ) { |
— | — | @@ -1605,6 +1609,10 @@ |
1606 | 1610 | $this->showThreadReplies( $thread, $startAt, $maxCount, $showThreads, |
1607 | 1611 | $cascadeOptions ); |
1608 | 1612 | } elseif ( $hasSubthreads && !$showThreads ) { |
| 1613 | + if ($replyTo) { |
| 1614 | + $this->showReplyForm( $thread ); |
| 1615 | + } |
| 1616 | + |
1609 | 1617 | // Add a "show subthreads" link. |
1610 | 1618 | $link = $this->getShowReplies( $thread ); |
1611 | 1619 | |
— | — | @@ -1622,10 +1630,8 @@ |
1623 | 1631 | $class = 'lqt-thread-replies lqt-thread-replies-' . |
1624 | 1632 | $this->threadNestingLevel; |
1625 | 1633 | $html = Xml::openElement( 'div', array( 'class' => $class ) ); |
1626 | | - $html .= Xml::openElement( 'div', |
1627 | | - array( 'class' => 'lqt-reply-form' ) ); |
1628 | 1634 | $this->output->addHTML( $html ); |
1629 | | - |
| 1635 | + |
1630 | 1636 | $this->showReplyForm( $thread ); |
1631 | 1637 | |
1632 | 1638 | $finishDiv = Xml::tags( 'div', |
— | — | @@ -1641,6 +1647,22 @@ |
1642 | 1648 | $finishHTML .= Xml::closeElement( 'div' ); // lqt-thread-replies |
1643 | 1649 | $this->output->addHTML( $finishHTML ); |
1644 | 1650 | } |
| 1651 | + } elseif ( !$hasSubthreads && $replyTo ) { |
| 1652 | + $class = 'lqt-thread-replies lqt-thread-replies-'. |
| 1653 | + $this->threadNestingLevel; |
| 1654 | + $html = Xml::openElement( 'div', array( 'class' => $class ) ); |
| 1655 | + $this->output->addHTML( $html ); |
| 1656 | + |
| 1657 | + $this->showReplyForm( $thread ); |
| 1658 | + |
| 1659 | + $html = Xml::tags( 'div', |
| 1660 | + array( 'class' => 'lqt-replies-finish' ), |
| 1661 | + Xml::tags( 'div', |
| 1662 | + array( 'class' => |
| 1663 | + 'lqt-replies-finish-corner' |
| 1664 | + ), ' ' ) ); |
| 1665 | + $html .= Xml::closeElement( 'div' ); |
| 1666 | + $this->output->addHTML( $html ); |
1645 | 1667 | } |
1646 | 1668 | |
1647 | 1669 | if ( $this->threadNestingLevel == 1 ) { |
— | — | @@ -1663,10 +1685,7 @@ |
1664 | 1686 | // Check if we're actually replying to this thread. |
1665 | 1687 | if ( $this->methodAppliesToThread( 'reply', $thread ) ) { |
1666 | 1688 | // As with above, flush HTML to avoid refactoring EditPage. |
1667 | | - $this->output->addHTML( Xml::openElement( 'div', |
1668 | | - array( 'class' => 'lqt-reply-form' ) ) ); |
1669 | 1689 | $this->showReplyForm( $thread ); |
1670 | | - $this->output->addHTML( Xml::closeElement( 'div' ) ); |
1671 | 1690 | return; |
1672 | 1691 | } elseif ( !$thread->canUserReply( $this->user ) ) { |
1673 | 1692 | return; |