antville/code/Story/Story.skin
Tobi Schäfer 84492cc922 * Modified HopObject.link_macro() to automatically capitalize the default link text
* Added global i18n.js file containing markgettext() calls
 * Wrapped messages with gettext macros wherever found missing
 * Moved contents of remaining diff skin files to Skin.skin
 * Removed Layouts prototype
 * Removed obsolete files
2008-03-27 15:10:31 +00:00

238 lines
7.2 KiB
Text

<% #main %>
<% story.skin Story#date %>
<% story.skin Story#content %>
<p class="small">
<% story.link comment#form prefix="... " %>
<% story.link edit prefix=" ... " %>
<% story.link online prefix=" ... " %>
</p>
<a name="comments" id="comments"></a>
<p><% story.comments %></p>
<p><% story.backlinks %></p>
<% #edit %>
<% story.skin Story#restore %>
<form method="post" action="<% response.action %>">
<p>
<div class="small"><% gettext Title suffix=: %></div>
<div class="backup"><% story.input title class="formTitle" %></div>
</p>
<p>
<div class="small"><% gettext Text suffix=: %></div>
<div class="backup"><% story.textarea text cols="30" rows="15"
class="formText" %></div>
</p>
<p><fieldset>
<legend class="small"><% gettext Options %></legend>
<p><% gettext Tags suffix=: %> <% story.input tags %></p>
<p><% gettext "The story is {0} and {1}" <% story.select status %>
<% story.select mode %> %></p>
<p><% gettext "Comments of the story are {0}" <% story.select commentMode %> %></p>
</fieldset></p>
<p class="small">
<% gettext "Created by {0} on {1}" <% story.creator %>
<% story.created short %> %>
<% if <% story.created %> is <% story.modified %> then "" else
<% gettext "Last modified by {0} on {1}" <% story.modifier %>
<% story.modified short %> prefix="<br />" %>
%>
</p>
<p>
<button type="submit" name="save" value="1"><% gettext Save %></button>
<button type="button" id="restore" value="1"><% gettext Restore %></button>
<a href="" class="cancel"><% gettext Cancel %></a>
</p>
</form>
<% #date %>
<div class="dayHeader"><% story.created format="EEEE, d. MMMM yyyy" %></div>
<% #content %>
<div class="storyTitle">
<% story.title %>
</div>
<div class="storyDate">
<% story.creator link %>
<% story.created HH:mm suffix="h" %>
</div>
<div><% story.text | story.format %></div>
<% #preview %>
<% story.skin Story#content %>
<p class="small">
<% story.link . link prefix="... " %>
<% story.comments link prefix="(" suffix=")" %>
<% story.link comment#form prefix=" ... " %>
<% story.link edit prefix=" ... " %>
</p>
<br />
<% #embed %>
<% story.title prefix='<div class="storyTitle">'suffix="</div>" %>
<% story.text | clip %>
<span class="small">
<% story.link . <% gettext "Read more" prefix=[ suffix=] %> %>
<% story.link edit <% gettext Edit %> prefix=" ... " %>
</span><br />
<% #history %>
<div class="historyItem">
<% story.summary %>
<div class="small">
by <% story.creator %> (<% story.modified short %>)
</div>
</div>
<% #result %>
<br /><% story.summary %>
<div class="small">by <% story.creator %> (<% story.modified short %>)</div>
<% #top %>
<tr>
<td align="right" valign="baseline" class="small"><% param.position %></td>
<td align="right" valign="baseline"><% story.requests %></td>
<td valign="baseline"><% story.created "yyyy-MM-dd" %></td>
<td valign="baseline"><% story.title | story.link %></td>
<td valign="baseline"><% story.creator %></td>
</tr>
<% #comment %>
<% story.skin Story#date %>
<% story.skin Story#content %>
<% #listItem %>
<div class="listSeparator"> </div>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<% if <% story.status %> is closed then
'<td rowspan="2" width="10" align="center" valign="top" nowrap="nowrap"
class="listFlag">c<br />l<br />o<br />s<br />e<br />d</td>
<td rowspan="2" width="5" nowrap="nowrap"></td>'
else <% if <% story.mode %> is hidden then
'<td rowspan="2" width="10" align="center" valign="top" nowrap="nowrap"
class="listFlag">h<br />i<br />d<br />d<br />e<br />n</td>
<td rowspan="2" width="5" nowrap="nowrap"></td>' %>
%>
<td colspan="3" class="small">
<strong><% gettext Macro suffix=: %></strong> <% story.macro %><br />
<div class="ample"><strong><% gettext Status suffix=: %></strong>
<% story.status %><% story.tags link prefix=" in " %>,
<% story.comments link %></div>
</td>
</tr>
<tr valign="top">
<td>
<div class="storyTitle"><% story.title %></div>
<div class="storyDate"><% gettext "{0} on {1}" <% story.creator link %>
<% story.created short %> %></div>
<% story.text | clip %>
</td>
<td width="10" nowrap="nowrap"> </td>
<td align="right" class="small">
<% story.link edit prefix="... " suffix="<br />" %>
<% story.link . view prefix="... " suffix="<br />" %>
<% story.link rotate prefix="... " suffix="<br />" %>
<% story.link delete prefix="... " %>
</td>
</tr>
</table>
<% #backlink %>
referrers.push(new Antville.Referrer("<% param.referrer %>",
"<% param.text %>", <% param.requests %>));
<% #backlinks %>
<a name="backlinks" id="backlinks"></a><br />
<table border="0" cellspacing="0" cellpadding="1">
<script type="text/javascript"><!--
var referrers = [];
<% param.referrers %>
var query = new Antville.Query();
var spamFilter = new Antville.Filter([<% site.spamfilter %>]);
var searchFilter = new Antville.Filter(query.filter);
var searchEngineFilters = [
new Antville.Filter("http:\/\/.*google.*\?", "q"),
new Antville.Filter("http:\/\/.*search\.msn.*\?", "q"),
new Antville.Filter("http:\/\/.*altavista.*\?", "q"),
new Antville.Filter("http:\/\/.*search\.yahoo.*\?", "p"),
];
var cnt = 0;
var prefix = "<em>Search request:</em> ";
for (var i in referrers) {
var ref = referrers[i];
var text = ref.text;
if (spamFilter.test(ref.url)) {
continue;
}
if (query.filter && !searchFilter.test(ref.url)) {
continue;
}
for (var e in searchEngineFilters) {
var filter = searchEngineFilters[e];
if (filter.test(ref.url)) {
text = ref.compose(filter.key, prefix);
break;
}
}
if (++cnt == 1) {
document.writeln('<tr>');
document.writeln('<td align="right" class="small">&nbsp;</td>');
document.writeln('<td rowspan="999" class="small">&nbsp;&nbsp;</td>');
document.writeln('<td class="small"><strong>Backlinks</strong></td>');
document.writeln('</tr>');
}
document.writeln('<tr>');
document.writeln('<td align="right" valign="top" class="small">',
ref.count, '</td>');
document.writeln('<td class="small"><a href="', ref.url, '">',
text, '</a></td>');
document.writeln('</tr>');
}
//--></script>
<noscript>
<tr>
<td colspan="3">
<% site.skin noscript %>
</td>
</tr>
</noscript>
</table>
<% #restore %>
<script type="text/javascript">
<!--
$(function() {
if (!"<% session.backup %>") {
$("#restore").hide();
} else {
$("#restore").click(function() {
$("#title").val(decodeURIComponent("<% session.backup.title %>"));
$("#text").val(decodeURIComponent("<% session.backup.text %>"));
$(this).hide();
return;
});
}
var currentTitle, currentText;
$(".backup > :input").blur(function() {
var title = $.trim($("#title").val());
var text = $.trim($("#text").val());
if ((title || text) && (currentTitle || currentText) &&
(currentTitle !== title || currentText !== text)) {
$.ajax({
async: true,
type: "POST",
url: '<% root.href backup.js %>',
data: {title: encodeURIComponent(title),
text: encodeURIComponent(text)},
dataType: "json"
});
}
currentTitle = title;
currentText = text
return;;
});
return;
});
//-->
</script>