Browse Source

began implementing dynamic list of country team members to country team homepage

svn path=/branches/design/; revision=18724
tags/stw2018
samtuke 8 years ago
parent
commit
a67f16e0d0
2 changed files with 136 additions and 3 deletions
  1. 6
    3
      about/germany/germany.en.xhtml
  2. 130
    0
      about/germany/germany.xsl

+ 6
- 3
about/germany/germany.en.xhtml View File

@@ -9,8 +9,11 @@
<p id="category"><a href="/about/people/people.html">People</a></p>
<h1>Germany</h1>
<h2>Coordinators</h2>
<ul class="people">
<h2>Coordinators</h2>
<country-team-list />
<!--<ul class="people">
<li><p><a href="/about/coughlan/coughlan.en.html"><img alt="Shane M.
Coughlan" src="/about/coughlan/coughlan48.jpg" /></a><span class="name"><a
href="/about/coughlan/coughlan.en.html">Shane M. Coughlan</a></span><span
@@ -19,7 +22,7 @@
src="/about/gerloff/gerloff48.jpg" /></a><span class="name"><a
href="/about/gerloff/gerloff.en.html">Karsten Gerloff</a></span><span
class="email"><i>gerloff (at) fsfeurope (dot) org</i></span></p></li>
</ul>
</ul>-->
<h2>Contact</h2>
<address>

+ 130
- 0
about/germany/germany.xsl View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>

<!-- Fill dynamic content -->
<xsl:template match="country-team-list">
<xsl:element name="ul">
<xsl:attribute name="class">people</xsl:attribute>
<xsl:for-each select="/html/set/person[@team='yes']">
<xsl:for-each select="/html/set/person[@chapter_de='yes']">
<xsl:sort select="@id"/>
<xsl:element name="li">
<xsl:element name="p">
<!-- Picture -->
<xsl:choose>
<xsl:when test="link != ''">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="alt">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="not(avatar)">/graphics/default-avatar.png</xsl:when>
<xsl:otherwise><xsl:value-of select="avatar"/></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="img">
<xsl:attribute name="alt">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="avatar"/>
</xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>

<!-- Name; if link is given show as link -->
<xsl:element name="span">
<xsl:attribute name="class">name</xsl:attribute>
<xsl:choose>
<xsl:when test="link != ''">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="name"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>

<!-- E-mail -->
<xsl:element name="span">
<xsl:attribute name="class">email</xsl:attribute>
<xsl:if test="email != ''">
<xsl:value-of select="email"/>
</xsl:if>
</xsl:element>

<!-- Functions -->
<xsl:for-each select="function">
<xsl:if test="position()!=1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:variable name="function"><xsl:value-of select="."/></xsl:variable>
<xsl:apply-templates select="/html/set/function[@id=$function]/node()"/>
<xsl:if test="@country != ''">
<xsl:text> </xsl:text>
<xsl:variable name="country"><xsl:value-of select="@country"/></xsl:variable>
<xsl:value-of select="/html/set/country[@id=$country]"/>
</xsl:if>
<xsl:if test="@project != ''">
<xsl:text> </xsl:text>
<xsl:variable name="project"><xsl:value-of select="@project"/></xsl:variable>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="/html/set/project[@id=$project]/link"/>
</xsl:attribute>
<xsl:value-of select="/html/set/project[@id=$project]/title"/>
</xsl:element>
</xsl:if>
<xsl:if test="@volunteers != ''">
<xsl:text> </xsl:text>
<xsl:variable name="volunteers"><xsl:value-of select="@volunteers"/></xsl:variable>
<xsl:apply-templates select="/html/set/volunteers[@id=$volunteers]/node()"/>
</xsl:if>
</xsl:for-each>

</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:element>
</xsl:template>

<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>

<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Loading…
Cancel
Save