use "@@moderate-publish-comment" instead of "content_status_modify" for publishing comments. content_status_modify does not reindex the comment properly.

svn path=/plone.app.discussion/trunk/; revision=27839
This commit is contained in:
Timo Stollenwerk 2009-07-06 17:30:19 +00:00
parent a946fb54fa
commit a608c58c4c
2 changed files with 27 additions and 2 deletions

View File

@ -115,10 +115,11 @@
method="get" method="get"
style="display: inline;" style="display: inline;"
tal:repeat="action reply_dict/actions|nothing" tal:repeat="action reply_dict/actions|nothing"
tal:attributes="action string:${reply/absolute_url}/content_status_modify; tal:attributes="action string:${reply/absolute_url}/@@moderate-publish-comment;
name action/id"> name action/id">
<input type="hidden" name="workflow_action" tal:attributes="value action/id" /> <input type="hidden" name="workflow_action" tal:attributes="value action/id" />
<input class="context" <input name="form.button.PublishComment"
class="context"
type="submit" type="submit"
tal:attributes="value action/title" tal:attributes="value action/title"
/> />

View File

@ -99,4 +99,28 @@ jq(document).ready(function() {
}, },
}); });
}); });
/*****************************************************************
* Publish comment.
*****************************************************************/
jq("input[name='form.button.PublishComment']").click(function(e){
e.preventDefault();
var button = jq(this);
var form = jq(this).parent();
var target = jq(form).attr("action");
var comment = jq(form).parent()
jq.ajax({
type: "GET",
url: target,
success: function(msg){
// fade out row
jq(button).fadeOut("normal", function(){
jq(form).remove();
});
},
error: function(msg){
alert("Error sending AJAX request:" + target);
},
});
});
}); });