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

  <xsl:param name="server-root" select="'.'"/>

  <xsl:template match="project">
      <html>
      <head>
        <title>Apache Index - <xsl:value-of select="id"/></title>
        <style type="text/css" media="all">
          @import "http://www.apache.org/style/style.css";
        </style>
        <style type="text/css" media="all">
          @import "<xsl:value-of select="$server-root"/>/../asf-index.css";
        </style>
      </head>
      <body>

       <table border="0" width="100%"><tr>
       <!-- insert category logo in here instead? -->
       <xsl:variable name="org-name">
         <xsl:value-of select="organization/name"/>
       </xsl:variable>
       <xsl:variable name="org-logo">
         <xsl:value-of select="organization/logo"/>
       </xsl:variable>
       <td><img src="{$org-logo}" alt="{$org-name}" /></td>
       <xsl:variable name="name">
         <xsl:value-of select="name"/>
       </xsl:variable>
       <xsl:variable name="logo">
         <xsl:value-of select="url"/><xsl:value-of select="logo"/>
       </xsl:variable>
       <td><img src="{$logo}" alt="{$name}" /></td>
       </tr></table>

<tr><td colspan="3"><hr noshade="noshade" size="1"/></td></tr>

<table width="100%">
<tr>
<td valign="top" nowrap="nowrap" class="navleft">
<div class="menuheader">By Type</div>
<ul>
<li><a href="{$server-root}/categories/servers.html">Servers</a></li>
<li><a href="{$server-root}/categories/tools.html">Tools</a></li>
<li><a href="{$server-root}/categories/frameworks.html">Frameworks</a></li>
</ul>
</td>
<td valign="top">

        <xsl:variable name="url">
          <xsl:value-of select="url"/>
        </xsl:variable>


        <h2><img src="http://www.apache.org/images/redarrow.gif" /><xsl:value-of select="name"/><xsl:if test="shortDescription"> - <xsl:value-of select="shortDescription"/></xsl:if></h2>

        <div class="section-content">
          <a href="{$url}"><xsl:value-of select="$url"/></a><br/>

          <p><xsl:value-of select="description"/></p>

          <xsl:variable name="issueTrackingUrl">
            <xsl:value-of select="issueTrackingUrl"/>
          </xsl:variable>
          <xsl:variable name="repositoryUrl">
            <xsl:value-of select="repository/url"/>
          </xsl:variable>
          <xsl:if test="issueTrackingUrl">
            <p><a href="{$issueTrackingUrl}">Issue Tracker</a></p>
          </xsl:if>
          <xsl:if test="repository/url">
            <p><a href="{$repositoryUrl}">Source Repository</a></p>
          </xsl:if>
          <xsl:if test="package">
            <p>Java package: <xsl:value-of select="package"/></p>
          </xsl:if>
        </div>

        <xsl:if test="mailingLists">
        <h2><img src="http://www.apache.org/images/redarrow.gif" />Mailing Lists</h2>
        <div class="section-content">
             <xsl:for-each select="mailingLists/mailingList">
              <xsl:variable name="archive">
                <xsl:value-of select="archive"/>
              </xsl:variable>
              <xsl:variable name="subscribe">
                <xsl:value-of select="subscribe"/>
              </xsl:variable>
              <xsl:variable name="unsubscribe">
                <xsl:value-of select="unsubscribe"/>
              </xsl:variable>
              <!-- for each mailingLists/mailingList, get name, subscribe, unsubscribe and archive -->
              <ul>
               <li class="project-mailing-list"><xsl:value-of select="name"/> - [<a href="mailto:{$subscribe}">subscribe</a>] [<a href="mailto:{$unsubscribe}">unsubscribe</a>] [<a href="{$archive}">archive</a>]</li>
              </ul>
             </xsl:for-each>
        </div>
        </xsl:if>

        <xsl:if test="children">
        <h2><img src="http://www.apache.org/images/redarrow.gif" /><xsl:value-of select="name"/> contains the following</h2>
        <div class="section-content">
        <table>
        <xsl:for-each select="children/project">
         <xsl:variable name="pom">
           <xsl:value-of select="."/>
         </xsl:variable>
         <xsl:variable name="pom-file">
           projects/<xsl:value-of select="."/>.xml
         </xsl:variable>
         <tr><td class="project-child"><a href="{$server-root}/{$pom}.html">
           <xsl:value-of select="document($pom-file)/project/name"/>
         </a></td><td><xsl:value-of select="document($pom-file)/project/shortDescription"/></td></tr>
        </xsl:for-each>
        </table>
        </div>
        </xsl:if>

<td valign="top" nowrap="nowrap" class="navright">
<div class="menuheader">By Language</div>
<ul>
<li><a href="{$server-root}/categories/c.html">C</a></li>
<li><a href="{$server-root}/categories/java.html">Java</a></li>
<li><a href="{$server-root}/categories/perl.html">Perl</a></li>
</ul>
</td>

      <xsl:comment>FOOTER SEPARATOR</xsl:comment>
      <tr>
        <td colspan="3">
          <hr noshade="noshade">
          <xsl:attribute name="size"><xsl:value-of select="'1'"/></xsl:attribute
>
          </hr>
        </td>
      </tr>

      <tr><td colspan="2">
        <div class="footer"><em>
        Copyright <xsl:text disable-output-escaping = "yes">&amp;</xsl:text>copy; 2005, The Apache Software Foundation.
        </em></div>
      </td></tr>

</td>
</tr>
</table>

      </body>
     </html>
  </xsl:template>

</xsl:stylesheet>
