-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraph.xsl
90 lines (85 loc) · 4.43 KB
/
graph.xsl
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:doc="http://cosmology.education"
exclude-result-prefixes="xs doc">
<xsl:template match="/">
<html>
<head>
<title>Structure</title>
<meta charset="utf-8" />
<style type="text/css">
.label-color {
padding:2px 4px;
font-size:12px;
font-weight:bold;
border-radius:2px;
box-shadow:inset 0 -1px 0 rgba(0,0,0,0.12);
color: white;
margin-right: 5px;
}
</style>
</head>
<body>
<ul>
<xsl:for-each select="root/contents/content">
<xsl:variable name="id" select="./@id"/>
<xsl:variable name="uid" select="./@uid"/>
<xsl:variable name="text" select="./text"/>
<li><h3><a href="/{$id}/"><xsl:value-of select="./title" /></a></h3>
<xsl:choose>
<xsl:when test="./@ready">
<span class="label-color" style="background-color: blue;" title="ready">ready</span>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="./@reviewed">
<span class="label-color" style="background-color: #29fc29;" title="relecture faite">relecture faite</span>
</xsl:when>
<xsl:otherwise>
<span class="label-color" style="background-color: #fc2929;" title="relecture en attente">relecture en attente</span>
</xsl:otherwise>
</xsl:choose><br />
<h4>Evènements</h4>
<ul>
<xsl:for-each select="//root/events/event[@content-id=$uid]">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
<h4>Annexes</h4>
<ul>
<xsl:for-each-group select="//appendices/appendix/linkwords/linkword[contains($text, .)]" group-by="../../@id">
<li><a href="/{$id}/{../../@id}/"> <xsl:value-of select="../../title"/></a>
<span class="label-color"></span>
<xsl:choose>
<xsl:when test="../../@ready">
<span class="label-color" style="background-color: blue;" title="ready">ready</span>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="../../@reviewed">
<span class="label-color" style="background-color: #29fc29;" title="relecture faite">relecture faite</span>
</xsl:when>
<xsl:otherwise>
<span class="label-color" style="background-color: #fc2929;" title="relecture en attente">relecture en attente</span>
</xsl:otherwise>
</xsl:choose></li>
</xsl:for-each-group>
</ul>
<h4>Références</h4>
<ul>
<xsl:for-each select="//root/references/reference[@content-id=$id]">
<li><xsl:value-of select="./title"/></li>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>