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

This commit is contained in:
2019-01-28 16:46:41 +01:00
parent a29980044e
commit 7218c614c0
3 changed files with 24 additions and 3 deletions

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>

View File

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

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>