diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-11-26 02:33:35 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-11-26 02:33:35 +0000 |
commit | 3c058fbf131d664506af52209dd8eee678dfcade (patch) | |
tree | f9b49df924a8e10285d2845c6d1ec4972d150fc4 | |
parent | b3a4bdb55aa433564a2b717ae8e672506154fb69 (diff) |
some xslt/css work
git-svn-id: file:///home/lennart/svn/public/sse/trunk@66 5fbabb74-0606-0410-a5e4-b5cc6a42724e
-rw-r--r-- | www/style.css | 51 | ||||
-rw-r--r-- | www/style.xsl | 40 |
2 files changed, 86 insertions, 5 deletions
diff --git a/www/style.css b/www/style.css index c2002d9..ff8ce97 100644 --- a/www/style.css +++ b/www/style.css @@ -4,12 +4,59 @@ max-width: 20em; min-width: 15em; padding: 5px; position: relative; -margin: auto; +margin-left: auto; +margin-right: auto; +margin-bottom: 3em; border: 1px solid #FFCF75; text-align: center; } - input[type=text] { font-family: monospace } + +div.statistics { +font-size: 8px; +color: lightgray; +text-align: center; +margin-top: 3em; +} + +div.authors { +font-size: 8px; +color: lightgray; +text-align: center; +} + +div.hit { +margin-left: 3em; +margin-right: 3em; +margin-top: 1em; +margin-bottom: 1em; +} + +div.hit div.hit_package span.name { +font-weight: bold; +} + +div.hit div.hit_statistics { +font-style: italic; +} + +body { +margin: 2em; +font-family: sans-serif; +} + +div.n_hits { +margin-bottom: 2em; +} + +div.linkbox { +margin-left: 40%; +margin-right: auto; +} + +ul.links li { +display:inline; +} diff --git a/www/style.xsl b/www/style.xsl index ab52a65..32798be 100644 --- a/www/style.xsl +++ b/www/style.xsl @@ -1,16 +1,50 @@ <?xml version="1.0" encoding="iso-8859-15"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml"> <xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/> - <xsl:template match="/"> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> - <p>cool</p> + + <h1>Source Search Engine</h1> + + <xsl:copy-of select="//html:div[@class="formbox"]"/> + + <xsl:if test="number(id("results_total")) = 0"> + <div>Your search yielded no results.</div> + </xsl:if> + + <xsl:if test="number(id("results_total")) > 0"> + + <div class="n_hits"><xsl:value-of select="id("results_total")"/> hits.</div> + + <xsl:for-each select="id("result_list")/html:li"> + <div class="hit"> + <div class="hit_package">Project: <span class="name"><xsl:value-of select="html:span[@class="package_name"]"/></span></div> + <div class="hit_file">File: <a class="file"> + <xsl:attribute name="href"><xsl:value-of select="html:a[@class="file_link"]/@href"/></xsl:attribute> <xsl:value-of select="html:a[@class="file_link"]"/></a></div> + <div class="hit_statistics"><xsl:value-of select="html:span[@class="hits"]"/> hits in <xsl:value-of select="html:span[@class="words"]"/> different words.</div> + </div> + </xsl:for-each> + </xsl:if> + + <div class="linkbox"> + <xsl:for-each select="//html:ul[@class="links"]"> + <xsl:copy-of select="."/> + </xsl:for-each> + </div> + + <div class="statistics"> + <xsl:value-of select="id("n_word") "/> words, + <xsl:value-of select="id("n_file") "/> files, + <xsl:value-of select="id("n_package") "/> packages in database. + </div> + + <div class="authors"><xsl:text>Brought to you by Lennart Poettering, Stephan Pöhlsen and Sebastien Estienne, 2005</xsl:text></div> </body> </html> </xsl:template> |