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

  <xsl:template match="/">
    <html>
      <head>
      <link rel="stylesheet" type="text/css" href="http://www.grappa.univ-lille3.fr/~torre/site.css" />
	<title>TODOs de <xsl:value-of select="/todolist/@owner"/></title>
	<meta name="robots" content="noimageindex" />
      </head>
      <body>
        <div class="pagelarge">
	<h1>Les TODO de <xsl:value-of select="/todolist/@owner"/></h1>
	<xsl:apply-templates />
	</div>
      </body>
    </html>
  </xsl:template>


  <xsl:template match="todo">
    <h2>
      TODO
      <xsl:value-of select="title"/>
    </h2>
    <div class="image">
      <img src="{@illustration}" style="width:180px;float:right;margin-right:10px;" />
    </div>
    <p class="dead">
      Pour le 
      <strong>
	<xsl:value-of select="@deadline"/>
      </strong> :
    </p>
    <xsl:apply-templates select="commentaires" />
    <p>Liste des actions à effectuer :</p>
    <xsl:apply-templates select="items" />
    <hr />    
  </xsl:template>

  <!-- Commentaires -->
  <xsl:template match="commentaires">
    <div class="commentaires">
      <xsl:apply-templates/>
    </div>
  </xsl:template>

  <!-- paragraphes -->
  <xsl:template match="par">
    <p>
      <xsl:apply-templates/>
    </p>
  </xsl:template>


  <!-- listes -->
  <xsl:template match="item[@level='critic']">
    <li><strong>[urgent]</strong><xsl:text> </xsl:text>
      <xsl:apply-templates/>
    </li>
  </xsl:template>

  <xsl:template match="item">
    <li>
      <xsl:apply-templates/>
    </li>
  </xsl:template>

  <xsl:template match="items">
    <ul>
      <xsl:apply-templates/>
    </ul>
  </xsl:template>

  <!-- important -->
  <xsl:template match="important">
    <em><xsl:apply-templates/></em>
  </xsl:template>

  <!-- date -->
  <xsl:template match="date">
    <strong><xsl:apply-templates/></strong>
  </xsl:template>

  <!-- liens -->
  <xsl:template match="lien">
    <a href="{@url}">
      <xsl:apply-templates/>
    </a>
  </xsl:template>

</xsl:stylesheet>
