<?xml version="1.0" encoding="utf-8" ?>

<!--
# Copyright © 2002-2008 Raphaël Hertzog and others
# Copyright © 2007-2009 Stefano Zacchiroli
# This file is distributed under the terms of the General Public License
# version 2 or (at your option) any later version.
-->

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml"
  version="1.0">

<xsl:output
  method="xml"
  encoding="UTF-8"
  omit-xml-declaration="yes"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  indent="yes" />

<xsl:include href="pts-issues.xsl" />

<xsl:param name="package"/>
<xsl:param name="dir"/>
<xsl:param name="date"/>
<xsl:param name="hasoldstable" select="''"/>
<xsl:param name="hasstable" select="''"/>
<xsl:param name="hastesting" select="''"/>
<xsl:param name="hasunstable" select="''"/>
<xsl:param name="hasexperimental" select="''"/>
<xsl:param name="hasmentors" select="''"/>
<xsl:param name="hasother" select="''"/>
<xsl:param name="hasstable-proposed-updates" select="''"/>
<xsl:param name="hastesting-proposed-updates" select="''"/>
<xsl:param name="hassecurity-oldstable" select="''"/>
<xsl:param name="hassecurity-stable" select="''"/>
<xsl:param name="hassecurity-testing" select="''"/>
<xsl:param name="hassecure-testing" select="''"/>
<xsl:param name="hasvolatile" select="''"/>
<xsl:param name="hasnews" select="''"/>
<xsl:param name="hasexcuse" select="''"/>

<xsl:variable name="other"
  select="document(concat('../base/', $dir, '/other.xml'))/other"/>
<xsl:variable name="low-nmu-emails"
  select="document('../base/low_threshold_nmu.emails.xml')/emails"/>

<!-- Those variables controls the todo and problem item concerning
     standards-version not being up to date -->
<xsl:variable name="lastsv" select="'3.8.2'"/>
<xsl:variable name="lastmajorsv" select="'3.'"/>

<!-- lintian summary -->
<xsl:variable name="lin_errs" select="$other/lintian/@errors" />
<xsl:variable name="lin_warns" select="$other/lintian/@warnings" />

<!-- Named templates aka functions -->

<xsl:template name="mk_lintian_url">
  <!-- convert maintainer/name to follow lintian.debian.org convention -->
  <xsl:variable name="lintian_pattern" select="concat('àáèéëêòöøîìùñ~/()&#34; ', &quot;'&quot;)"/>
  <xsl:variable name="lintian_email" select="translate(maintainer/email, $lintian_pattern, '_____________________')"/>

  <xsl:text>http://lintian.debian.org/reports/maintainer/</xsl:text>
  <xsl:value-of select="$lintian_email" />
  <xsl:text>.html#</xsl:text>
  <xsl:value-of select="$package" />
</xsl:template>

<xsl:template name="mirror">
  <xsl:text>http://ftp.debian.org/debian</xsl:text>  
</xsl:template>

<xsl:template name="outputitem">
  <xsl:choose>
    <xsl:when test="@url">
      <li><xsl:if test="@date">
        <xsl:text>[</xsl:text>
	<xsl:value-of select="@date"/>
        <xsl:text>] </xsl:text>
      </xsl:if><a href="{@url}">
      <xsl:value-of select="text()"/></a><xsl:if test="@from">
        <xsl:text> (</xsl:text>
	<xsl:value-of select="@from"/>
        <xsl:text>)</xsl:text></xsl:if></li>
    </xsl:when>
    <xsl:when test="@type='raw'">
      <li>
	<xsl:copy-of select="node()" />
      </li>
    </xsl:when>
    <xsl:otherwise>
      <li><xsl:if test="@date">
        <xsl:text>[</xsl:text>
	<xsl:value-of select="@date"/>
        <xsl:text>] </xsl:text>
      </xsl:if><xsl:value-of select="text()"/></li>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<!-- Convert + in %2b for URL escaping. Should actually first also do
other-to-%xx, especially % to %25... Fortunately, that's rare -->
<xsl:template name="escape-name">
  <xsl:param name="text"/>
  <xsl:if test="contains($text,'+')">
    <xsl:value-of select="substring-before($text,'+')"/>
    <xsl:text>%2b</xsl:text>
    <xsl:call-template name="escape-name">
    <xsl:with-param name="text"><xsl:value-of select="substring-after($text,'+')"/></xsl:with-param>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="not(contains($text,'+'))">
    <xsl:value-of select="$text"/>
  </xsl:if>
</xsl:template>

<xsl:variable name="escaped-package">
  <xsl:call-template name="escape-name">
    <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
  </xsl:call-template>
</xsl:variable>

<!-- Strip epoch -->
<xsl:template name="strip-epoch">
  <xsl:param name="version"/>
  <xsl:if test="contains($version,':')">
    <xsl:value-of select="substring-after($version,':')"/>
  </xsl:if>
  <xsl:if test="not(contains($version,':'))">
    <xsl:value-of select="$version"/>
  </xsl:if>
</xsl:template>

<xsl:template name="add-vcs-info">
  <xsl:if test="repository">
    <tr>
      <td class="labelcell">
        <acronym title="Version Control System">VCS</acronym>
      </td>
      <td class="contentcell">
        <xsl:if test="repository/vcs[@kind!='browser']">
          <xsl:for-each select="repository/vcs[@kind!='browser']">
            <xsl:sort select="@kind" />
            <a title="access to the raw repository" href="{@url}">
              <xsl:value-of select="@kind" />
            </a>
            <xsl:if test="position()!=last()">
              <xsl:text>, </xsl:text>
            </xsl:if>
          </xsl:for-each>
        </xsl:if>
        <xsl:if test="repository/vcs[@kind='browser']">
          <xsl:text> (</xsl:text>
          <a title="web-based repository browsing"
            href="{repository/vcs[@kind='browser']/@url}">browse</a>
          <xsl:text>)</xsl:text>
        </xsl:if>
      </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="add-maintenance-info">
  <xsl:param name="email" />
  <xsl:variable name="dm">
    <xsl:if test="dm-upload-allowed and string(dm-upload-allowed)='yes'">
      <xsl:text>true</xsl:text>
    </xsl:if>
  </xsl:variable>
  <xsl:variable name="lownmu">
    <xsl:if test="$low-nmu-emails/email[text()=$email]">
      <xsl:text>true</xsl:text>
    </xsl:if>
  </xsl:variable>

  <xsl:if test="string($dm)!='' or string($lownmu)!=''">
    <tr>
      <td class="labelcell">
	<xsl:text>Maintenance</xsl:text>
      </td>
      <td class="contentcell">

	<xsl:if test="string($dm)!=''">
	  <span class="dm-tag">
	    <a href="http://www.debian.org/vote/2007/vote_003"><acronym title="Debian Maintainer Upload Allowed: can be uploaded by Debian Maintainers">DMUA</acronym></a>
	  </span>
          <xsl:text> </xsl:text>
	</xsl:if>

        <xsl:if test="string($lownmu)!=''">
	  <span class="lownmu-tag">
            <a href="http://wiki.debian.org/LowThresholdNmu"><acronym
                title="maintainer agrees with Low Threshold NMU, see wiki page for details">LowNMU</acronym></a>
	  </span>
          <xsl:text> </xsl:text>
        </xsl:if>
      </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="output-news">
  <xsl:param name="news" />

  <xsl:if test="count($news)>0 and string($news)!=''">
    <tr class="titlerow">
    <td class="titlecell">
      Latest news <a class="feedlink" href="{$package}/news.rss20.xml">RSS</a>
    </td></tr>
    <tr class="normalrow">
    <td class="contentcell2">
    <ul id="news-list"><xsl:copy-of select="$news"/></ul>
    </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="output-static">
  <xsl:param name="static" />

  <xsl:if test="count($static)>0 and string($static)!=''">
    <tr class="titlerow">
    <td class="titlecell">
    Static Information
    </td></tr>
    <tr class="normalrow">
    <td class="contentcell2">
    <ul><xsl:copy-of select="$static"/></ul>
    </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="categorize-srcfile">
  <!-- used to recognize (and tag afterwards) well-known type of source package
    components: dsc, diff, orig -->
  <xsl:choose>
    <xsl:when test="substring(filename,string-length(filename)-2, 3)='dsc'">
      <xsl:text>dsc</xsl:text>
    </xsl:when>
    <xsl:when test="substring(filename,string-length(filename)-6, 7)='diff.gz'">
      <xsl:text>diff</xsl:text>
    </xsl:when>
    <xsl:when test="substring(filename,string-length(filename)-5, 3)='tar'">
      <xsl:text>orig</xsl:text>
    </xsl:when>
    <xsl:otherwise><xsl:text></xsl:text></xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="maintainer-email">
  <xsl:param name="email" />
  <a class="email" href="mailto:{$email}">
    <img alt="[email]" src="../common/email.png" title="email" />
  </a>
</xsl:template>

<xsl:template name="general-information">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">General information</td>
  </tr>
  <tr class="normalrow">
    <td class="labelcell">Latest version</td>
    <td class="contentcell">
      <span id="latest_version"><xsl:value-of select="version"/></span>
    </td>
  </tr>
  <xsl:if test="@release!='unstable'">
    <tr class="normalrow">
      <td class="labelcell">Distribution</td>
      <td class="contentcell"><xsl:value-of select="@release"/></td>
    </tr>
  </xsl:if>
  <tr class="normalrow">
    <td class="labelcell">Maintainer</td>
    <td class="maintainer contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://qa.debian.org/developer.php?login=</xsl:text>
	  <xsl:call-template name="escape-name">
	    <xsl:with-param name="text"><xsl:value-of select="maintainer/email"/></xsl:with-param>
	  </xsl:call-template>
	</xsl:attribute>
	<span class="name"><xsl:value-of select="maintainer/name"/></span>
      </xsl:element>
      <xsl:text> </xsl:text>
      <xsl:call-template name="maintainer-email">
	<xsl:with-param name="email" select="maintainer/email" />
      </xsl:call-template>
    </td>
  </tr>
  <xsl:if test="uploaders">
    <tr class="normalrow">
      <td class="labelcell"><a href="http://www.debian.org/doc/manuals/developers-reference/pkgs.html#collaborative-maint">Uploaders</a></td>
      <td class="uploaders contentcell">
        <xsl:for-each select="uploaders/item">
	  <span class="uploader">
            <xsl:element name="a">
              <xsl:attribute name="href">
		<xsl:text>http://qa.debian.org/developer.php?login=</xsl:text>
		<xsl:call-template name="escape-name">
                  <xsl:with-param name="text"><xsl:value-of select="email"/></xsl:with-param>
		</xsl:call-template>
              </xsl:attribute>
              <span class="name"><xsl:value-of select="name"/></span>
            </xsl:element>
            <xsl:text> </xsl:text>
            <xsl:call-template name="maintainer-email">
              <xsl:with-param name="email" select="email" />
            </xsl:call-template>
	  </span>
          <br />
        </xsl:for-each>
    </td></tr>
  </xsl:if>
  <xsl:call-template name='add-maintenance-info'>
    <xsl:with-param name="email" select="maintainer/email" />
  </xsl:call-template>
  <tr class="normalrow">
    <xsl:variable name='stdver' select="standards-version" />
    <td class="labelcell">Conforms to</td>
    <td class="contentcell">
      <a title="Debian Policy Manual (version: {$stdver})"
        href="http://www.debian.org/doc/debian-policy/">
        <span id="standards_version"><xsl:value-of select="$stdver"/></span>
      </a>
    </td>
  </tr>
  <tr class="normalrow">
    <td class="labelcell">Priority</td>
    <td class="contentcell">
      <span id="priority"><xsl:value-of select="priority"/></span>
    </td>
  </tr>
  <tr class="normalrow">
    <td class="labelcell">Section</td>
    <td class="contentcell">
      <span id="section"><xsl:value-of select="section"/></span>
    </td>
  </tr>
  <xsl:call-template name='add-vcs-info' />
  <xsl:if test="architecture!='any' and architecture!='all'">
    <tr class="normalrow">
      <td class="labelcell">Architecture</td>
      <td class="contentcell"><xsl:value-of select="architecture"/></td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="bugs-count">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">Bugs count</td>
  </tr>
  <tr class="normalrow" id="bugs_all">
    <td class="labelcell">All bugs
       <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://people.debian.org/~glandium/bts/</xsl:text>
	  <xsl:value-of select="substring($package, 1, 1)"/>
	  <xsl:text>/</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	  <xsl:text>.png</xsl:text>
	</xsl:attribute>
        <xsl:attribute name="style">font-weight: normal</xsl:attribute>
	<xsl:text>(graph)</xsl:text>
      </xsl:element>
    </td>
    <td class="contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&amp;src=</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	</xsl:attribute>
	<xsl:if test="$hasother">
	  <span class="bugcount" title="all">
	    <xsl:value-of select="$other/bugs/@all"/>
	  </span>
	</xsl:if>
      </xsl:element>
      <xsl:if test="$hasother and $other/bugs/@all_m">
	(<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=yes&amp;src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	  </xsl:attribute>
	  <xsl:value-of select="$other/bugs/@all_m"/>
	</xsl:element>)
      </xsl:if>
    </td>
  </tr>
  <tr class="normalrow" id="bugs_rc">
    <td class="labelcell"><span class="indented"><acronym title="Release Critical">RC</acronym> bugs</span></td>
    <td class="contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious&amp;repeatmerged=no</xsl:text>
	</xsl:attribute>
	<xsl:if test="$hasother">
	  <span class="bugcount" title="rc">
	    <xsl:value-of select="$other/bugs/@rc"/>
	  </span>
	</xsl:if>
      </xsl:element>
      <xsl:if test="$hasother and $other/bugs/@rc_m">
	(<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	    <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious&amp;repeatmerged=yes</xsl:text>
	  </xsl:attribute>
	  <xsl:value-of select="$other/bugs/@rc_m"/>
	</xsl:element>)
      </xsl:if>
    </td>
  </tr>
  <tr class="normalrow" id="bugs_in">
    <td class="labelcell"><span class="indented"><acronym title="Important and Normal">I&amp;N</acronym> bugs</span></td>
    <td class="contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=important&amp;sev-inc=normal&amp;repeatmerged=no</xsl:text>
	</xsl:attribute>
	<xsl:if test="$hasother">
	  <span class="bugcount" title="in">
	    <xsl:value-of select="$other/bugs/@normal"/>
	  </span>
	</xsl:if>
      </xsl:element>
      <xsl:if test="$hasother and $other/bugs/@normal_m">
	(<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	    <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=important&amp;sev-inc=normal&amp;repeatmerged=yes</xsl:text>
	  </xsl:attribute>
	  <xsl:value-of select="$other/bugs/@normal_m"/>
	</xsl:element>)
      </xsl:if>
    </td>
  </tr>
  <tr class="normalrow" id="bugs_mw">
    <td class="labelcell"><span class="indented"><acronym title="Minor and Wishlist">M&amp;W</acronym> bugs</span></td>
    <td class="contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=minor&amp;sev-inc=wishlist&amp;repeatmerged=no</xsl:text>
	</xsl:attribute>
	<xsl:if test="$hasother">
	  <span class="bugcount" title="mw">
	    <xsl:value-of select="$other/bugs/@wishlist"/>
	  </span>
	</xsl:if>
      </xsl:element>
      <xsl:if test="$hasother and $other/bugs/@wishlist_m">
	(<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	    <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=minor&amp;sev-inc=wishlist&amp;repeatmerged=yes</xsl:text>
	  </xsl:attribute>
	  <xsl:value-of select="$other/bugs/@wishlist_m"/>
	</xsl:element>)
      </xsl:if>
    </td>
  </tr>
  <tr class="normalrow" id="bugs_fp">
    <td class="labelcell"><span class="indented"><acronym title="Fixed and Pending">F&amp;P</acronym> bugs</span></td>
    <td class="contentcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	  <xsl:value-of select="$escaped-package" />
	  <xsl:text>&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed&amp;repeatmerged=no</xsl:text>
	</xsl:attribute>
	<xsl:if test="$hasother">
	  <span class="bugcount" title="fp">
	    <xsl:value-of select="$other/bugs/@fixed"/>
	  </span>
	</xsl:if>
      </xsl:element>
      <xsl:if test="$hasother and $other/bugs/@fixed_m">
	(<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	    <xsl:text>&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed&amp;repeatmerged=yes</xsl:text>
	  </xsl:attribute>
	  <xsl:value-of select="$other/bugs/@fixed_m"/>
	</xsl:element>)
      </xsl:if>
    </td>
  </tr>
  <xsl:if test="$other/bugs/@gift > 0">
    <tr class="normalrow" id="bugs_gift">
      <td class="labelcell"><span class="indented"><a
	    href="http://wiki.debian.org/qa.debian.org/GiftTag">Gift</a>
	  bugs</span></td>
      <td class="contentcell">
	<xsl:element name="a">
	  <xsl:attribute name="href">
	    <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=</xsl:text>
	    <xsl:value-of select="$escaped-package" />
	    <xsl:text>&amp;users=debian-qa@lists.debian.org;tag=gift</xsl:text>
	  </xsl:attribute>
	  <span class="bugcount" title="gift">
	    <xsl:value-of select="$other/bugs/@gift" />
	  </span>
	</xsl:element>
      </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="pts-subscription">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">
      <a class="titlelink" href="http://www.debian.org/doc/manuals/developers-reference/resources.html#pkg-tracking-system"><acronym title="Package Tracking System">PTS</acronym></a> subscription
  </td></tr>
  <tr class="normalrow">
    <td class="labelcell">Subscribers count</td>
    <td class="contentcell"><xsl:if test="$hasother">
	<xsl:value-of select="$other/pts/@count"/>
    </xsl:if></td>
  </tr>
  <tr class="normalrow">
    <td class="contentcell" colspan="2">
      <form method="post" action="/cgi-bin/pts.cgi">
	<p>
	  <input type="hidden" name="package" value="{$package}"/>
	  <select name="what">
	    <option value="subscribe">Subscribe</option>
	    <option value="unsubscribe">Unsubscribe</option>
	    <option value="advanced">Advanced mode</option>
	  </select>
          <input type="text" name="email" size="15" value="your email"
            onfocus="if(email.value=='your email'){{email.value=''}}"/>
	  <input type="submit" name="submit" value="Send"/>
	</p>
      </form>
    </td>
  </tr>
</xsl:template>

<xsl:template name="binary-packages">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">Binary packages</td>
  </tr>
  <tr class="normalrow">
    <td class="normalcell" colspan="2" style="text-align: left">
      <ul>
	<xsl:for-each select="binary/item">
	  <xsl:sort select="text()"/>
	  <xsl:variable name="pkg" select="text()"/>
          <xsl:variable name="tooltip"
            select="concat($pkg, ': ',
                $other/descriptions/shortdesc[@package=$pkg])" />
	  <li class="binpkg">
            <a class="binpkg" title="{$tooltip}"
               href="http://packages.debian.org/{text()}">
	      <span class="binpkg"><xsl:value-of select="text()"/></span>
	    </a>
	    <span style="font-size: 70%">
	      (<a href="http://bugs.debian.org/{text()}"><xsl:value-of select="$other/bugs/item[@name=$pkg]/@all"/> bugs</a>: 

	      <xsl:element name="a">
		<xsl:attribute name="title">critical, grave and serious</xsl:attribute>
		<xsl:attribute name="href">
		  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
		  <xsl:call-template name="escape-name">
		    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
		  </xsl:call-template>
		  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious</xsl:text>
		</xsl:attribute>
		<xsl:value-of select="$other/bugs/item[@name=$pkg]/@rc"/>
	      </xsl:element>, 

	      <xsl:element name="a">
		<xsl:attribute name="title">important and normal</xsl:attribute>
		<xsl:attribute name="href">
		  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
		  <xsl:call-template name="escape-name">
		    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
		  </xsl:call-template>
		  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=important&amp;sev-inc=normal</xsl:text>
		</xsl:attribute>
		<xsl:value-of select="$other/bugs/item[@name=$pkg]/@normal"/>
	      </xsl:element>, 

	      <xsl:element name="a">
		<xsl:attribute name="title">wishlist and minor</xsl:attribute>
		<xsl:attribute name="href">
		  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
		  <xsl:call-template name="escape-name">
		    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
		  </xsl:call-template>
		  <xsl:text>&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done&amp;sev-inc=minor&amp;sev-inc=wishlist</xsl:text>
		</xsl:attribute>
		<xsl:value-of select="$other/bugs/item[@name=$pkg]/@wishlist"/>
	      </xsl:element>, 

	      <xsl:element name="a">
		<xsl:attribute name="title">pending and fixed</xsl:attribute>
		<xsl:attribute name="href">
		  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=</xsl:text>
		  <xsl:call-template name="escape-name">
		    <xsl:with-param name="text"><xsl:value-of select="text()"/></xsl:with-param>
		  </xsl:call-template>
		  <xsl:text>&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed</xsl:text>
		</xsl:attribute>
		<xsl:value-of select="$other/bugs/item[@name=$pkg]/@fixed"/>
	      </xsl:element>)
	    </span>
	  </li>
	</xsl:for-each>
  </ul></td></tr>
</xsl:template>

<xsl:template name="output-version">
  <xsl:param name="suite" select="''" />
  <xsl:param name="link" select="'yes'" />
  <xsl:variable name="version">
    <span class="srcversion" title="{$suite}">
      <xsl:value-of select="document(concat('../base/', $dir, '/', $suite,
			    '.xml'))/source/version"/>
    </span>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="$link='yes'">
      <a href="http://packages.debian.org/source/{$suite}/{$package}">
	<xsl:copy-of select="$version" />
      </a>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy-of select="$version" />
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="available-versions">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">
      Available versions
      <small>
        <a href="http://qa.debian.org/madison.php?package={$package}"
          style="font-weight: normal"
          title="madison">(more...)</a>
      </small>
  </td></tr>

  <!-- oldstable -->
  <xsl:if test="$hasoldstable">  
    <tr class="normalrow">
      <td class="labelcell"><a href="http://www.debian.org/releases/etch/">Oldstable</a></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">oldstable</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>
  <xsl:if test="$hassecurity-oldstable">
    <tr class="normalrow">
      <td class="labelcell"><small>Oldstable Security Updates</small></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">security-oldstable</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- stable -->
  <xsl:if test="$hasstable">  
    <tr class="normalrow">
      <td class="labelcell"><a href="http://www.debian.org/releases/stable/">Stable</a></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">stable</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>
  <xsl:if test="$hassecurity-stable">
    <tr class="normalrow">
      <td class="labelcell"><small>Stable Security Updates</small></td>
      <td class="contentcell">
      	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">security-stable</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>
  <xsl:if test="$hasstable-proposed-updates">  
    <tr class="normalrow">
      <td class="labelcell"><small>Stable Proposed Updates</small></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">stable-proposed-updates</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- testing -->
  <xsl:if test="$hastesting">
    <tr class="normalrow">
      <td class="labelcell"><a href="http://www.debian.org/releases/testing/">Testing</a></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">testing</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>
  <xsl:if test="$hassecurity-testing">
    <tr class="normalrow">
      <td class="labelcell"><small>Testing Security Updates</small></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">security-testing</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>
  <xsl:if test="$hastesting-proposed-updates">
    <tr class="normalrow">
      <td class="labelcell"><small>Testing Proposed Updates</small></td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">testing-proposed-updates</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- unstable -->
  <xsl:if test="$hasunstable">
    <tr class="normalrow">
      <td class="labelcell">Unstable</td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">unstable</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- experimental -->
  <xsl:if test="$hasexperimental">
    <tr class="normalrow">
      <td class="labelcell">Experimental</td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">experimental</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- secure-testing -->
  <xsl:if test="$hassecure-testing">
    <tr class="normalrow">
      <td class="labelcell">Secure testing</td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">secure-testing</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- volatile -->
  <xsl:if test="$hasvolatile">
    <tr class="normalrow">
      <td class="labelcell">Volatile</td>
      <td class="contentcell">
	<xsl:call-template name="output-version">
	  <xsl:with-param name="suite">volatile</xsl:with-param>
	  <xsl:with-param name="link">no</xsl:with-param>
	</xsl:call-template>
      </td>
    </tr>
  </xsl:if>

  <!-- waiting in NEW -->
  <xsl:if test="$hasother and $other/@new_version">
    <tr class="normalrow">
      <td class="labelcell">
	<a title="Some versions of this package are waiting for FTP master's review"
	   href="http://ftp-master.debian.org/new.html">NEW queue</a></td>
      <td class="contentcell">
	<xsl:value-of select="$other/@new_version" />
      </td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="ubuntu">
  <!-- Patches list [FG] -->
  <xsl:if test="$other/@ubuntu='yes'">
    <tr class="titlerow">
      <td class="titlecell" colspan="2"><a
          title="Information about Ubuntu for Debian Developers"
          href="https://wiki.ubuntu.com/Ubuntu/ForDebianDevelopers">Ubuntu ...</a>
      </td>
    </tr>
    <tr>
      <td class="contentcell" colspan="2" style="text-align: left">
	<ul>
	    <li>
		    Version: <a href="{$other/ubuntu/@url}"><xsl:value-of select="$other/ubuntu/@version"/></a>
	    </li>
	  <xsl:if test="$other/ubuntu/patch">
	    <li>
		    <a href="{$other/ubuntu/patch/@url}">Patch for version <xsl:value-of select="$other/ubuntu/patch/@version"/></a>
	    </li>
	  </xsl:if>
	  <xsl:if test="$other/ubuntu/bugs">
	    <li>
		    <a href="{$other/ubuntu/bugs/@url}"><xsl:value-of select="$other/ubuntu/bugs/@count"/> open bugs</a>
	    </li>
	  </xsl:if>
	</ul>
      </td>
    </tr>
  </xsl:if> 
</xsl:template>

<xsl:template name="other-links">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">
      Other links
  </td></tr>
  <tr>
    <td class="contentcell" colspan="2" style="text-align: left">
      <ul>
        <xsl:if test="homepage">
          <li> <a href="{homepage}">Upstream homepage</a> </li>
        </xsl:if>
	<li>
	  <xsl:element name="a">
	    <xsl:attribute name="href">
	      <xsl:text>http://packages.debian.org/changelogs/</xsl:text>
	      <xsl:value-of select="directory"/>
	      <xsl:text>/current/changelog</xsl:text>
	    </xsl:attribute>
	    <xsl:text>Changelog</xsl:text>
	  </xsl:element>
	  /
	  <xsl:element name="a">
	    <xsl:attribute name="href">
	      <xsl:text>http://packages.debian.org/changelogs/</xsl:text>
	      <xsl:value-of select="directory"/>
	      <xsl:text>/current/copyright</xsl:text>
	    </xsl:attribute>
	    <xsl:text>Copyright</xsl:text>
	  </xsl:element>
	</li>
	<xsl:if test="architecture!='all'">
	  <li>
            <xsl:text>Buildd: </xsl:text>
            <a href="http://buildd.debian.org/pkg.cgi?pkg={$escaped-package}"
              title="buildd.debian.org build logs">logs</a>
            <xsl:text>, </xsl:text>
            <!-- <a href="http://people.debian.org/~igloo/status.php?packages={$escaped-package}"
              title="igloo's build logs on people.debian.org">more</a> -->
            <a href="http://buildd.debian.org/~luk/status/package.php?p={$escaped-package}"
              title="build logs on buildd.debian.org">more</a>
            <xsl:text>, </xsl:text>
            <!-- <a href="http://experimental.debian.net/build.php?pkg={$escaped-package}" -->
            <!--   title="experimental.debian.net build logs">exp</a> -->
	    <xsl:if test="$hasexperimental">
              <a href="http://experimental.debian.net/new/package.php?p={$escaped-package}&amp;suite=experimental"
		 title="experimental.debian.net build logs">exp</a>
              <xsl:text>, </xsl:text>
	    </xsl:if>
            <a href="http://buildd.debian-ports.org/status/package.php?p={$escaped-package}"
              title="debian ports build logs">ports</a>
	  </li>
	</xsl:if>
	<xsl:if test="$hasother and $other/@piuparts='yes'">
	  <li>
	    <a title="errors found while stressing package (un)installation"
	       href="http://piuparts.debian.org/sid/source/{$hash}/{$package}.html">piuparts
	    errors</a>
	  </li>
	</xsl:if>
	<xsl:if test="($hasunstable and $other/debcheck/@unstable='yes')
	  or ($hastesting and $other/debcheck/@testing='yes')
	  or ($hasstable and $other/debcheck/@stable='yes')">
	  <li>
	    Debcheck on:
	    <xsl:if test="$hasunstable">
	      <xsl:text> </xsl:text>
              <a href="http://qa.debian.org/debcheck.php?dist=unstable&amp;package={$escaped-package}">unstable</a>
	    </xsl:if>
	    <xsl:if test="$hastesting">
	      <xsl:text> </xsl:text>
              <a href="http://qa.debian.org/debcheck.php?dist=testing&amp;package={$escaped-package}">testing</a>
	    </xsl:if>
	    <xsl:if test="$hasstable">
	      <xsl:text> </xsl:text>
              <a href="http://qa.debian.org/debcheck.php?dist=stable&amp;package={$escaped-package}">stable</a>
	    </xsl:if>
	  </li>
	</xsl:if>
	<xsl:if test="$other/@lintian='yes'">
	  <xsl:variable name="lintian_url"><xsl:call-template name="mk_lintian_url" /></xsl:variable>
	  <li>
	    <a href="{$lintian_url}">Lintian report</a>
	    <xsl:if test="$lin_errs + $lin_warns > 0">
	      <xsl:text> </xsl:text>
	      <small><span title="(errors, warnings)">(<span id="lintian_errors"><xsl:value-of select="$lin_errs" /></span>,
		  <span id="lintian_warnings"><xsl:value-of select="$lin_warns" /></span>)</span></small>
	    </xsl:if>
	  </li>
	</xsl:if>
	<li>
          <a href="http://qa.debian.org/developer.php?popcon={$escaped-package}">Popcon stats</a>
	</li>
        <xsl:if test="$other/@svnbuildstat='yes'">
          <li>
            <a href="http://svnbuildstat.debian.net/packages/info/{$escaped-package}">Svnbuildstat</a>
          </li>
        </xsl:if>
	<xsl:if test="$other/i18n/@href">
	  <li>
	    <a title="translation status"
	       href="{$other/i18n/@href}">l10n status</a>
	    <small>
	      (<span title="completeness of Debian string translation">
		<xsl:value-of select="$other/i18n/@deb" />
	      </span>,
	      <span title="completeness of non-Debian string translation">
		<xsl:value-of select="$other/i18n/@nondeb" />
	      </span>)
	    </small>
	  </li>
	</xsl:if>
      </ul>
    </td>
  </tr>
</xsl:template>

<xsl:template name="package-files">
  <tr class="titlerow">
    <td class="titlecell" colspan="2">Source package</td>
  </tr>
  <tr class="titlerow">
    <td class="labelcell">
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:call-template name="mirror"/>
	  <xsl:text>/</xsl:text>
	  <xsl:value-of select="directory"/>
	  <xsl:text>/</xsl:text>
	</xsl:attribute>
	<xsl:text>Files</xsl:text>
      </xsl:element>
    </td>
    <td class="contentcell" id="src_files">
      <ul>
	<xsl:for-each select="files/item">
	  <xsl:variable name="filetype">
	    <xsl:call-template name="categorize-srcfile" />
	  </xsl:variable>
	  <xsl:element name="li">
	    <xsl:attribute name="class">srcfile</xsl:attribute>
	    <xsl:if test="string($filetype)!=''">
	      <xsl:attribute name="id">
		<xsl:text>srcfile_</xsl:text>
		<xsl:value-of select="$filetype" />
	      </xsl:attribute>
	    </xsl:if>
	    <xsl:element name="a">
	      <xsl:attribute name="class">srcfile</xsl:attribute>
	      <xsl:attribute name="href">
		<xsl:call-template name="mirror"/>	  
		<xsl:text>/</xsl:text>
		<xsl:value-of select="../../directory"/>
		<xsl:text>/</xsl:text>
		<xsl:value-of select="filename"/>
	      </xsl:attribute>
	      <xsl:attribute name="title">
		<xsl:value-of select="filename" />
		<xsl:text>: </xsl:text>
		<xsl:value-of select="size"/>
		<xsl:text> bytes</xsl:text>
	      </xsl:attribute>
	      <xsl:text>.</xsl:text>
	      <xsl:value-of select="$filetype"/>
	    </xsl:element>
	  </xsl:element>
	</xsl:for-each>
      </ul>
    </td>
  </tr>
</xsl:template>

<xsl:template name="todo-list">
  <xsl:variable name="todo">
    <xsl:call-template name="issue-nmu" />
    <xsl:call-template name="issue-lintian" />
    <xsl:call-template name="issue-mentors-pending" />
    <xsl:call-template name="issue-comaintenance" />
    <xsl:call-template name="issue-outdate-stdver" />
    <xsl:call-template name="issue-new-upstream" />
    <xsl:call-template name="issue-patches" />
    <xsl:call-template name="issue-l10n" />
    <xsl:if test="$hasother">
      <xsl:for-each select="$other/todo/item">
	<xsl:call-template name="outputitem" />
      </xsl:for-each>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($todo)>0 and string($todo)!=''">  
    <tr class="titlerow">
      <td class="titlecell" id="todo">Todo</td>
    </tr>
    <tr class="normalrow">
      <td class="contentcell2"><ul><xsl:copy-of select="$todo"/></ul></td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="problems">
  <xsl:variable name="problems">
    <xsl:call-template name="issue-testing-excuses" />
    <xsl:call-template name="issue-piuparts" />
    <xsl:call-template name="issue-ancient-stdver" />
    <xsl:call-template name="issue-item-dead-package" />
    <xsl:call-template name="issue-item-override-disparity" />
    <xsl:call-template name="issue-item-help-bugs" />
    <xsl:call-template name="issue-item-wnpp" />
    <!-- <xsl:call-template name="issue-item-watch-failure" /> -->
    <xsl:call-template name="issue-item-dehs-failure" />
    <xsl:if test="$hasother">
      <xsl:for-each select="$other/problems/item">
	<xsl:call-template name="outputitem"/>
      </xsl:for-each>
    </xsl:if>
  </xsl:variable>
  <xsl:if test="count($problems)>0 and string($problems)!=''">
    <tr class="titlerow">
      <td class="titlecell" id="problems">Problems</td>
    </tr>
    <tr class="normalrow">
      <td class="contentcell2"><ul><xsl:copy-of select="$problems"/></ul></td>
    </tr>
  </xsl:if>
</xsl:template>

<xsl:template name="testing-status">
  <xsl:if test="$hasexcuse or $other/@transitions='yes'">
    <tr class="titlerow">
      <td class="titlecell">
	Testing status
    </td></tr>
  </xsl:if>
  <xsl:if test="$other/@transitions='yes'">
    <xsl:variable name="translist">
      <xsl:for-each select="$other/transitions/transition">
	<xsl:value-of select="@name" />
	<xsl:if test="position() != last()">
	  <xsl:text> </xsl:text>
	</xsl:if>
      </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="transno" select="count($other/transitions/transition)" />
    <tr class="normalrow">
      <td class="contentcell2" style="text-align: left">
	<ul>
	  <!-- XXX unappropriate <ul>, just to make the text looks like other
	    boxes, should be fixed on the CSS side (getting rid of <ul>) -->
	      <li>This package is part of <em><xsl:value-of select="$transno" />
		  ongoing testing transition<xsl:if test="$transno != '1'">s</xsl:if>
		</em> (namely: <tt><xsl:value-of select="$translist" /></tt>). For
		more information see the
		<a href="http://ftp-master.debian.org/transitions.yaml">transition
		  status file</a>.<br />
		<em>Uploads to unstable will be rejected</em> while transitions are
		ongoing; you might want to upload to experimental in the
		meantime, or contact <tt><a href="mailto:debian-release@lists.debian.org">debian-release</a></tt>
		if an upload is really necessary.
	      </li>
	    </ul>
	  </td>
	</tr>
      </xsl:if>
      <xsl:if test="$hasexcuse">
	<tr class="normalrow">
	  <td class="contentcell2" style="text-align: left">
            <a title="reasons why the package is not moving to testing"
              href="http://qa.debian.org/excuses.php?package={$package}">Excuses</a>:
	    <ul class="testing-excuses">
	      <xsl:for-each select="document(concat('../base/', $dir, '/excuse.xml'))/excuse/item">
		<xsl:call-template name="outputitem"/>
	      </xsl:for-each>
	    </ul>
	  </td>
	</tr>
      </xsl:if>
    </xsl:template>

    <xsl:template name="static-info">
      <xsl:call-template name="output-static">
	<xsl:with-param name="static" select="$static" />
      </xsl:call-template>
    </xsl:template>

    <xsl:template name="latest-news">
      <xsl:call-template name="output-news">
	<xsl:with-param name="news" select="$news" />
      </xsl:call-template>
    </xsl:template>

    <xsl:variable name="static">
      <xsl:if test="$hasnews">
	<xsl:for-each select="document(concat('../base/', $dir, '/news.xml'))/news/static/item">
	  <xsl:call-template name="outputitem"/>
	</xsl:for-each>
      </xsl:if>
    </xsl:variable>

    <xsl:variable name="news">
      <xsl:if test="$hasnews">
	<xsl:for-each select="document(concat('../base/', $dir, '/news.xml'))/news/news/item">
	  <xsl:call-template name="outputitem"/>
	</xsl:for-each>
      </xsl:if>
    </xsl:variable>

    <!-- All the work is done in a single template -->
    <xsl:template match="source">

      <!-- Start of html -->
      <html>
	<head>
	  <meta name="ROBOTS" content="NOFOLLOW"/>
	  <link type="text/css" title="User selected" rel="stylesheet" href="../common/default.css"/>
	  <link type="text/css" title="Official" rel="alternate stylesheet" href="../common/revamp.css"/>
	  <link type="text/css" title="Legacy PTS" rel="alternate stylesheet" href="../common/pts.css"/>
	  <link type="text/css" title="Compact rendering" rel="alternate stylesheet" href="../common/compact.css"/>
	  <script type="text/javascript" src="../common/pts.js"></script>
	  <xsl:if test="count($news)>0 and string($news)!=''">
	    <link rel="alternate" type="application/rss+xml" title="RSS"
	      href="{$package}/news.rss20.xml" />
	  </xsl:if>
	  <title>Overview of <xsl:value-of select="$package"/> source package</title>
	</head>
	<body onload="javascript:onLoad();">

	  <div id="quickforms" style="float: right;">
	    <form method="get" action="/common/index.html">
	      <p><span title="Jump to package">Go:</span> 
		<input type="text" name="src" value=""/></p>
	    </form>
	    <form id="csspref-form" method="get" action="/common/set-csspref.php">
	      <p>Switch style: <select name="csspref" onchange="javascript:onChangeStyle();">
		  <option value="revamp.css">Default</option>
		  <option value="compact.css">Compact</option>
		  <option value="pts.css">Legacy</option>
	      </select></p>
	    </form>

	  </div>
	  <h1>Overview of
	    <xsl:element name="a">
	      <xsl:attribute name="href">
		<xsl:text>http://packages.debian.org/src:</xsl:text>
		<xsl:value-of select="$package"/>
	      </xsl:attribute>
	      <xsl:value-of select="$package"/>
	    </xsl:element>
	    source package</h1>

	  <div id="body">
	    <xsl:choose>
	      <xsl:when test="$removed='yes'">
		<!-- REMOVED PACKAGE -->
		<p>This package is not part of any Debian distribution. Thus you won't
		  find much information here. The package is either very new and hasn't
		  appeared on mirrors yet, or it's an old package that eventually got removed.
		  The old news are kept for historic purpose only.</p>

		<table class="righttable">
		  <xsl:call-template name="static-info" />
		  <xsl:call-template name="latest-news" />
		</table>

		<!-- END REMOVED PACKAGE -->
	      </xsl:when>
	      <xsl:otherwise>
		<!-- NON REMOVED PACKAGE -->

		<table class="containertable">
		  <tr class="containerrow" valign="top">
		    <td class="containercell">
		      <!-- LEFT SIDE -->
		      <table class="lefttable">
			<xsl:call-template name="general-information" />
			<xsl:call-template name="available-versions" />
		      </table>
		      <table class="lefttable">
			<xsl:call-template name="package-files" />
			<xsl:call-template name="binary-packages" />
		      </table>
		      <!-- END LEFT SIDE -->
		      </td><td class="containercell">
		      <!-- RIGHT SIDE -->
		      <table class="righttable">
			<xsl:call-template name="todo-list" />
			<xsl:call-template name="problems" />
		      </table>
		      <table class="righttable">
			<xsl:call-template name="testing-status" />
			<xsl:call-template name="static-info" />
			<xsl:call-template name="latest-news" />
		      </table>
		      <!-- END RIGHT SIDE -->
		      </td><td class="containercell">
		      <table class="lefttable">
			<xsl:call-template name="bugs-count" />
			<xsl:call-template name="pts-subscription" />
		      </table>
		      <table class="lefttable">
			<xsl:call-template name="other-links" />
		      </table>
		      <table class="lefttable" id="ubuntubox">
			<xsl:call-template name="ubuntu" />
		      </table>
		  </td></tr>
		</table>

		<!-- END NON REMOVED PACKAGE -->
	      </xsl:otherwise>
	    </xsl:choose>

	    <hr/>
	    <div class="footer">
              <table width="100%">
                <tr>
                  <td>
                    <p>
                      <em><a href="http://www.debian.org">Debian</a> Package
                        Tracking System</em> - Copyright 2002-2009 Raphaël
                      Hertzog and others.<br/> Report problems to the
                      <a href="http://bugs.debian.org/qa.debian.org"><tt>qa.debian.org</tt>
                        pseudopackage</a> in the <a href="http://bugs.debian.org">Debian
                        <acronym title="Bug Tracking System">BTS</acronym></a>.<br/>
                      Last modified: <xsl:value-of select="$date"/>.
                    </p>
                  </td>
                  <td>
                    <a href="http://validator.w3.org/check?uri=referer"><img
                        src="http://www.w3.org/Icons/valid-xhtml10-blue"
                        alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
                  </td>
                </tr>
              </table>
	    </div>
	  </div>
	</body>
      </html>
    </xsl:template>

</xsl:stylesheet>
