Index: branches/liquidthreads/skins/monobook/main.css |
— | — | @@ -140,25 +140,39 @@ |
141 | 141 | border-color: #aaa; |
142 | 142 | } |
143 | 143 | |
144 | | -.lqt_post:hover a { |
| 144 | +.lqt_post .lqt_footer:hover a { |
145 | 145 | color: #002bb8; |
| 146 | + text-decoration: none; |
146 | 147 | } |
147 | | -.lqt_post:hover a:visited { |
| 148 | +.lqt_post .lqt_footer:hover a:visited { |
148 | 149 | color: #5a3696; |
| 150 | + text-decoration: none; |
149 | 151 | } |
150 | | -.lqt_post:hover .lqt_footer a:active { |
| 152 | +.lqt_post .lqt_footer:hover .lqt_footer a:active { |
151 | 153 | color: #faa700; |
| 154 | + text-decoration: none; |
152 | 155 | } |
153 | | -.lqt_post:hover a.stub { |
| 156 | +.lqt_post .lqt_footer:hover a.stub { |
154 | 157 | color: #772233; |
| 158 | + text-decoration: none; |
155 | 159 | } |
156 | | -.lqt_post:hover a.new, #p-personal a.new { |
| 160 | +.lqt_post .lqt_footer:hover a.new, #p-personal a.new { |
157 | 161 | color: #ba0000; |
| 162 | + text-decoration: none; |
158 | 163 | } |
159 | | -.lqt_post:hover a.new:visited, #p-personal a.new:visited { |
| 164 | +.lqt_post .lqt_footer:hover a.new:visited, #p-personal a.new:visited { |
160 | 165 | color: #a55858; |
| 166 | + text-decoration: none; |
161 | 167 | } |
162 | 168 | |
| 169 | +.lqt_context_message { |
| 170 | + display: table; /* Occupy only the width of the text, */ |
| 171 | + width: auto; /* not the entire available width. */ |
| 172 | + |
| 173 | + border: 1px solid #ddd; |
| 174 | + margin: 2em 0; |
| 175 | + padding: .5em; |
| 176 | +} |
163 | 177 | |
164 | 178 | |
165 | 179 | /** |
Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | $this->perpetuate('lqt_reply_to', 'hidden') . |
147 | 147 | $this->perpetuate('lqt_new_thread_form', 'hidden'); |
148 | 148 | |
149 | | - if ( $thread == null || $thread->superthread() == null ) { |
| 149 | + if ( /*$thread == null*/ $edit_type=='new' || ($thread && $thread->superthread() == null) ) { |
150 | 150 | // This is a top-level post; show the subject line. |
151 | 151 | $subject = $this->request->getVal('lqt_subject_field', $thread ? $thread->subject() : ''); |
152 | 152 | $e->editFormTextBeforeContent .= <<<HTML |
— | — | @@ -327,20 +327,42 @@ |
328 | 328 | } |
329 | 329 | |
330 | 330 | class ThreadPermalinkView extends LqtView { |
| 331 | + function showThreadHeading( $thread ) { |
| 332 | + if ( $thread->hasSubject() && $this->headerLevel == 1 ) { |
| 333 | + $this->output->setPageTitle( "Thread: " . $thread->subject() ); |
| 334 | + } else { |
| 335 | + parent::showThreadHeading($thread); |
| 336 | + } |
| 337 | + } |
| 338 | + |
331 | 339 | function show() { |
332 | 340 | /* Extract the numeric ID after the slash in the URL. */ |
333 | 341 | $title_string = $this->request->getVal('title'); |
334 | 342 | $a = explode('/', $title_string); |
335 | 343 | if ( $a == false || count( $a ) < 2 || !ctype_digit($a[1]) ) { |
336 | | - echo("bad request"); // TODO this is not a very friendly way to handle this. |
| 344 | + echo("bad request (TODO real error msg?)"); |
337 | 345 | die(); |
338 | 346 | } |
339 | 347 | $thread_id = intval($a[1]); |
| 348 | + |
| 349 | + $t = Thread::newFromId( $thread_id ); |
| 350 | + $this->article = $t->article(); # for creating reply threads. |
340 | 351 | |
341 | | - $this->output->setPageTitle( "Thread #$thread_id" ); |
| 352 | + $this->output->setPageTitle( "Thread: #$thread_id" ); // Default if no subject line. |
| 353 | + |
| 354 | +$talkpage_link = $this->user->getSkin()->makeKnownLinkObj($t->article()->getTitle()->getTalkpage()); |
| 355 | + if ( $t->superthread() ) { |
| 356 | +/* $this->output->addHTML(<<<HTML |
| 357 | + <p class="lqt_context_message">You are viewing a reply to another post. |
| 358 | + <a href="{$this->permalinkUrl($t->topmostThread())}">View the entire discussion.</a></p> |
| 359 | +HTML |
| 360 | +);*/ |
| 361 | + $this->output->setSubtitle( "a fragment of <a href=\"{$this->permalinkUrl($t->topmostThread())}\">a discussion</a> from " . $talkpage_link ); |
| 362 | + } else { |
| 363 | + |
| 364 | + $this->output->setSubtitle( "from " . $talkpage_link ); |
| 365 | + } |
342 | 366 | |
343 | | - $t = Thread::newFromId( $thread_id ); |
344 | | - $this->article = $t->article(); |
345 | 367 | $this->showThread($t); |
346 | 368 | } |
347 | 369 | } |
Index: branches/liquidthreads/extensions/LqtModel.php |
— | — | @@ -25,6 +25,8 @@ |
26 | 26 | |
27 | 27 | } |
28 | 28 | |
| 29 | +// TODO when exactly do we update thraed_touched? |
| 30 | + |
29 | 31 | class Thread { |
30 | 32 | |
31 | 33 | /* ID references to other objects that are loaded on demand: */ |
— | — | @@ -57,6 +59,11 @@ |
58 | 60 | return $this->superthread; |
59 | 61 | } |
60 | 62 | |
| 63 | + function topmostThread() { |
| 64 | + if ( !$this->superthread() ) return $this; |
| 65 | + else return $this->superthread()->topmostThread(); |
| 66 | + } |
| 67 | + |
61 | 68 | function setArticle($a) { |
62 | 69 | $this->articleId = $a->getID(); |
63 | 70 | $this->updateRecord(); |
— | — | @@ -100,10 +107,9 @@ |
101 | 108 | return Thread::threadsWhere( array('thread_subthread_of' => $this->id), |
102 | 109 | array('ORDER BY' => 'thread_touched') ); |
103 | 110 | } |
104 | | - |
| 111 | + |
105 | 112 | protected function updateRecord() { |
106 | 113 | $dbr =& wfGetDB( DB_MASTER ); |
107 | | - |
108 | 114 | $res = $dbr->update( 'lqt_thread', |
109 | 115 | /* SET */ array( 'thread_root_post' => $this->rootPostId, |
110 | 116 | 'thread_article' => $this->articleId, |