1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Cleanup: Moved authlist template into own file

This commit is contained in:
Philipp Schafft 2022-03-06 18:09:42 +00:00
parent 4cf821d592
commit b7a10102d1
4 changed files with 27 additions and 50 deletions

View File

@ -25,6 +25,7 @@ nobase_dist_admin_DATA = \
includes/mountnav.xsl \
includes/player.xsl \
includes/playlist.xsl \
includes/authlist.xsl \
includes/web-page.xsl \
ui/confirmdeleteuser.xsl \
ui/confirmkillclient.xsl \

View File

@ -0,0 +1,24 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="authlist">
<ul>
<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>
</ul>
</xsl:template>
</xsl:stylesheet>

View File

@ -3,34 +3,10 @@
<xsl:include href="includes/page.xsl"/>
<xsl:include href="includes/mountnav.xsl"/>
<xsl:include href="includes/player.xsl"/>
<xsl:include href="includes/authlist.xsl"/>
<xsl:variable name="title">Active Mountpoints</xsl:variable>
<!-- Auth template -->
<xsl:template name="authlist">
<ul>
<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>
</ul>
</xsl:template>
<xsl:template name="content">
<div class="section">
<h2><xsl:value-of select="$title" /></h2>

View File

@ -4,36 +4,12 @@
<xsl:include href="includes/mountnav.xsl"/>
<xsl:include href="includes/player.xsl"/>
<xsl:include href="includes/playlist.xsl"/>
<xsl:include href="includes/authlist.xsl"/>
<xsl:param name="param-showall" />
<xsl:param name="param-has-mount" />
<xsl:variable name="title">Server status</xsl:variable>
<!-- Auth template -->
<xsl:template name="authlist">
<ul>
<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>
</ul>
</xsl:template>
<xsl:template name="content">
<h2>Server status</h2>