dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15244
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5433: Made resource html view consistent with other views
------------------------------------------------------------
revno: 5433
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-15 13:26:12 +0100
message:
Made resource html view consistent with other views
modified:
dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl
dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl
dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/resource.xsl
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl 2011-12-14 15:28:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl 2011-12-15 12:26:12 +0000
@@ -7,7 +7,7 @@
<xsl:include href="identifiable-row.xsl"/>
<!-- match all plural elements -->
- <xsl:template match="d:maps|d:charts|d:categories|d:categoryCombos|
+ <xsl:template match="d:resources|d:maps|d:charts|d:categories|d:categoryCombos|
d:categoryOptions|d:categoryOptionCombos|d:dataElements|d:indicators|
d:organisationUnits|d:dataElementGroups|d:dataElementGroupSets|
d:documents|d:indicatorGroups|d:indicatorGroupSets|d:organisationUnitGroups|
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl 2011-12-14 15:28:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl 2011-12-15 12:26:12 +0000
@@ -10,13 +10,11 @@
<!-- html page level settings -->
<xsl:include href="html-wrapper.xsl"/>
- <!-- for resource 'directory' -->
- <xsl:include href="resource.xsl"/>
-
<!-- for list views -->
<xsl:include href="list.xsl"/>
<!-- for rendering elements -->
+ <xsl:include href="resource.xsl"/>
<xsl:include href="map.xsl"/>
<xsl:include href="chart.xsl"/>
<xsl:include href="category.xsl" />
@@ -43,6 +41,5 @@
<xsl:include href="sqlView.xsl"/>
<xsl:include href="user.xsl"/>
<xsl:include href="grid.xsl"/>
- <!-- etc ... -->
</xsl:stylesheet>
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/resource.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/resource.xsl 2011-12-07 16:03:19 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/resource.xsl 2011-12-15 12:26:12 +0000
@@ -4,72 +4,13 @@
xmlns:d="http://dhis2.org/schema/dxf/2.0"
>
- <xsl:template match="d:resources">
- <h1>Resources</h1>
- <ul class="resources">
- <xsl:for-each select="child::*">
- <li>
- <h2><xsl:value-of select="@name"/></h2>
- <xsl:variable name="link" select="@link"/>
- <table border="1">
- <tr>
- <xsl:for-each select="d:mediaTypes/d:mediaType">
- <td>
- <xsl:choose>
- <xsl:when test="text()='text/html'">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="$link"/>
- </xsl:attribute>
- <xsl:text>text/html</xsl:text>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="text()='application/xml'">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat($link,'.xml')"/>
- </xsl:attribute>
- <xsl:text>application/xml</xsl:text>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="text()='application/json'">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat($link,'.json')"/>
- </xsl:attribute>
- <xsl:text>application/json</xsl:text>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="text()='application/javascript'">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat($link,'.jsonp')"/>
- </xsl:attribute>
- <xsl:text>application/javascript</xsl:text>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text()='application/pdf'">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat($link,'.pdf')"/>
- </xsl:attribute>
- <xsl:text>application/pdf</xsl:text>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </li>
- </xsl:for-each>
- </ul>
+ <xsl:template match="d:resources" mode="short">
+ <xsl:if test="count(child::*) > 0">
+ <h3>Resources</h3>
+ <table border="1">
+ <xsl:apply-templates select="child::*" mode="row"/>
+ </table>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file