listmounts.xsl 2.37 KB
Newer Older
1 2 3
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
	<xsl:output method="html" doctype-system="about:legacy-compat" encoding="UTF-8" />
	<!-- Import include files -->
4
	<xsl:include href="includes/page.xsl"/>
5 6
	<xsl:include href="includes/mountnav.xsl"/>

7
	<xsl:variable name="title">Active Mountpoints</xsl:variable>
8

9 10
	<!-- Auth template -->
	<xsl:template name="authlist">
11
		<ul>
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
			<xsl:for-each select="authentication/role">
				<li>Role
					<xsl:if test="@name">
						<xsl:value-of select="@name" />
					</xsl:if>
					of type <xsl:value-of select="@type" />
					<xsl:if test="@management-url">
						<xsl:choose>
							<xsl:when test="@can-adduser='true' or @can-deleteuser='true'">
								(<a href="{@management-url}">Manage</a>)
							</xsl:when>
							<xsl:when test="@can-listuser='true'">
								(<a href="{@management-url}">List</a>)
							</xsl:when>
						</xsl:choose>
					</xsl:if>
				</li>
			</xsl:for-each>
30
		</ul>
31 32 33
	</xsl:template>


34
	<xsl:template name="content">
35
				<div class="section">
36
					<h2><xsl:value-of select="$title" /></h2>
37
					<xsl:choose>
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
						<xsl:when test="source">
							<xsl:for-each select="source">
								<div class="article">
									<h3>Mountpoint <xsl:value-of select="@mount" /></h3>
									<!-- Mount nav -->
									<xsl:call-template name="mountnav" />
									<h4>Play stream</h4>
									<xsl:choose>
										<xsl:when test="authenticator">
											<a class="play" href="/auth.xsl">Auth</a>
										</xsl:when>
										<xsl:otherwise>
											<a class="play" href="{@mount}.m3u">&#9658; <span>M3U</span></a>
											<xsl:text> </xsl:text>
											<a class="play" href="{@mount}.xspf">&#9658; <span>XSPF</span></a>
											<xsl:text> </xsl:text>
											<a class="play" href="{@mount}.vclt">&#9658; <span>VCLT</span></a>
										</xsl:otherwise>
									</xsl:choose>
									<p><xsl:value-of select="listeners" /> Listener(s)</p>

									<!-- Mount Authentication -->
									<xsl:if test="authentication">
										<h4>Mount Authentication</h4>
										<xsl:call-template name="authlist" />
									</xsl:if>
								</div>
							</xsl:for-each>
66 67
						</xsl:when>
						<xsl:otherwise>
68 69 70
							<div class="aside error">
								<strong>No mounts!</strong> There are no active mountpoints.
							</div>
71 72 73
						</xsl:otherwise>
					</xsl:choose>
				</div>
74
	</xsl:template>
75
</xsl:stylesheet>