Commit 68f60768 authored by Zach Copley's avatar Zach Copley

OMG I think ajax works right now

parent 583b9035
......@@ -463,7 +463,7 @@ class QnAPlugin extends MicroAppPlugin
$nli = new NoticeListItem($notice, $out);
$nli->showNotice();
$out->elementStart('p', array('class' => 'entry-content answer-content'));
$out->elementStart('div', array('class' => 'entry-content answer-content'));
if (!empty($answer)) {
$form = new QnashowanswerForm($out, $answer);
......@@ -472,7 +472,7 @@ class QnAPlugin extends MicroAppPlugin
$out->text(_m('Answer data is missing.'));
}
$out->elementEnd('p');
$out->elementEnd('div');
// @fixme
$out->elementStart('div', array('class' => 'entry-content'));
......
......@@ -169,6 +169,7 @@ class QnanewanswerAction extends Action
$this->elementEnd('body');
$this->elementEnd('html');
} else {
common_debug("not ajax");
common_redirect($this->question->bestUrl(), 303);
}
}
......
......@@ -175,8 +175,7 @@ class QnanewquestionAction extends Action
*/
function showNotice($notice)
{
class_exists('NoticeList'); // @fixme hack for autoloader
$nli = new NoticeListItem($notice, $this);
$nli = new NoticeQuestionListItem($notice, $this);
$nli->show();
}
......@@ -221,3 +220,25 @@ class QnanewquestionAction extends Action
}
}
}
class NoticeQuestionListItem extends NoticeListItem
{
/**
* constructor
*
* Also initializes the profile attribute.
*
* @param Notice $notice The notice we'll display
*/
function __construct($notice, $out=null)
{
parent::__construct($notice, $out);
}
function showEnd()
{
$this->out->element('ul', 'notices threaded-replies xoxo');
parent::showEnd();
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -81,7 +81,7 @@ class QnanewanswerForm extends Form
*/
function formClass()
{
return 'form_settings qna_answer_form';
return 'form_settings qna_answer_form ajax-notice';
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment