Add size information for merchandise
the build was successful Details

Closes #584
This commit is contained in:
Reinhard Müller 2018-12-29 20:39:25 +01:00
parent cc1816f02f
commit a96fc27e6d
9 changed files with 324 additions and 6 deletions

View File

@ -13,6 +13,29 @@
background: rgb(240,240,240);
width: 30%;
}
.tooltip-anchor {
color: #236892;
position: relative;
}
.tooltip-content {
color: black;
text-align: center;
width: 7em;
padding: .5em;
background-color: #85bfe2;
border: 1px solid black;
position: absolute;
right: 0;
bottom: 2em;
z-index: 1;
visibility: hidden;
}
.tooltip-content img {
width: 100%;
}
.tooltip-anchor:hover .tooltip-content {
visibility: visible;
}
</style>
<meta name="description" content="Zeigen Sie, dass Sie ein Fan von Freier Software sind, indem Sie die Artikel benutzen und tragen, die von der FSFE angeboten werden." />
<meta name="keywords" content="shop kaufen t-shirt pullover artikel merchandise werbung magnet tasche lätzchen pin versand bezahlung" />
@ -23,7 +46,7 @@
<h1>Fanartikel</h1>
<div id="toc">
<p style="text-indent:1em;">Available merchandise:</p>
<p style="text-indent:1em;">Kategorien:</p>
<ul style="margin-bottom: 1em;">
<li><a href="#tshirt">T-Shirts</a></li>
<li><a href="#girlie">Damen-T-Shirts</a></li>
@ -41,6 +64,11 @@
Projekte der FSFE.
</p>
<p>
Um die genauen Maße zu erhalten, bewegen Sie den Mauszeiger über die Größenangaben oder
sehen Sie in der <a href="size.html">Größentabelle</a> nach.
</p>
<p style="clear:both;"></p>
<form action="/cgi-bin/weborder.pl" method="post" class="item-grid">

View File

@ -13,6 +13,29 @@
background: rgb(240,240,240);
width: 30%;
}
.tooltip-anchor {
color: #236892;
position: relative;
}
.tooltip-content {
color: black;
text-align: center;
width: 7em;
padding: .5em;
background-color: #85bfe2;
border: 1px solid black;
position: absolute;
right: 0;
bottom: 2em;
z-index: 1;
visibility: hidden;
}
.tooltip-content img {
width: 100%;
}
.tooltip-anchor:hover .tooltip-content {
visibility: visible;
}
</style>
<meta name="description" content="Show your love for Free Software by using and wearing the branded items the FSFE offers." />
<meta name="keywords" content="shop order t-shirt shirts hoodie items merch merchandise promote magnet bag bib pin shipping buy postal payment" />
@ -39,8 +62,13 @@
your local community, and each sale helps to fund critical FSFE projects.
</p>
<p style="clear:both;"></p>
<p>
To get detailled information about the actual dimensions of the various
sizes of the chlothes, place your mouse pointer over the size label or
have a look at the <a href="size.html">size chart</a>.
</p>
<p style="clear:both;"></p>
<form action="/cgi-bin/weborder.pl" method="post" class="item-grid">
<h2 id="tshirt">T-Shirts</h2>

View File

@ -2,7 +2,6 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../fsfe.xsl" />
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
<!-- Fill dynamic content -->
<xsl:template match="dynamic-content">
@ -11,7 +10,7 @@
<xsl:element name="table">
<xsl:attribute name="class">merchandise</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/item [@type = $type]">
<xsl:for-each select="/buildinfo/document/set/item[@type=$type]">
<xsl:sort select="@date" order="descending"/>
<xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
<xsl:variable name="price"><xsl:value-of select="@price"/></xsl:variable>
@ -75,8 +74,47 @@
<xsl:attribute name="class">quantity</xsl:attribute>
<xsl:for-each select="available">
<xsl:element name="p">
<xsl:value-of select="@size"/>
<xsl:text>: </xsl:text>
<!-- Label, possibly with tooltip -->
<xsl:choose>
<xsl:when test="$type='other'">
<xsl:value-of select="@size"/>
<xsl:text>:&#160;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class">tooltip-anchor</xsl:attribute>
<xsl:value-of select="@size"/>
<xsl:text>:</xsl:text>
<xsl:element name="span">
<xsl:attribute name="class">tooltip-content</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="$type='hooded'">size-hooded.svg</xsl:when>
<xsl:otherwise>size-tshirt.svg</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:element name="br"/>
<xsl:text>a&#160;=&#160;</xsl:text>
<xsl:value-of select="@a"/>
<xsl:text>&#160;cm</xsl:text>
<xsl:element name="br"/>
<xsl:text>b&#160;=&#160;</xsl:text>
<xsl:value-of select="@b"/>
<xsl:text>&#160;cm</xsl:text>
<xsl:if test="$type='hooded'">
<xsl:element name="br"/>
<xsl:text>c&#160;=&#160;</xsl:text>
<xsl:value-of select="@c"/>
<xsl:text>&#160;cm</xsl:text>
</xsl:if>
</xsl:element>
<xsl:text>&#160;</xsl:text>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<!-- Real input for quantity -->
<xsl:element name="input">

13
order/size-hooded.svg Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<svg width="400" height="320" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<title>size-hooded</title>
<g fill="none" stroke="black">
<path id="outline" d="M172,82 L142,82 L2,222 L32,252 L132,152 L132,318 L268,318 L268,152 L368,252 L398,222 L258,82 L228,82 C270,-25 130,-25 172,82" stroke-width="4"/>
<path id="line_a" d="M132,160 L268,160" stroke-dasharray="5,5"/>
<path id="line_b" d="M240,82 L240,318" stroke-dasharray="5,5"/>
<path id="line_c" d="M2,222 L172,82" stroke-dasharray="5,5"/>
<text id="text_a" x="170" y="150" fill="black" font-family="sans-serif" font-size="48" font-style="italic">a</text>
<text id="text_b" x="205" y="250" fill="black" font-family="sans-serif" font-size="48" font-style="italic">b</text>
<text id="text_c" x="40" y="155" fill="black" font-family="sans-serif" font-size="48" font-style="italic">c</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 936 B

11
order/size-tshirt.svg Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<svg width="400" height="320" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<title>size-tshirt</title>
<g fill="none" stroke="black">
<path id="outline" d="M102,2 L2,52 L42,132 L102,102 L92,318 L308,318 L298,102 L358,132 L398,52 L298,2 L250,2 C230,30 170,30 150,2 L102,2" stroke-width="4"/>
<path id="line_a" d="M102,110 L298,110" stroke-dasharray="5,5"/>
<path id="line_b" d="M270,2 L270,318" stroke-dasharray="5,5"/>
<text id="text_a" x="150" y="100" fill="black" font-family="sans-serif" font-size="48" font-style="italic">a</text>
<text id="text_b" x="235" y="240" fill="black" font-family="sans-serif" font-size="48" font-style="italic">b</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 740 B

78
order/size.de.xhtml Normal file
View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Größentabelle FSFE</title>
</head>
<body>
<p id="category" class="p-category">
<a href="order.html">Fanartikel</a>
</p>
<h1>Größentabelle</h1>
<h2 id="tshirt">T-Shirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-tshirt.svg" alt="a = Brustweite, b = Länge"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Modell</th>
<th>Größe</th>
<th>a</th>
<th>b</th>
</tr>
<dynamic-content type="tshirt"/>
</table>
</div>
</div>
<h2 id="girlie">Damen-T-Shirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-tshirt.svg" alt="a = Brustweite, b = Länge"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Modell</th>
<th>Größe</th>
<th>a</th>
<th>b</th>
</tr>
<dynamic-content type="girlie"/>
</table>
</div>
</div>
<h2 id="hooded">Kapuzenshirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-hooded.svg" alt="a = Brustweite, b = Länge, c = Ärmellänge"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Modell</th>
<th>Größe</th>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
<dynamic-content type="hooded"/>
</table>
</div>
</div>
</body>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

78
order/size.en.xhtml Normal file
View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Size chart FSFE</title>
</head>
<body>
<p id="category" class="p-category">
<a href="order.html">Merchandise</a>
</p>
<h1>Size chart</h1>
<h2 id="tshirt">T-Shirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-tshirt.svg" alt="a = width, b = height"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Item</th>
<th>Size</th>
<th>a</th>
<th>b</th>
</tr>
<dynamic-content type="tshirt"/>
</table>
</div>
</div>
<h2 id="girlie">Women's T-Shirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-tshirt.svg" alt="a = width, b = height"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Item</th>
<th>Size</th>
<th>a</th>
<th>b</th>
</tr>
<dynamic-content type="girlie"/>
</table>
</div>
</div>
<h2 id="hooded">Hooded Shirts</h2>
<div class="row">
<div class="col-sm-3">
<img src="size-hooded.svg" alt="a = width, b = height, c = arm length"/>
</div>
<div class="col-sm-9">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th>Item</th>
<th>Size</th>
<th>a</th>
<th>b</th>
<th>c</th>
</tr>
<dynamic-content type="hooded"/>
</table>
</div>
</div>
</body>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

2
order/size.sources Normal file
View File

@ -0,0 +1,2 @@
order/*/item:[]
order/*/info:[]

42
order/size.xsl Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../fsfe.xsl" />
<!-- Fill dynamic content -->
<xsl:template match="dynamic-content">
<xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
<!-- Iterate through all items -->
<xsl:for-each select="/buildinfo/document/set/item[@type=$type]">
<xsl:sort select="@date" order="descending"/>
<xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
<xsl:variable name="name">
<xsl:value-of select="/buildinfo/document/set/info[@id=$id]/name"/>
</xsl:variable>
<!-- Iterate through all sizes -->
<xsl:for-each select="available">
<xsl:element name="tr">
<xsl:element name="td">
<xsl:value-of select="$name"/>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="@size"/>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="@a"/>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="@b"/>
</xsl:element>
<xsl:if test="$type='hooded'">
<xsl:element name="td">
<xsl:value-of select="@c"/>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>