Browse Source

inserting a dropdown list to pick the country from, and set the user's language selection dynamically

tags/contribute2018
Max Mehl 8 months ago
parent
commit
7218c614c0
Signed by: max.mehl <max.mehl@fsfe.org> GPG Key ID: 2704E4AB371E2E92

+ 2
- 3
contribute/spreadtheword.en.xhtml View File

@@ -156,8 +156,7 @@
<form class="highlight labeledform" id="orderpromo" method="post" action="/cgi-bin/promotion.php" accept-charset="utf-8">
<!-- Translators: please set the value for the language to your language code -->
<input type="hidden" name="language" value="en" />
<add-language />
<h3>Order promotional material</h3>
<p>Fields marked with * are mandatory.</p>
<fieldset>
@@ -186,7 +185,7 @@
</div>
<div>
<span class="formlabel">Country*:</span>
<input type="text" name="country" size="20" required="required" />
<country-list />
</div>
</fieldset>
<fieldset>

+ 1
- 0
contribute/spreadtheword.sources View File

@@ -1,2 +1,3 @@
contribute/promoitems/active-items:[]
contribute/promoitems/info-:[]
tools/countries:[]

+ 21
- 0
contribute/spreadtheword.xsl View File

@@ -2,6 +2,7 @@

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../fsfe.xsl" />
<xsl:import href="../tools/xsltsl/countries.xsl" />
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />

<!-- Fill dynamic content -->
@@ -226,4 +227,24 @@
</xsl:template>

<!-- Dropdown list of countries requiring a choice -->
<!-- when copying this, remember importing the xsl, and editing the .source file -->
<xsl:template match="country-list">
<xsl:call-template name="country-list">
<xsl:with-param name="required" select="'yes'"/>
</xsl:call-template>
</xsl:template>

<!-- Add a hidden field to the form to identify the language used. -->
<xsl:template match="add-language">
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="id">lang</xsl:attribute>
<xsl:attribute name="name">lang</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="/buildinfo/document/@language" />
</xsl:attribute>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

Loading…
Cancel
Save