* Fixed skin names according to issue #16

* Fixed rendering of values stored in res.meta.values
 * Removed obsolete code (mostly disabled by comments already)
This commit is contained in:
Tobi Schäfer 2008-01-19 17:36:33 +00:00
parent 5044e3610a
commit 0ba8805d02
25 changed files with 279 additions and 294 deletions

View file

@ -9,6 +9,14 @@
<td><label for="<% choice.id %>"><% choice.title %></label></td>
</tr>
<% #edit %>
<tr class="choice">
<td>
<span class="small">Choice #<% param.index %>:</span><br />
<input type="text" name="title" class="formText" value="<% choice.title %>" />
</td>
</tr>
<% #result %>
<p>
<div style="width: <% choice.votes 300 default="1" %>px;"
@ -19,10 +27,5 @@
<% choice.title %>
</p>
<% #edit %>
<tr class="choice">
<td>
<span class="small">Choice #<% param.index %>:</span><br />
<input type="text" name="title" class="formText" value="<% choice.title %>" />
</td>
</tr>
<% #graph %>
<div style="width:<% param.width %>px;" class="pollResultsBar">&nbsp;</div>

View file

@ -11,31 +11,6 @@
<% comment.link comment#form prefix="<br />... " %>
</div>
<% #content %>
<div class="storyDate">
<!-- This is: <% comment.self %><br />
Prototype: <% comment.prototype %><br />
Parent: <% comment.parent_type %> #<% comment.parent_id %><br />
Story: <% comment.story %><br /> -->
<% comment.creator link %>, <% comment.created short %>
</div>
<div class="title"><% comment.title %></div>
<div><% comment.text | comment.format %></div>
<% #comment %>
<% comment.skin Comment#content %>
<% #reply %>
<div class="reply">
<div class="listSeparator"></div>
<% comment.skin Comment#content %>
<p class="small">
<% comment.link . link prefix="... " %>
<% comment.link edit prefix="... " %>
<% comment.link delete prefix="... " %>
</p>
</div>
<% #edit %>
<% comment.skin Story#restore %>
<% parent.skin <% parent.type suffix="#comment" %> %>
@ -63,3 +38,28 @@
<button type="button" id="restore" value="1">restore</button>
</p>
</form>
<% #content %>
<div class="storyDate">
<!-- This is: <% comment.self %><br />
Prototype: <% comment.prototype %><br />
Parent: <% comment.parent_type %> #<% comment.parent_id %><br />
Story: <% comment.story %><br /> -->
<% comment.creator link %>, <% comment.created short %>
</div>
<div class="title"><% comment.title %></div>
<div><% comment.text | comment.format %></div>
<% #comment %>
<% comment.skin Comment#content %>
<% #reply %>
<div class="reply">
<div class="listSeparator"></div>
<% comment.skin Comment#content %>
<p class="small">
<% comment.link . link prefix="... " %>
<% comment.link edit prefix="... " %>
<% comment.link delete prefix="... " %>
</p>
</div>

View file

@ -4,36 +4,6 @@
(<% file.contentType suffix=", " %><% file.contentLength %>)
</span>
<% #files %>
<div class="listSeparator"> </div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="small">
<strong>Macro:</strong> <% file.macro %>
<div class="ample"><strong>Details: </strong><% file.contentLength %>
<% file.contentType prefix=" " %><% ngettext "{0} download" "{0} downloads"
<% file.requests %> prefix=", " %></div>
</td>
</tr>
<tr>
<td>
<div class="storyTitle"><% file.name %></div>
<div class="storyDate"><% file.creator as="link" %> on
<% file.created short %></div>
</td>
<td class="small" align="right" valign="top" rowspan="2">
<% file.link edit prefix=" ... " suffix="<br />" %>
<% file.link delete prefix="... " suffix="<br />" %>
<% file.link . download prefix=" ... " suffix="<br />" %>
</td>
</tr>
<tr>
<td>
<p><% file.description suffix="<br />" %></p>
</td>
</tr>
</table>
<% #edit %>
<form method="post" action="<% response.action %>" enctype="multipart/form-data">
<table border="0" width="400" cellspacing="0" cellpadding="3">
@ -71,3 +41,33 @@
</tr>
</table>
</form>
<% #listItem %>
<div class="listSeparator"> </div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="small">
<strong>Macro:</strong> <% file.macro %>
<div class="ample"><strong>Details: </strong><% file.contentLength %>
<% file.contentType prefix=" " %><% ngettext "{0} download" "{0} downloads"
<% file.requests %> prefix=", " %></div>
</td>
</tr>
<tr>
<td>
<div class="storyTitle"><% file.name %></div>
<div class="storyDate"><% file.creator as="link" %> on
<% file.created short %></div>
</td>
<td class="small" align="right" valign="top" rowspan="2">
<% file.link edit prefix=" ... " suffix="<br />" %>
<% file.link delete prefix="... " suffix="<br />" %>
<% file.link . download prefix=" ... " suffix="<br />" %>
</td>
</tr>
<tr>
<td>
<p><% file.description suffix="<br />" %></p>
</td>
</tr>
</table>

View file

@ -64,7 +64,7 @@ Files.prototype.create_action = function() {
Files.prototype.main_action = function() {
var files = User.getMembership().files;
res.data.list = renderList(files, "File#files", 10, req.queryParams.page);
res.data.list = renderList(files, "File#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(files, this.href(),
10, req.queryParams.page);
res.data.title = gettext("Member files of {0}", this._parent.title);
@ -74,7 +74,7 @@ Files.prototype.main_action = function() {
};
Files.prototype.all_action = function() {
res.data.list = renderList(this, "File#files", 10, req.queryParams.page);
res.data.list = renderList(this, "File#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(this,
this.href(), 10, req.queryParams.page);
res.data.title = gettext("Files of {0}", this._parent.title);

View file

@ -401,7 +401,7 @@ function list_macro(param /*, limit, id */) {
var collection, skin;
if (id === "sites") {
collection = root.sites.list(0, max);
skin = "Site#list"; // FIXME: #preview or #list?
skin = "Site#preview";
} else if (id === "updates") {
var counter = 0;
collection = [];
@ -411,7 +411,7 @@ function list_macro(param /*, limit, id */) {
collection.push(this);
}
});
skin = "Site#list";
skin = "Site#preview";
} else {
var site;
var parts = id.split("/");
@ -480,8 +480,9 @@ function value_macro(param, name, value) {
}
name = name.toLowerCase();
if (!value) {
return res.meta.values[name];
res.write(res.meta.values[name]);
} else {
res.write("/* set " + name + " to " + value + " */");
res.meta.values[name] = value;
}
return;

View file

@ -73,10 +73,12 @@ HopObject.prototype.onRequest = function() {
res.stop();
}
res.meta.values = {};
res.handlers.layout = res.handlers.site.layout || new Layout;
res.skinpath = res.handlers.layout.getSkinPath();
res.meta.values = {};
res.handlers.site.renderSkinAsString("Site#values");
// FIXME: remove after debugging
((res.contentType === "text/html") && res.debug(res.skinpath.toSource()));
return;

View file

@ -26,38 +26,6 @@ code: <pre><% image.macro %></pre></p>
<p><% image.render | link <% image.url %> %></p>
<p><% image.description %></p>
<% #preview %>
<p><% image.render %></p>
<% #images %>
<div class="listSeparator"> </div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="small">
<strong>Macro:</strong> <% image.macro %>
<div class="ample"><strong>Format: </strong><% image.contentType %>,
<% image.width %>&times;<% image.height %> pixels</div>
</td>
</tr>
<tr>
<td>
<div class="storyTitle"><% image.name %></div>
<div class="storyDate"><% image.creator as="link" %>
<% image.created short prefix=" on " %></div>
</td>
<td align="right" class="small" valign="top">
<% image.link edit prefix="... " suffix="<br />" %>
<% image.link delete prefix="... " suffix="<br />" %>
<% image.link replace prefix="..." suffix="<br />" %>
</td>
</tr>
<tr>
<td colspan="2">
<% image.thumbnail vspace="5" | image.link %>
</td>
</tr>
</table>
<% #edit %>
<form method="post" action="<% response.action %>" enctype="multipart/form-data">
<table border="0" width="400" cellspacing="0" cellpadding="3">
@ -121,3 +89,35 @@ code: <pre><% image.macro %></pre></p>
</tr>
</table>
</form>
<% #preview %>
<p><% image.render %></p>
<% #listItem %>
<div class="listSeparator"> </div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="small">
<strong>Macro:</strong> <% image.macro %>
<div class="ample"><strong>Format: </strong><% image.contentType %>,
<% image.width %>&times;<% image.height %> pixels</div>
</td>
</tr>
<tr>
<td>
<div class="storyTitle"><% image.name %></div>
<div class="storyDate"><% image.creator as="link" %>
<% image.created short prefix=" on " %></div>
</td>
<td align="right" class="small" valign="top">
<% image.link edit prefix="... " suffix="<br />" %>
<% image.link delete prefix="... " suffix="<br />" %>
<% image.link replace prefix="..." suffix="<br />" %>
</td>
</tr>
<tr>
<td colspan="2">
<% image.thumbnail vspace="5" | image.link %>
</td>
</tr>
</table>

View file

@ -58,7 +58,7 @@ Images.prototype.main_action = function() {
res.data.title = gettext("Layout images of {0}", res.handlers.site.title);
break;
}
res.data.list = renderList(images, "Image#images",
res.data.list = renderList(images, "Image#listItem",
10, req.queryParams.page);
res.data.pager = renderPager(images,
this.href(req.action), 10, req.queryParams.page);
@ -95,7 +95,7 @@ Images.prototype.create_action = function() {
Images.prototype.all_action = function() {
res.data.pager = renderPager(this, this.href(),
10, req.queryParams.page);
res.data.list = renderList(this, "Image#images",
res.data.list = renderList(this, "Image#listItem",
10, req.queryParams.page);
res.data.title = gettext("Images of {0}", this._parent.title);
res.data.body = this.renderSkinAsString("Images#main");

View file

@ -249,7 +249,7 @@ Members.prototype.updated_action = function() {
Members.prototype.privileges_action = function() {
res.data.title = gettext("Memberships of user {0}", session.user.name);
res.data.list = renderList(session.user.memberships,
"Membership#subscriptions");
"Membership#listItem");
res.data.body = session.user.renderSkinAsString("User#subscriptions");
res.handlers.site.renderSkin("Site#page");
return;
@ -258,7 +258,7 @@ Members.prototype.privileges_action = function() {
Members.prototype.subscriptions_action = function() {
res.data.title = gettext("Subscriptions of user {0}", session.user.name);
res.data.list = renderList(session.user.subscriptions,
"Membership#subscriptions");
"Membership#listItem");
res.data.body = session.user.renderSkinAsString("User#subscriptions");
res.handlers.site.renderSkin("Site#page");
return;
@ -279,7 +279,7 @@ Members.prototype.add_action = function() {
"Found {0} users matching the search input.",
result.length);
}
res.data.result = this.renderSkinAsString("Members#result", result);
res.data.result = this.renderSkinAsString("Members#results", result);
}
} catch (ex) {
res.message = ex;
@ -327,7 +327,7 @@ Members.prototype.search = function(searchString) {
if (this.get(name)) {
continue;
};
this.renderSkin("Members#resultItem", {name :name});
this.renderSkin("Members#result", {name :name});
counter += 1;
}
rows.release();

View file

@ -162,7 +162,7 @@ tabindex="4">reset</button>
</form>
<% response.result %>
<% #result %>
<% #results %>
<form method="post" action="<% response.action %>">
<% param.result prefix="<br />" %>
<br />
@ -170,7 +170,7 @@ tabindex="4">reset</button>
<button type="submit" id="cancel" name="cancel" value="1">Cancel</button>
</form>
<% #resultItem %>
<% #result %>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">

View file

@ -1,3 +1,27 @@
<% #edit %>
<p>To modify the membership, simply choose the desired role from the
drop-down menu and click the "save" button. An e-mail will be sent to the
member informing about the membership change.</p>
<form method="post" action="<% response.action %>">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="small" nowrap="nowrap">User:</td>
<td nowrap="nowrap"><% membership.name %></td>
</tr>
<tr>
<td class="small" nowrap="nowrap">Role:</td>
<td nowrap="nowrap"><% membership.select role %></td>
</tr>
<tr>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><br />
<button type="submit" name="save" value="1"><strong>save</strong></button>
<button type="submit" name="cancel" value="1">cancel</button>
</td>
</tr>
</table>
</form>
<% #login %>
You're not logged in <% site.members.link login prefix="... " %>
@ -9,7 +33,7 @@ Logged in as <% membership.name | membership.link %><br />
<% site.members.link updated subscriptions prefix="... " suffix="<br />" %>
<% site.members.link logout prefix="... " %>
<% #members %>
<% #listItem %>
<div class="listSeparator"> </div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
@ -33,7 +57,7 @@ Logged in as <% membership.name | membership.link %><br />
</tr>
</table>
<% #subscriptions %>
<% #subscription %>
<div class="listSeparator"> </div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
@ -71,27 +95,3 @@ Please make sure your own e-mail address in your
<button type="submit" name="cancel" value="1">cancel</button>
</p>
</form>
<% #edit %>
<p>To modify the membership, simply choose the desired role from the
drop-down menu and click the "save" button. An e-mail will be sent to the
member informing about the membership change.</p>
<form method="post" action="<% response.action %>">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="small" nowrap="nowrap">User:</td>
<td nowrap="nowrap"><% membership.name %></td>
</tr>
<tr>
<td class="small" nowrap="nowrap">Role:</td>
<td nowrap="nowrap"><% membership.select role %></td>
</tr>
<tr>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><br />
<button type="submit" name="save" value="1"><strong>save</strong></button>
<button type="submit" name="cancel" value="1">cancel</button>
</td>
</tr>
</table>
</form>

View file

@ -76,7 +76,7 @@ Poll.prototype.link_macro = function(param, action, text) {
Poll.prototype.main_action = function() {
if (this.status === "closed") {
res.message = gettext("Sorry, this poll is closed. Voting is not possible.");
res.redirect(this.href("results"));
res.redirect(this.href("result"));
return;
}
if (req.postParams.vote) {
@ -190,7 +190,7 @@ Poll.remove = function() {
Poll.prototype.result_action = function() {
res.data.title = gettext('Results of poll "{0}"', this.question);
res.data.body = this.renderSkinAsString("Poll#result");
res.data.body = this.renderSkinAsString("Poll#results");
this.site.renderSkin("Site#page");
return;
};

View file

@ -18,7 +18,7 @@
</table>
</form>
<% #result %>
<% #results %>
<% poll.question %><br />
<% poll.loop skin="Choice#result" %>
<p><br />
@ -29,7 +29,7 @@
prefix="<br />This poll was closed by " suffix=" on " %> %>
</div>
<% #polls %>
<% #listItem %>
<a name="<% poll.id %>" id="<% poll.id %>"></a>
<div class="listSeparator"> </div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">

View file

@ -43,7 +43,7 @@ Polls.prototype.getPermission = function(action) {
Polls.prototype.main_action = function() {
var polls = User.getMembership().polls;
res.data.list = renderList(polls, "Poll#polls", 10, req.queryParams.page);
res.data.list = renderList(polls, "Poll#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(polls, this.href(req.action),
10, req.queryParams.page);
res.data.title = gettext("Member polls of {0}", this._parent.title);
@ -76,7 +76,7 @@ Polls.prototype.create_action = function() {
Polls.prototype.open_action = function() {
res.data.list = renderList(this.open,
"Poll#polls", 10, req.queryParams.page);
"Poll#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(this.open,
this.href(req.action), 10, req.queryParams.page);
res.data.title = gettext("Open polls of {0}", this._parent.title);
@ -86,7 +86,7 @@ Polls.prototype.open_action = function() {
};
Polls.prototype.all_action = function() {
res.data.list = renderList(this, "Poll#polls", 10, req.queryParams.page);
res.data.list = renderList(this, "Poll#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(this,
this.href(), 10, req.queryParams.page);
res.data.title = gettext("Polls of {0}", this._parent.title);

View file

@ -146,7 +146,7 @@ Root.prototype.create_action = function() {
Root.prototype.sites_action = function() {
res.data.list = renderList(root.sites,
"Site#list", 10, req.queryParams.page);
"Site#preview", 10, req.queryParams.page);
res.data.pager = renderPager(root.sites,
this.href(req.action), 10, req.queryParams.page);
res.data.title = gettext("Sites of {0}", root.title);

View file

@ -237,7 +237,6 @@ Site.prototype.main_css_action = function() {
res.dependsOn(Skin("Site", "stylesheet").getSource());
res.digest();
res.contentType = "text/css";
this.renderSkin("Site#values");
this.renderSkin("Site#stylesheet");
return;
};

View file

@ -1,7 +1,88 @@
<% #main %>
<% site.list stories %>
<% #list %>
<% #edit %>
<form id="prefs" method="post" action="<% response.action %>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2">
<strong><a name="general">General</a></strong>
</td>
</tr>
<tr>
<td class="small">Mode:</td>
<td><% site.select mode %></td>
</tr>
<tr>
<td class="small">Title:</td>
<td><% site.input title %></td>
</tr>
<tr>
<td class="small">Tagline:</td>
<td><% site.input tagline %></td>
</tr>
<tr>
<td class="small">Paging:</td>
<td><% site.input pageSize size="5" maxlength="2" %>
<% site.select pageMode %></td>
</tr>
<tr>
<td class="small">Comments:</td>
<td><% site.checkbox commentMode %>
<label for="commentMode">enabled</label></td>
</tr>
<tr>
<td class="small">Archive:</td>
<td><% site.checkbox archiveMode %>
<label for="archiveMode">enabled</label></td>
</tr>
<tr>
<td class="small">Language:</td>
<td><% site.select locale %></td>
</tr>
<tr>
<td class="small">Time zone:</td>
<td><% site.select timeZone %></td>
</tr>
<tr>
<td class="small">Long date format:</td>
<td><% site.select longDateFormat %></td>
</tr>
<tr>
<td class="small">Short date format:</td>
<td><% site.select shortDateFormat %></td>
</tr>
<tr>
<td class="small">Notifications:</td>
<td><% site.select notificationMode %></td>
</td>
</tr>
<tr>
<td class="small" valign="top">Web hook:</td>
<td><% site.input webHookUrl %><br />
<% site.checkbox webHookMode %>
<label for="webHookMode">enabled<label></td>
</tr>
<!--tr>
<td colspan="2"><div class="listSeparator">&nbsp;</div>
<strong><a name="spamfilter">Referrer spam filter</a></strong></td>
</tr>
<tr>
<td class="small" valign="top">Enter one
<a href="http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/regexp.html">filter pattern</a>
per line to be applied on every URL in the referrer and backlink lists.</td>
<td valign="top"><% site.textarea spamfilter cols="30" rows="7" %></td>
</tr-->
<tr>
<td></td>
<td><br />
<button type="submit" name="save" value="1">save</button>
<button type="submit" name="cancel" value="1">cancel</button></td>
</tr>
</table>
</form>
<% #preview %>
<li><% site.title | site.link %>
<span class="small"><% site.modified | age %></span></li>
@ -92,93 +173,7 @@ REGEDIT4
@="<% site.url %>menuext"
"contexts"=hex:31
<% #edit %>
<form id="prefs" method="post" action="<% response.action %>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2">
<strong><a name="general">General</a></strong>
</td>
</tr>
<tr>
<td class="small">Mode:</td>
<td><% site.select mode %></td>
</tr>
<tr>
<td class="small">Title:</td>
<td><% site.input title %></td>
</tr>
<tr>
<td class="small">Tagline:</td>
<td><% site.input tagline %></td>
</tr>
<tr>
<td class="small">Paging:</td>
<td><% site.input pageSize size="5" maxlength="2" %>
<% site.select pageMode %></td>
</tr>
<tr>
<td class="small">Comments:</td>
<td><% site.checkbox commentMode %>
<label for="commentMode">enabled</label></td>
</tr>
<tr>
<td class="small">Archive:</td>
<td><% site.checkbox archiveMode %>
<label for="archiveMode">enabled</label></td>
</tr>
<tr>
<td class="small">Language:</td>
<td><% site.select locale %></td>
</tr>
<tr>
<td class="small">Time zone:</td>
<td><% site.select timeZone %></td>
</tr>
<tr>
<td class="small">Long date format:</td>
<td><% site.select longDateFormat %></td>
</tr>
<tr>
<td class="small">Short date format:</td>
<td><% site.select shortDateFormat %></td>
</tr>
<tr>
<td class="small">Notifications:</td>
<td><% site.select notificationMode %></td>
</td>
</tr>
<tr>
<td class="small" valign="top">Web hook:</td>
<td><% site.input webHookUrl %><br />
<% site.checkbox webHookMode %>
<label for="webHookMode">enabled<label></td>
</tr>
<!--tr>
<td colspan="2"><div class="listSeparator">&nbsp;</div>
<strong><a name="spamfilter">Referrer spam filter</a></strong></td>
</tr>
<tr>
<td class="small" valign="top">Enter one
<a href="http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/regexp.html">filter pattern</a>
per line to be applied on every URL in the referrer and backlink lists.</td>
<td valign="top"><% site.textarea spamfilter cols="30" rows="7" %></td>
</tr-->
<tr>
<td></td>
<td><br />
<button type="submit" name="save" value="1">save</button>
<button type="submit" name="cancel" value="1">cancel</button></td>
</tr>
</table>
</form>
<% #referrerItem %>
referrers.push(new Antville.Referrer("<% param.referrer %>",
"<% param.text %>", <% param.requests %>));
<% #referrers %>
<form action="<% response.action %>" method="get">
<input type="text" name="filter" value="<% request.filter encoding="form" %>"
size="30" />
@ -248,6 +243,10 @@ for (var i in referrers) {
</table>
</form>
<% #referrer %>
referrers.push(new Antville.Referrer("<% param.referrer %>",
"<% param.text %>", <% param.requests %>));
<% #values %>
<% value "background color" #ffffff %>
<% value "link color" #ff4040 %>

View file

@ -20,7 +20,7 @@ Name: <% skin.input name %>
</table>
</form>
<% #skins %>
<% #listItem %>
<li>
<% skin.link edit <% skin.name %> %>
<% if <% skin.status %> is modified then

View file

@ -55,7 +55,7 @@ Skins.prototype.main_action = function() {
var group = path[offset + 3];
if (!group) {
res.data.list = this.getOutline();
res.data.title = gettext("Skins of {0}", res.handlers.layout.title);
res.data.title = gettext("Skins of {0}", res.handlers.site.title);
res.data.body = this.renderSkinAsString("main");
res.handlers.site.renderSkin("Site#page");
return;
@ -64,19 +64,6 @@ Skins.prototype.main_action = function() {
skin = new Skin(group.name, skin.name);
skin.edit_action();
return;
res.debug("skins: " + skins);
res.debug("group: " + group.name);
res.debug("skin: " + skin.name);
var skinFiles = app.getSkinfilesInPath(res.skinpath)[group.name];
var source = skinFiles[skin.name];
if (!source) {
skin = createSkin(skinFiles[group.name]).getSubskin(skin.name);
source = skin && skin.getSource();
}
res.encode(source);
return;
};
Skins.prototype.getOutline = function(type) {
@ -129,13 +116,6 @@ Skins.prototype.getOutline = function(type) {
}
html.closeTag("ul");
return this.cache[key] = res.pop();
var outline = this.cache.outline || []
if (outline.length > 0) {
return outline;
}
this.cache.outline = outline;
return outline;
};
Skins.prototype.create_action = function() {

View file

@ -44,7 +44,7 @@ Stories.prototype.getPermission = function(action) {
Stories.prototype.main_action = function() {
var stories = User.getMembership().stories;
res.data.list = renderList(stories, "Story#stories",
res.data.list = renderList(stories, "Story#listItem",
10, req.queryParams.page);
res.data.pager = renderPager(stories,
this.href(req.action), 10, req.queryParams.page);
@ -79,7 +79,7 @@ Stories.prototype.create_action = function() {
Stories.prototype.closed_action = function() {
res.data.list = renderList(this.closed,
"Story#stories", 10, req.queryParams.page);
"Story#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(this.offline,
this.href(req.action), 10, req.queryParams.page);
res.data.title = gettext("Private stories of {0}", this._parent.title);
@ -89,7 +89,7 @@ Stories.prototype.closed_action = function() {
};
Stories.prototype.all_action = function() {
res.data.list = renderList(this, "Story#stories", 10, req.queryParams.page);
res.data.list = renderList(this, "Story#listItem", 10, req.queryParams.page);
res.data.pager = renderPager(this,
this.href(), 10, req.queryParams.page);
res.data.title = gettext("Stories of {0}", this._parent.title);

View file

@ -10,7 +10,38 @@
<p><% story.comments %></p>
<p><% story.backlinks %></p>
<% #day %>
<% #edit %>
<% story.skin Story#restore %>
<form method="post" action="<% response.action %>">
<p>
<div class="small">Title:</div>
<div class="backup"><% story.input title class="formTitle" %></div>
</p>
<p>
<div class="small">Text:</div>
<div class="backup"><% story.textarea text cols="30" rows="15"
class="formText" %></div>
</p>
<p><fieldset>
<legend class="small">Options</legend>
<p>Tags: <% story.input tags %></p>
<p>The story is <% story.select status %> and <% story.select mode %></p>
<p>Comments of the story are <% story.select commentMode %></p>
</fieldset></p>
<p class="small">
<% story.creator prefix="Created by " %>
<% story.created short prefix=" on " suffix="<br />" %>
<% story.modifier prefix="Last modified by " %>
<% story.modified short prefix=" on " %>
</p>
<p>
<button type="submit" name="save" value="1">save</button>
<button type="submit" name="cancel" value="1">cancel</button>
<button type="button" id="restore" value="1">restore</button>
</p>
</form>
<% #date %>
<div class="dayHeader"><% story.created format="EEEE, d. MMMM yyyy" %></div>
<% #content %>
@ -66,7 +97,7 @@
<% story.skin Story#day %>
<% story.skin Story#content %>
<% #stories %>
<% #listItem %>
<div class="listSeparator"> </div>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
@ -205,34 +236,3 @@ $(function() {
});
//-->
</script>
<% #edit %>
<% story.skin Story#restore %>
<form method="post" action="<% response.action %>">
<p>
<div class="small">Title:</div>
<div class="backup"><% story.input title class="formTitle" %></div>
</p>
<p>
<div class="small">Text:</div>
<div class="backup"><% story.textarea text cols="30" rows="15"
class="formText" %></div>
</p>
<p><fieldset>
<legend class="small">Options</legend>
<p>Tags: <% story.input tags %></p>
<p>The story is <% story.select status %> and <% story.select mode %></p>
<p>Comments of the story are <% story.select commentMode %></p>
</fieldset></p>
<p class="small">
<% story.creator prefix="Created by " %>
<% story.created short prefix=" on " suffix="<br />" %>
<% story.modifier prefix="Last modified by " %>
<% story.modified short prefix=" on " %>
</p>
<p>
<button type="submit" name="save" value="1">save</button>
<button type="submit" name="cancel" value="1">cancel</button>
<button type="button" id="restore" value="1">restore</button>
</p>
</form>

View file

@ -31,7 +31,7 @@ Tag.prototype.constructor = function(name, site, type) {
Tag.prototype.main_action = function() {
res.handlers.list = new jala.ListRenderer(this.getTagged());
res.data.body = this.renderSkinAsString("Tag");
res.data.body = this.renderSkinAsString("Tag#main");
res.handlers.site.renderSkin("Site#page");
return;
};

View file

@ -1,3 +1,4 @@
<% #main %>
<div class="pagelink"><% breadcrumbs %>
<% if <% tag.permission edit %> is true then <% tag.skin name="Tag#controls" %> %>
</div><br />
@ -6,7 +7,7 @@
<% list.render skin="TagHub" %>
<% list.nextLink %>
<% #item %>
<% #listItem %>
<li>
<a href="<% tag.href action=<% request.action encoding="form" %> %>"><% tag.name %></a>
</li>

View file

@ -164,7 +164,7 @@ Tags.prototype.list_macro = function(param, skin) {
if (item.constructor !== Tag) {
item = item.get(0);
}
item.renderSkin(skin || "Tag#item", {index: index});
item.renderSkin(skin || "Tag#listItem", {index: index});
index += 1;
}
return;

View file

@ -112,7 +112,7 @@ User.prototype.list_macro = function(param, type) {
memberships.forEach(function(membership) {
var site;
if (site = membership.get("site")) {
site.renderSkin("Site#list");
site.renderSkin("Site#preview");
}
return;
});
@ -135,7 +135,7 @@ User.register = function(data) {
// check if username is existing and is clean
// can't use isClean() here because we accept
// special characters like umlauts and spaces
var invalidChar = new RegExp("[^a-zA-Z0-9äöüß\\.\\-_ ]");
var invalidChar = new RegExp("[^a-zA-Z0-9<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\\.\\-_ ]");
if (!data.name) {
throw Error(gettext("Please enter a username."));
} else if (data.name.length > 30) {