31 lines
No EOL
885 B
Text
31 lines
No EOL
885 B
Text
checkIfLoggedIn(this.href(req.action));
|
|
|
|
var deny = this.isDeleteDenied(session.user);
|
|
if (deny) {
|
|
res.message = deny;
|
|
res.redirect(this.site.href());
|
|
}
|
|
|
|
if (req.data.submit == "cancel" || req.data.cancel)
|
|
res.redirect(path.site.stories.href());
|
|
else if (req.data.submit == "delete" || req.data.remove) {
|
|
var result = this.site.stories.deleteStory(this);
|
|
res.message = result.message;
|
|
res.redirect(path.site.stories.href());
|
|
}
|
|
|
|
res.data.action = this.href(req.action);
|
|
|
|
res.data.title = this.site.title;
|
|
if (this.title)
|
|
res.data.title += " - " + encode(this.title);
|
|
|
|
var skinParam = new Object();
|
|
if (this.title)
|
|
skinParam.what = "the story "" + this.title + """;
|
|
else
|
|
skinParam.what = "a story";
|
|
skinParam.what += " from <b>" + this.creator.name + "</b>";
|
|
res.data.body = this.renderSkinAsString("delete",skinParam);
|
|
|
|
path.site.renderSkin("page"); |