Show tag key on tags page (#1526)
All checks were successful
continuous-integration/drone/push Build is passing

Co-authored-by: max.mehl <max.mehl@fsfe.org>
Co-authored-by: Reinhard Müller <reinhard@fsfe.org>
Reviewed-on: #1526
Reviewed-by: Reinhard Müller <reinhard@fsfe.org>
This commit is contained in:
2020-07-30 13:30:46 +02:00
parent 24b8a9aaa6
commit 89f29a7d36
5 changed files with 55 additions and 6 deletions

View File

@@ -9,6 +9,7 @@
@import "pages/interview";
@import "pages/spreadtheword";
@import "pages/freesoftware";
@import "pages/tags";
/* fsfe.org pages */

39
look/pages/tags.less Normal file
View File

@@ -0,0 +1,39 @@
// ============================================================================
// Styles specific to the tag overview page (/tags/tags.??.html)
// ============================================================================
body.tags {
#tagkey-toggle {
& ~ label {
.btn;
.btn-sm;
.btn-default;
}
& ~ ul > li > a > span.tagkey {
display: none;
}
}
#tagkey-toggle:checked {
& ~ label {
.btn-primary;
}
& ~ ul > li > a > span.tagkey {
display: inline;
}
}
ul.column {
columns: 1;
@media (min-width: @screen-xs-min) {
columns: 2;
}
@media (min-width: @screen-md-min) {
columns: 3;
}
}
}

View File

@@ -6,8 +6,6 @@
<!--display dynamic list of news items-->
<xsl:template name="tagged-news" match="tagged-news">
<xsl:element name="ul">
<xsl:attribute name="class">tag list</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/news[
translate(@date, '-', '') &lt;= translate(/buildinfo/@date, '-', '')
]">
@@ -27,8 +25,6 @@
<!--display dynamic list of event items-->
<xsl:template name="tagged-events" match="tagged-events">
<xsl:element name="ul">
<xsl:attribute name="class">tag list</xsl:attribute>
<!-- loop through all events having this tag -->
<xsl:for-each select="/buildinfo/document/set/event">
<xsl:sort select="@start" order="descending" />

View File

@@ -7,9 +7,12 @@
<title>Tags - FSFE</title>
</head>
<body>
<body class="tags">
<h1>Tags</h1>
<input type="checkbox" id="tagkey-toggle" class="hidden"/>
<label for="tagkey-toggle">Show tag keys</label>
<h2>News</h2>
<taglist section="news"/>

View File

@@ -9,7 +9,7 @@
</xsl:variable>
<xsl:element name="ul">
<xsl:attribute name="class">taglist</xsl:attribute>
<xsl:attribute name="class">column</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/tag[@section=$section]">
<xsl:sort select="."/>
@@ -25,6 +25,16 @@
</xsl:attribute>
<xsl:value-of select="."/>
<!-- show tag key (hidden by default) -->
<xsl:element name="span">
<xsl:attribute name="class">small tagkey</xsl:attribute>
<xsl:text> (</xsl:text>
<xsl:value-of select="@key"/>
<xsl:text>)</xsl:text>
</xsl:element>
<!-- show badge with number of usages -->
<xsl:text> </xsl:text>
<xsl:element name="span">
<xsl:attribute name="class">badge</xsl:attribute>