* Added status code and full path to Root.notfound_action()
* Added status code to Root.error_action() * Moved notfound.skin and error.skin as subskins into $Root.skin * Removed obsolete <script>-Element from Site#page skin
This commit is contained in:
parent
5fc69bd305
commit
ae694946fa
6 changed files with 50 additions and 43 deletions
|
|
@ -23,9 +23,20 @@ alphabetical order." %></p>
|
|||
<% response.list prefix="<ul>" suffix="</ul>" %>
|
||||
<% response.pager %>
|
||||
|
||||
<% #notfound %>
|
||||
<p><strong>Sorry!</strong></p>
|
||||
<p>The URL <% root.href %><% param.path encoding="all" %>
|
||||
was not found on this server!</p>
|
||||
|
||||
<% #error %>
|
||||
<p><strong>Sorry!</strong></p>
|
||||
<p>An error occurred while processing your request:</p>
|
||||
<% param.error %>
|
||||
|
||||
|
||||
|
||||
|
||||
<% #FIXME %>
|
||||
<div style="margin: 200px 0 20px 0;">FIXME:</div>
|
||||
|
||||
<div class="boxheader">menu</div>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,19 @@ this.handleMetadata("phaseOutInactiveSites");
|
|||
this.handleMetadata("phaseOutNotificationPeriod");
|
||||
this.handleMetadata("phaseOutGracePeriod");
|
||||
|
||||
Root.restore = function(ref) {
|
||||
var backup;
|
||||
if (backup = session.data.backup) {
|
||||
ref.title = decodeURIComponent(backup.title);
|
||||
ref.text = decodeURIComponent(backup.text);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
Root.prototype.processHref = function(href) {
|
||||
return app.properties.defaulthost + href;
|
||||
}
|
||||
|
||||
Root.prototype.getPermission = function(action) {
|
||||
if (action.contains("admin")) {
|
||||
return User.require(User.PRIVILEGED);
|
||||
|
|
@ -59,15 +72,6 @@ Root.prototype.getPermission = function(action) {
|
|||
return Site.prototype.getPermission.apply(this, arguments);
|
||||
}
|
||||
|
||||
Root.prototype.getMacroHandler = function(name) {
|
||||
switch (name) {
|
||||
case "sites":
|
||||
case "admin":
|
||||
return this[name];
|
||||
}
|
||||
return Site.prototype.getMacroHandler.apply(this, arguments);
|
||||
}
|
||||
|
||||
Root.prototype.main_action = function() {
|
||||
return Site.prototype.main_action.apply(this);
|
||||
|
||||
|
|
@ -117,18 +121,18 @@ Root.prototype.getFormOptions = function(name) {
|
|||
}
|
||||
|
||||
Root.prototype.error_action = function() {
|
||||
res.status = 500;
|
||||
res.data.title = root.getTitle() + " - Error";
|
||||
res.data.body = root.renderSkinAsString("sysError");
|
||||
res.data.body += "<p>"+res.error+"</p>";
|
||||
(path.Site && path.Site.online ? path.Site : root).renderSkin("Site#page");
|
||||
res.data.body = root.renderSkinAsString("$Root#error", res);
|
||||
res.handlers.site.renderSkin("Site#page");
|
||||
return;
|
||||
}
|
||||
|
||||
Root.prototype.notfound_action = function() {
|
||||
res.data.title = root.title + " - 404 - not found";
|
||||
req.data.path = req.path;
|
||||
res.data.body = root.renderSkinAsString("notfound");
|
||||
(path.Site && path.Site.online ? path.Site : root).renderSkin("Site#page");
|
||||
res.status = 404;
|
||||
res.data.title = root.getTitle() + " - Error";
|
||||
res.data.body = root.renderSkinAsString("$Root#notfound", req);
|
||||
res.handlers.site.renderSkin("Site#page");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -177,15 +181,6 @@ Root.prototype.backup_js_action = function() {
|
|||
return;
|
||||
}
|
||||
|
||||
Root.restore = function(ref) {
|
||||
var backup;
|
||||
if (backup = session.data.backup) {
|
||||
ref.title = decodeURIComponent(backup.title);
|
||||
ref.text = decodeURIComponent(backup.text);
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
Root.prototype.default_hook_action = function() {
|
||||
var ping = function(data) {
|
||||
if (data.type !== "Site") {
|
||||
|
|
@ -242,6 +237,15 @@ Root.prototype.updates_xml_action = function() {
|
|||
return;
|
||||
}
|
||||
|
||||
Root.prototype.getMacroHandler = function(name) {
|
||||
switch (name) {
|
||||
case "sites":
|
||||
case "admin":
|
||||
return this[name];
|
||||
}
|
||||
return Site.prototype.getMacroHandler.apply(this, arguments);
|
||||
}
|
||||
|
||||
Root.prototype.getCreationPermission = function() {
|
||||
var user;
|
||||
if (!(user = session.user)) {
|
||||
|
|
@ -286,7 +290,3 @@ Root.prototype.getCreationPermission = function() {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Root.prototype.processHref = function(href) {
|
||||
return app.properties.defaulthost + href;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
<p><strong>Sorry!</strong></p><p>URL <% request.path encoding="all" %> was not
|
||||
found on this server!</p>
|
||||
|
|
@ -1 +0,0 @@
|
|||
<p><strong>Sorry!</strong></p><p>An error occurred while processing your request:</p>
|
||||
|
|
@ -51,6 +51,16 @@ Site.getNotificationModes = defineConstants(Site, "Nobody",
|
|||
"Owner", "Manager", "Contributor", "Subscriber" );
|
||||
Site.getWebHookModes = defineConstants(Site, "disabled", "enabled");
|
||||
|
||||
Site.remove = function(site) {
|
||||
HopObject.remove(site.members);
|
||||
HopObject.remove(site.stories);
|
||||
HopObject.remove(site.images);
|
||||
HopObject.remove(site.files)
|
||||
site.remove();
|
||||
logAction("site", "removed");
|
||||
return;
|
||||
}
|
||||
|
||||
Site.getByName = function(name) {
|
||||
return root.sites.get(name);
|
||||
}
|
||||
|
|
@ -239,16 +249,6 @@ Site.prototype.update = function(data) {
|
|||
return;
|
||||
}
|
||||
|
||||
Site.remove = function(site) {
|
||||
HopObject.remove(site.members);
|
||||
HopObject.remove(site.stories);
|
||||
HopObject.remove(site.images);
|
||||
HopObject.remove(site.files)
|
||||
site.remove();
|
||||
logAction("site", "removed");
|
||||
return;
|
||||
}
|
||||
|
||||
Site.prototype.main_css_action = function() {
|
||||
res.dependsOn(this.modified);
|
||||
res.dependsOn(Skin("Site", "values").getSource());
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ Disallow: /stories/top
|
|||
<title><% response.title %></title>
|
||||
<meta http-equiv="Content-Type" content="text/html" />
|
||||
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
|
||||
<!--script type="text/javascript" src="<% file /jquery-1.2.1.min.js url %>"></script-->
|
||||
<script type="text/javascript" src="<% site.href main.js %>"></script>
|
||||
<link rel="stylesheet" type="text/css" title="CSS Stylesheet" href="<% site.href main.css %>" />
|
||||
<link rel="alternate" type="application/rss+xml" title="Stories and comments of <% site.title %>" href="<% site.href rss.xml %>" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue