diff options
author | dakkar <dakkar@thenautilus.net> | 2012-09-23 18:56:07 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2012-09-23 20:37:21 +0100 |
commit | 9c9a41ce0d3773040d4b9a62c4c99c62196c418d (patch) | |
tree | c3e3ab1d1ef1ae9c3d1fd66e8ae5bcb9e39573a3 /templates/du2html.xsl | |
parent | anime bump (diff) | |
download | thenautilus-9c9a41ce0d3773040d4b9a62c4c99c62196c418d.tar.gz thenautilus-9c9a41ce0d3773040d4b9a62c4c99c62196c418d.tar.bz2 thenautilus-9c9a41ce0d3773040d4b9a62c4c99c62196c418d.zip |
infrastructure for reviews
Diffstat (limited to 'templates/du2html.xsl')
-rw-r--r-- | templates/du2html.xsl | 262 |
1 files changed, 162 insertions, 100 deletions
diff --git a/templates/du2html.xsl b/templates/du2html.xsl index 6d77a6c..c16998c 100644 --- a/templates/du2html.xsl +++ b/templates/du2html.xsl @@ -165,20 +165,9 @@ <html xml:lang="{$language}" lang="{$language}"> <head> <title><x:value-of select="normalize-space(title)"/></title> - <link rel="stylesheet" type="text/css" href="/layout.css" media="screen" /> - <link rel="stylesheet" type="text/css" href="/print.css" media="print" /> - <link rel="stylesheet" type="text/css" href="/html4css1.css" /> - <link rel="stylesheet" type="text/css" href="/content.css" /> + <x:apply-templates select="." mode="stylesheet" /> <link rel="icon" type="image/png" href="/favicon.png" /> <x:apply-templates select="docinfo/field[field_name='feed']"/> - <x:for-each select="docinfo/field[field_name='css']/field_body/*/list_item|docinfo/field[field_name='css']/field_body/paragraph"> - <link rel="stylesheet" type="text/css" href="{normalize-space(.)}" /> - </x:for-each> - <x:for-each select="docinfo/field[field_name='inline-css']/field_body"> - <style type="text/css"> - <x:value-of select="." disable-output-escaping="yes" /> - </style> - </x:for-each> <x:apply-templates select="docinfo" mode="nav-links" /> <x:if test="$path = ''"> <!-- root / index document --> <meta name="google-site-verification" content="NStibYPYcJWPVXEJMnjEOvQazfKubbaz3TrEi64my-Y" /> @@ -187,109 +176,182 @@ <body> <div id="wrapper"> <div id="toplink"> - <a href="/"><img src="/logo.png" alt="thenautilus.net"/></a> + <x:apply-templates select="." mode="top"/> </div> <div id="title"> - <h1 class="title"> - <x:apply-templates select="title/node()"/> - </h1> - <x:if test="subtitle"> - <h2 class="subtitle"> - <x:apply-templates select="subtitle/node()"/> - </h2> - </x:if> + <x:apply-templates select="." mode="title"/> </div> <div id="main-col"> - <x:apply-templates select="docinfo" mode="tags" /> - <x:call-template name="alternate-langs" /> + <x:apply-templates select="." mode="topnav"/> <div id="content"> - <x:apply-templates/> + <x:apply-templates select="." mode="content"/> </div> - <x:call-template name="dates" /> + <x:apply-templates select="." mode="bottomnav"/> </div> <div id="sidebar"> - <x:apply-templates select="docinfo" mode="nav-block" /> - <div class="nav" id="nav-tags"> - <span class="title"><x:value-of select="$const-tr[@t='navtags' and @l=$language]" /></span> - <ul> - <li><x:call-template name="taglink"><x:with-param name="tag">hardware</x:with-param></x:call-template></li> - <li><x:call-template name="taglink"><x:with-param name="tag">software</x:with-param></x:call-template></li> - <x:if test="$language = 'it'"> <!-- non ci sono racconti in inglese, per ora --> - <li><x:call-template name="taglink"><x:with-param name="tag">racconti</x:with-param></x:call-template></li> - </x:if> - <li><x:call-template name="taglink"><x:with-param name="tag">viaggi</x:with-param></x:call-template></li> - </ul> - <a href="{wc:dst-uri-for('/tags/')}"><x:value-of select="$const-tr[@t='alltags' and @l=$language]"/></a> - <hr /> - <a href="{wc:dst-uri-for('/contacts/')}"><x:apply-templates select="wc:title-for($language,$filename,'/contacts/')/node()" /></a> - </div> - <!-- twitter --> - <div id="twtr-profile-widget"></div> - <script src="http://widgets.twimg.com/j/2/widget.js"></script> - <script> - new TWTR.Widget({ - version: 2, - type: 'profile', - id: 'twtr-profile-widget', - rpp: 4, - interval: 6000, - width: 150, - height: 100, - theme: { - shell: { - background: '#2b687c', - color: '#eeeeee' - }, - tweets: { - background: '#b3dbe9', - color: '#444444', - links: '#1985b5' - } - }, - features: { - scrollbar: false, - loop: true, - live: true, - hashtags: true, - timestamp: true, - avatars: false, - behavior: 'all' - } - }).render().setUser('dakkar').start(); - </script> - <!-- amazon --> - <div id="amazon-wishlist"> - <a href="http://www.amazon.co.uk/registry/wishlist/INP247PNKQSZ"> - <x:value-of select="$const-tr[@t='wishlist' and @l=$language]"/> - </a> - </div> + <x:apply-templates select="." mode="sidebar"/> </div> <div id="push"></div> </div> <div id="footer"> - <p class="license"> - <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/it/"> - <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/2.5/it/88x31.png" /> - </a> - “<span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type"> - <x:value-of select="normalize-space(/document/title)"/> - </span>” - <x:value-of select="$const-tr[@t='by' and @l=$language]"/> - <a xmlns:cc="http://creativecommons.org/ns#" href="mailto:dakkar@thenautilus.net" property="cc:attributionName" rel="cc:attributionURL">Gianni Ceccarelli</a> - <x:value-of select="$const-tr[@t='license' and @l=$language]"/> - <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/it/">Creative Commons By-SA 2.5 It</a>. - </p> - <p class="contacts"> - <x:value-of select="$const-tr[@t='comments' and @l=$language]"/> - <a href="mailto:dakkar@thenautilus.net?subject={s:encode-uri(concat($const-tr[@t='mailsubj' and @l=$language],normalize-space(string(/document/title))),false)}"> - <x:value-of select="$const-tr[@t='writeme' and @l=$language]"/> - </a>. - </p> + <x:apply-templates select="." mode="footer"/> </div> </body> </html> </x:template> + <x:template match="/document" mode="top"> + <a href="/"><img src="/logo.png" alt="thenautilus.net"/></a> + </x:template> + + <x:template match="/document" mode="title"> + <h1 class="title"> + <x:apply-templates select="title/node()"/> + </h1> + <x:if test="subtitle"> + <h2 class="subtitle"> + <x:apply-templates select="subtitle/node()"/> + </h2> + </x:if> + </x:template> + + <x:template match="/document" mode="stylesheet"> + <x:apply-templates select="." mode="stylesheet-global"/> + <x:apply-templates select="." mode="stylesheet-local"/> + </x:template> + + <x:template match="/document" mode="stylesheet-global"> + <link rel="stylesheet" type="text/css" href="/layout.css" media="screen" /> + <link rel="stylesheet" type="text/css" href="/print.css" media="print" /> + <link rel="stylesheet" type="text/css" href="/html4css1.css" /> + <link rel="stylesheet" type="text/css" href="/content.css" /> + </x:template> + + <x:template match="/document" mode="stylesheet-local"> + <x:for-each select="docinfo/field[field_name='css']/field_body/*/list_item|docinfo/field[field_name='css']/field_body/paragraph"> + <link rel="stylesheet" type="text/css" href="{normalize-space(.)}" /> + </x:for-each> + <x:for-each select="docinfo/field[field_name='inline-css']/field_body"> + <style type="text/css"> + <x:value-of select="." disable-output-escaping="yes" /> + </style> + </x:for-each> + </x:template> + + <x:template match="/document" mode="topnav"> + <x:apply-templates select="docinfo" mode="tags" /> + <x:apply-templates select="." mode="alternate-langs" /> + </x:template> + + <x:template match="/document" mode="content"> + <x:apply-templates/> + </x:template> + + <x:template match="/document" mode="bottomnav"> + <x:apply-templates select="." mode="dates" /> + </x:template> + + <x:template match="/document" mode="sidebar"> + <x:apply-templates select="." mode="navblock"/> + <x:apply-templates select="." mode="navtags"/> + <x:apply-templates select="." mode="twitter"/> + <x:apply-templates select="." mode="amazon"/> + </x:template> + + <x:template match="/document" mode="navblock"> + <x:apply-templates select="docinfo" mode="nav-block" /> + </x:template> + + <x:template match="/document" mode="navtags"> + <div class="nav" id="nav-tags"> + <span class="title"><x:value-of select="$const-tr[@t='navtags' and @l=$language]" /></span> + <ul> + <li><x:call-template name="taglink"><x:with-param name="tag">hardware</x:with-param></x:call-template></li> + <li><x:call-template name="taglink"><x:with-param name="tag">software</x:with-param></x:call-template></li> + <x:if test="$language = 'it'"> <!-- non ci sono racconti in inglese, per ora --> + <li><x:call-template name="taglink"><x:with-param name="tag">racconti</x:with-param></x:call-template></li> + </x:if> + <li><x:call-template name="taglink"><x:with-param name="tag">viaggi</x:with-param></x:call-template></li> + </ul> + <a href="{wc:dst-uri-for('/tags/')}"><x:value-of select="$const-tr[@t='alltags' and @l=$language]"/></a> + <hr /> + <a href="{wc:dst-uri-for('/contacts/')}"><x:apply-templates select="wc:title-for($language,$filename,'/contacts/')/node()" /></a> + </div> + </x:template> + + <x:template match="/document" mode="twitter"> + <div id="twtr-profile-widget"></div> + <script src="http://widgets.twimg.com/j/2/widget.js"></script> + <script> + new TWTR.Widget({ + version: 2, + type: 'profile', + id: 'twtr-profile-widget', + rpp: 4, + interval: 6000, + width: 150, + height: 100, + theme: { + shell: { + background: '#2b687c', + color: '#eeeeee' + }, + tweets: { + background: '#b3dbe9', + color: '#444444', + links: '#1985b5' + } + }, + features: { + scrollbar: false, + loop: true, + live: true, + hashtags: true, + timestamp: true, + avatars: false, + behavior: 'all' + } + }).render().setUser('dakkar').start(); + </script> + </x:template> + + <x:template match="/document" mode="amazon"> + <div id="amazon-wishlist"> + <a href="http://www.amazon.co.uk/registry/wishlist/INP247PNKQSZ"> + <x:value-of select="$const-tr[@t='wishlist' and @l=$language]"/> + </a> + </div> + </x:template> + + <x:template match="/document" mode="footer"> + <x:apply-templates select="." mode="license"/> + <x:apply-templates select="." mode="contacts"/> + </x:template> + + <x:template match="/document" mode="license"> + <p class="license"> + <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/it/"> + <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/2.5/it/88x31.png" /> + </a> + “<span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type"> + <x:value-of select="normalize-space(/document/title)"/> + </span>” + <x:value-of select="$const-tr[@t='by' and @l=$language]"/> + <a xmlns:cc="http://creativecommons.org/ns#" href="mailto:dakkar@thenautilus.net" property="cc:attributionName" rel="cc:attributionURL">Gianni Ceccarelli</a> + <x:value-of select="$const-tr[@t='license' and @l=$language]"/> + <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/it/">Creative Commons By-SA 2.5 It</a>. + </p> + </x:template> + + <x:template match="/document" mode="contacts"> + <p class="contacts"> + <x:value-of select="$const-tr[@t='comments' and @l=$language]"/> + <a href="mailto:dakkar@thenautilus.net?subject={s:encode-uri(concat($const-tr[@t='mailsubj' and @l=$language],normalize-space(string(/document/title))),false)}"> + <x:value-of select="$const-tr[@t='writeme' and @l=$language]"/> + </a>. + </p> + </x:template> + <x:template name="taglink"> <x:param name="tag"/> <a href="{wc:dst-uri-for(concat('/tags/',$tag,'/'))}"> @@ -297,7 +359,7 @@ </a> </x:template> - <x:template name="dates"> + <x:template match="/document" mode="dates"> <x:variable name="d" select="wc:dates-for($language,$filename,'./')/wc:dates"/> <div id="dates"> <span class="title"><x:value-of select="$const-tr[@t='dates' and @l=$language]" /></span> @@ -313,7 +375,7 @@ </div> </x:template> - <x:template name="alternate-langs"> + <x:template match="/document" mode="alternate-langs"> <x:variable name="me" select="wc:dst-uri-for('.',/document/@source,1)" /> <x:variable name="alts"> <x:for-each select="wc:changes()/wc:changes/wc:document[@uri=$me]"> |