Mercurial > hg > nginx-site
diff xsls/download.xsls @ 727:b2b10d564893
Simplified nginx versions maintenance by providing only
a single list in versions.xml.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Sat, 13 Oct 2012 18:15:55 +0000 |
parents | 81ad082bc837 |
children | 68e8c8dc9489 |
line wrap: on
line diff
--- a/xsls/download.xsls +++ b/xsls/download.xsls @@ -5,16 +5,32 @@ X:stylesheet { -X:template = "download" { <table width="100%"> !! "item"; </table> } +X:template = "download" { + X:var last="@last" + X:for-each "document(concat($XML, '/versions.xml')) + /versions/download[@tag = current()/@tag]" { + <table width="100%"> + + !! "item[position() <= $last]"; + + </table> + } +} -X:template = "download/item[position() <= ../@last]" { +X:template = "download/item" { <tr> <td width="20%"> X:if "position() = 1" { <a> - X:attribute "href" { X:text{/} !{/article/@lang} X:text{/} !{../@changes} } - !{../@changes} + X:attribute "href" { + X:text{/} !{$LANG} X:text{/CHANGES} + X:if "$LANG != 'en'" { X:text{.} !{$LANG} } + X:if "../@changes != ''" { X:text{-} !{../@changes} } + } + X:text{CHANGES} + X:if "$LANG != 'en'" { X:text{.} !{$LANG} } + X:if "../@changes != ''" { X:text{-} !{../@changes} } </a> } </td> @@ -62,7 +78,4 @@ X:template = "download/item[position() & </tr> } - -X:template = "download/item[position() > ../@last]" { } - }