antville/code/Comment/comment.hac

30 lines
816 B
Text

checkIfLoggedIn(this.href(req.action));
var deny = this.isPostDenied(session.user);
if (deny) {
res.message = deny;
res.redirect(path.story.href());
}
res.data.action = this.href(req.action);
if (req.data.submit == "cancel" || req.data.cancel)
res.redirect(this.story.href());
else if (req.data.submit == "save" || req.data.save) {
var result = this.evalComment(req.data,path.story,session.user);
res.message = result.message;
if (!result.error)
res.redirect(path.story.href());
}
res.data.title = this.site.title;
if (this.story.title)
res.data.title += " - " + encode(this.story.title);
res.data.body = this.renderSkinAsString("toplevel");
var r = new comment();
res.data.action = this.href("comment");
res.data.body += r.renderSkinAsString("edit");
path.site.renderSkin("page");