aboutsummaryrefslogtreecommitdiff
path: root/t/test-site
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2009-01-08 16:34:23 +0000
committerdakkar <dakkar@luxion>2009-01-08 16:34:23 +0000
commit74927a08f548ed3ce6bc330ddce605abb9a02a07 (patch)
tree1b4e82fdaa6cc8f43a51e0bd22649fc00bce52e7 /t/test-site
parente pure i feed multilnigua (diff)
downloadWebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.tar.gz
WebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.tar.bz2
WebCoso-74927a08f548ed3ce6bc330ddce605abb9a02a07.zip
aggirato il problema dei titoli che in alcune lingue non esistono
git-svn-id: svn://luxion/repos/WebCoso/trunk@407 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 't/test-site')
-rw-r--r--t/test-site/src/common/base-feed.tt2
-rw-r--r--t/test-site/src/common/du2html.xsl25
-rw-r--r--t/test-site/src/common/fillFeed.xsl2
-rw-r--r--t/test-site/src/en-only/document.en.rest.txt7
l---------t/test-site/src/en-only/du2html.xsl1
l---------t/test-site/src/tags/two/feed.en.tt1
l---------t/test-site/src/tags/two/feed.it.tt1
l---------t/test-site/src/tags/two/fillFeed.xsl1
8 files changed, 35 insertions, 5 deletions
diff --git a/t/test-site/src/common/base-feed.tt b/t/test-site/src/common/base-feed.tt
index 2559f29..d91ec0e 100644
--- a/t/test-site/src/common/base-feed.tt
+++ b/t/test-site/src/common/base-feed.tt
@@ -19,7 +19,7 @@
<a:entry>
[% IF changed.$doc.creation %]<a:published>[% df.format(changed.$doc.creation) %]</a:published>[% END %]
[% IF changed.$doc.last_change %]<a:updated>[% df.format(changed.$doc.last_change) %]</a:updated>[% END %]
- <a:id>[% atomIdFor(language,filename,dstUriFor(doc,filename)) %]</a:id>
+ <a:id>tag:thenautilus.net,[% atomIdFor(language,filename,dstUriFor(doc,filename)) %]</a:id>
<a:PH>[% dstUriFor(doc,filename) %]</a:PH>
</a:entry>
[% END -%]
diff --git a/t/test-site/src/common/du2html.xsl b/t/test-site/src/common/du2html.xsl
index 8b73a82..cc4372b 100644
--- a/t/test-site/src/common/du2html.xsl
+++ b/t/test-site/src/common/du2html.xsl
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:e="http://exslt.org/common"
xmlns:wc="http://webcoso.thenautilus.net/"
+ exclude-result-prefixes="wc e"
version="1.0"
>
@@ -11,6 +13,23 @@
<x:param name="path"/>
<x:param name="filename"/>
+ <x:variable name="langs-rtf">
+ <x:choose>
+ <x:when test="$language = 'it'">
+ <lang>it</lang>
+ <lang>en</lang>
+ </x:when>
+ <x:when test="$language = 'en'">
+ <lang>en</lang>
+ <lang>it</lang>
+ </x:when>
+ <x:otherwise> <!-- uh? -->
+ <lang><x:value-of select="$language"/></lang>
+ </x:otherwise>
+ </x:choose>
+ </x:variable>
+ <x:variable name="langs" select="e:node-set($langs-rtf)/node()"/>
+
<x:output method="html" encoding="utf-8"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
indent="yes"/>
@@ -39,7 +58,7 @@
<x:choose>
<x:when test="@refuri and string(.)=string(@refuri)">
- <x:apply-templates select="wc:title-for($language,ancestor::document/@source,@refuri)"/>
+ <x:apply-templates select="wc:title-for($langs,ancestor::document/@source,@refuri)"/>
</x:when>
<x:otherwise>
<x:apply-templates />
@@ -83,7 +102,7 @@
</x:template>
<x:template match="wc:tag">
- <dt><x:apply-templates select="wc:title-for($language,$filename,concat('/tags/',@name,'/'))"/></dt>
+ <dt><x:apply-templates select="wc:title-for($langs,$filename,concat('/tags/',@name,'/'))"/></dt>
<dd>
<ul>
<x:apply-templates/>
@@ -93,7 +112,7 @@
<x:template match="wc:doc">
<li>
- <a href="{@uri}"><x:apply-templates select="wc:title-for($language,$filename,@uri)"/></a>
+ <a href="{@uri}"><x:apply-templates select="wc:title-for($langs,$filename,@uri)"/></a>
(<x:apply-templates/>)
</li>
</x:template>
diff --git a/t/test-site/src/common/fillFeed.xsl b/t/test-site/src/common/fillFeed.xsl
index 30d167b..593ff51 100644
--- a/t/test-site/src/common/fillFeed.xsl
+++ b/t/test-site/src/common/fillFeed.xsl
@@ -38,7 +38,7 @@
</x:template>
<x:template match="a:PH">
- <a:link rel="alternate" type="text/html"><x:value-of select="."/></a:link>
+ <a:link rel="alternate" type="text/html" href="{.}"/>
<a:title type="xhtml">
<div xml:base="{.}">
<x:apply-templates select="wc:title-for($language,$filename,.)/node()"/>
diff --git a/t/test-site/src/en-only/document.en.rest.txt b/t/test-site/src/en-only/document.en.rest.txt
new file mode 100644
index 0000000..d5028bd
--- /dev/null
+++ b/t/test-site/src/en-only/document.en.rest.txt
@@ -0,0 +1,7 @@
+=====================
+ document in English
+=====================
+:tags: * two
+
+only in English!
+
diff --git a/t/test-site/src/en-only/du2html.xsl b/t/test-site/src/en-only/du2html.xsl
new file mode 120000
index 0000000..bea6032
--- /dev/null
+++ b/t/test-site/src/en-only/du2html.xsl
@@ -0,0 +1 @@
+../common/du2html.xsl \ No newline at end of file
diff --git a/t/test-site/src/tags/two/feed.en.tt b/t/test-site/src/tags/two/feed.en.tt
new file mode 120000
index 0000000..7af7c9e
--- /dev/null
+++ b/t/test-site/src/tags/two/feed.en.tt
@@ -0,0 +1 @@
+../../common/base-feed.tt \ No newline at end of file
diff --git a/t/test-site/src/tags/two/feed.it.tt b/t/test-site/src/tags/two/feed.it.tt
new file mode 120000
index 0000000..7af7c9e
--- /dev/null
+++ b/t/test-site/src/tags/two/feed.it.tt
@@ -0,0 +1 @@
+../../common/base-feed.tt \ No newline at end of file
diff --git a/t/test-site/src/tags/two/fillFeed.xsl b/t/test-site/src/tags/two/fillFeed.xsl
new file mode 120000
index 0000000..0ec1e81
--- /dev/null
+++ b/t/test-site/src/tags/two/fillFeed.xsl
@@ -0,0 +1 @@
+../../common/fillFeed.xsl \ No newline at end of file