summaryrefslogtreecommitdiff
path: root/gentoobrowse/xslt/search.xslt
blob: 644a9065f3900c11f91f1903322d6ca50ec7f348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:project2="http://project2.randomdan.homeip.net" exclude-result-prefixes="project2" >
  <xsl:import href="base.xslt" />
  <xsl:output encoding="utf-8" method="html" media-type="text/html" indent="yes" />

  <xsl:template name="head">
		<title>Search results for &quot;<xsl:value-of select="/gentoo/project2:params/criteria"/>&quot; &#183; Gentoo Browse</title>
  </xsl:template>
  
	<xsl:template name="header">
		<h1>Search results</h1>
		<p class="lead">
			<xsl:value-of select="count(/gentoo/searchResults/package)" /> packages,
			<xsl:value-of select="count(/gentoo/bugSearchResults/bug)" /> bugs
		</p>
		<xsl:apply-templates select="/gentoo/package/urls" />
  </xsl:template>

	<xsl:template name="content">
		<div class="span3 bs-docs-sidebar">
			<xsl:if test="/gentoo/searchResults|bugSearchResults/*">
				<ul class="nav nav-list bs-docs-sidenav">
					<xsl:if test="/gentoo/searchResults/*">
						<li><a href="#packages"><i class="icon-chevron-right"></i>Packages</a></li>
					</xsl:if>
					<xsl:if test="/gentoo/bugSearchResults/*">
						<li><a href="#bugs"><i class="icon-chevron-right"></i>Bugs</a></li>
					</xsl:if>
				</ul>
			</xsl:if>
		</div>
		<div class="span9">
			<xsl:if test="/gentoo/searchResults/*|/gentoo/bugSearchResults/*">
				<xsl:apply-templates select="/gentoo/searchResults" />
				<xsl:apply-templates select="/gentoo/bugSearchResults" />
			</xsl:if>
			<xsl:if test="not(/gentoo/searchResults/*|/gentoo/bugSearchResults/*)">
				<section id="nothing">
					<h2 class="page-header">Sorry</h2>
					<p class="text-warning">Nothing found matching your search terms.</p>
				</section>
			</xsl:if>
		</div>
  </xsl:template>
  
	<xsl:template match="/gentoo/searchResults">
		<xsl:if test="/gentoo/searchResults/*">
			<section id="packages">
				<h2 class="page-header">Packages</h2>
				<xsl:apply-templates select="package" />
			</section>
		</xsl:if>
  </xsl:template>

  <xsl:template match="/gentoo/bugSearchResults">
		<xsl:if test="/gentoo/bugSearchResults/*">
			<section id="bugs">
				<h2 class="page-header">Bugs</h2>
				<xsl:for-each select="bug">
					<p>
						<a>
							<xsl:attribute name="href">http://bugs.gentoo.org/<xsl:value-of select="bugid" /></xsl:attribute>
							<xsl:attribute name="title"><xsl:value-of select="summary" /></xsl:attribute>
							<xsl:value-of select="bugid" />
						</a>
						:
						<xsl:value-of select="summary" />
					</p>
				</xsl:for-each>
			</section>
		</xsl:if>
  </xsl:template>
</xsl:stylesheet>