basic setup for a subscribe-emails followup box
All checks were successful
continuous-integration/drone/pr Build is passing

far from perfect. it would be great to re-use texts from modules to avoid duplicating them in texts.*.eml
This commit is contained in:
Max Mehl 2022-03-16 14:45:20 +01:00
parent c648a8b3b2
commit 5d906b78cc
Signed by: max.mehl
GPG Key ID: 2704E4AB371E2E92
2 changed files with 46 additions and 0 deletions

View File

@ -32,6 +32,14 @@
</xsl:element>
<xsl:call-template name="subscribe-nl" />
</xsl:when>
<!-- subscribe-emails: form with which people can sign up for emails via fsfe-cd -->
<xsl:when test="/buildinfo/document/followup = 'subscribe-emails'">
<xsl:attribute name="class">subscribe-emails</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'subscribe-emails'" /></xsl:call-template>
</xsl:element>
<xsl:call-template name="subscribe-emails" />
</xsl:when>
<!-- donate: link to /donate -->
<xsl:when test="/buildinfo/document/followup = 'donate'">
<xsl:attribute name="class">donate</xsl:attribute>
@ -148,4 +156,38 @@
<input id="submit" type="submit" value="{$submit}"/>
</form>
</xsl:template>
<xsl:template name="subscribe-emails">
<!-- the language the visitor is on -->
<xsl:variable name="lang">
<xsl:value-of select="/buildinfo/document/@language"/>
</xsl:variable>
<!-- translation for "Your name" -->
<xsl:variable name="your-name">
<xsl:call-template name="gettext"><xsl:with-param name="id" select="'your-name'" /></xsl:call-template>
</xsl:variable>
<!-- translation for "Your email address" -->
<xsl:variable name="your-email">
<xsl:call-template name="gettext"><xsl:with-param name="id" select="'your-email'" /></xsl:call-template>
</xsl:variable>
<!-- translation for "Subscribe" -->
<xsl:variable name="subscribe">
<xsl:call-template name="gettext"><xsl:with-param name="id" select="'subscribe'" /></xsl:call-template>
</xsl:variable>
<!-- actual subscribe form -->
<form class="form-inline" method="post" action="https://my.fsfe.org/subscribe">
<input type="hidden" name="language" value="{$lang}"/>
<div class="form-group">
<input type="text" class="form-control" name="name" placeholder="{$your-name}" required="required"/>
</div>
<div class="form-group">
<input type="email" class="form-control" name="email1" placeholder="{$your-email}" required="required"/>
</div>
<fsfe-cd-referrer-input/>
<input type="hidden" name="wants_info" value="yes"/>
<button class="btn btn-default" type="submit"><xsl:value-of select="$subscribe" /></button>
</form>
</xsl:template>
</xsl:stylesheet>

View File

@ -97,6 +97,7 @@
<text id="pages">Pages</text>
<text id="receive-newsletter">Subscribe to FSFE's monthly newsletter</text>
<text id="subscribe-newsletter">Subscribe to the newsletter</text>
<text id="subscribe-emails">Subscribe to email updates</text>
@ -145,6 +146,9 @@
<text id="related-events">Related Events</text>
<text id="related-all">All related news and events</text>
<!-- Forms -->
<text id="your-name">Your name</text>
<text id="your-email">Your email address</text>
<!-- Sidebars -->
<text id="our-work">Our Work</text>