Subversion Repositories bacoAlunos

Rev

Rev 1310 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1071 jmachado 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"  version="1.0" xmlns:d="http://www.estgp.pt/baco/directory/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
3
        <xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes" />
4
        <xsl:param name="contextPath">/baco</xsl:param>
1312 jmachado 5
    <xsl:param name="authenticated">false</xsl:param>
6
 
1071 jmachado 7
        <xsl:template match="/">
1312 jmachado 8
        <div>
9
            <div class="menuTop hidden-xs">
10
                <ul class="m">
11
                    <xsl:apply-templates select="/d:directory/d:leaf" mode="root"/>
12
                </ul>
13
            </div>
14
            <div class="row menuTop hidden-sm hidden-md hidden-lg">
15
                    <xsl:apply-templates select="/d:directory/d:leaf" mode="xs"/>
16
            </div>
17
        </div>
1071 jmachado 18
        </xsl:template>
1312 jmachado 19
 
1071 jmachado 20
        <xsl:template match="d:leaf" mode="root">
1312 jmachado 21
 
22
         <li class="dropdown">
1071 jmachado 23
                        <a>
1312 jmachado 24
                <xsl:if test="./d:leaf">
25
                    <xsl:attribute name="class">dropdown-toggle</xsl:attribute>
26
                    <xsl:attribute name="data-toggle">dropdown</xsl:attribute>
27
                </xsl:if>
1071 jmachado 28
                                <xsl:attribute name="href">
29
                                        <xsl:choose>
30
                                                <xsl:when test="@url and @absolute='true'">
31
                                                        <xsl:value-of select="@url"/>
32
                                                </xsl:when>
33
                                                <xsl:when test="@url and @absolute='false'">
34
                                                        <xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
35
                                                </xsl:when>
36
                                                <xsl:otherwise>#</xsl:otherwise>
1312 jmachado 37
                                        </xsl:choose>
1071 jmachado 38
                                </xsl:attribute>
39
                                <xsl:value-of select="@label"/>
1312 jmachado 40
                <xsl:if test="./d:leaf">
41
                    <span class="caret"> </span>
42
                </xsl:if>
1097 jmachado 43
 
1312 jmachado 44
                        </a>
45
            <xsl:if test="./d:leaf">
1097 jmachado 46
                    <ul class="dropdown-menu">
47
                        <xsl:for-each select="./d:leaf">
48
                            <li>
49
                                <a>
50
                                    <xsl:attribute name="href">
51
                                        <xsl:choose>
52
                                            <xsl:when test="@url and @absolute='true'">
53
                                                <xsl:value-of select="@url"/>
54
                                            </xsl:when>
55
                                            <xsl:when test="@url and @absolute='false'">
56
                                                <xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
57
                                            </xsl:when>
58
                                            <xsl:otherwise>#</xsl:otherwise>
59
                                        </xsl:choose>
60
                                    </xsl:attribute>
61
                                    <xsl:value-of select="@label"/>
62
                                </a>
63
                            </li>
64
                        </xsl:for-each>
65
                    </ul>
1312 jmachado 66
 
67
            </xsl:if>
68
        </li>
69
 
70
        </xsl:template>
71
 
72
    <xsl:template match="d:leaf" mode="xs">
73
        <div class="col-xs-3 dropdown">
74
            <a>
75
                <xsl:if test="./d:leaf">
76
                    <xsl:attribute name="class">dropdown-toggle</xsl:attribute>
77
                    <xsl:attribute name="data-toggle">dropdown</xsl:attribute>
78
                </xsl:if>
79
                <xsl:attribute name="href">
80
                    <xsl:choose>
81
                        <xsl:when test="@url and @absolute='true'">
82
                            <xsl:value-of select="@url"/>
83
                        </xsl:when>
84
                        <xsl:when test="@url and @absolute='false'">
85
                            <xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
86
                        </xsl:when>
87
                        <xsl:otherwise>#</xsl:otherwise>
88
                    </xsl:choose>
89
                </xsl:attribute>
90
                <xsl:value-of select="@label"/>
91
                <xsl:if test="./d:leaf">
92
                    <span class="caret"> </span>
93
                </xsl:if>
94
            </a>
95
            <xsl:if test="./d:leaf">
96
                <ul class="dropdown-menu">
97
                    <xsl:for-each select="./d:leaf">
98
                        <li>
99
                            <a>
100
                                <xsl:attribute name="href">
101
                                    <xsl:choose>
102
                                        <xsl:when test="@url and @absolute='true'">
103
                                            <xsl:value-of select="@url"/>
104
                                        </xsl:when>
105
                                        <xsl:when test="@url and @absolute='false'">
106
                                            <xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
107
                                        </xsl:when>
108
                                        <xsl:otherwise>#</xsl:otherwise>
109
                                    </xsl:choose>
110
                                </xsl:attribute>
111
                                <xsl:value-of select="@label"/>
112
                            </a>
113
                        </li>
114
                    </xsl:for-each>
115
                </ul>
116
 
117
            </xsl:if>
118
        </div>
1097 jmachado 119
    </xsl:template>
120
 
1312 jmachado 121
 
122
 
1071 jmachado 123
</xsl:stylesheet>