Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fsfe_followupsection.xsl 4.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:template name="fsfe_followupsection">
  4. <xsl:element name="section">
  5. <xsl:attribute name="id">followup</xsl:attribute>
  6. <!--
  7. TODO Okay, so the idea here is to be able to display different "followup" boxes. I would suggest doing it like this:
  8. - the xml page should be able to say that it wants to show a
  9. specific box and would contain e.g.
  10. <followup>subscribe-newsletter</followup> so the page would show
  11. the following box.
  12. - if the xml page does not contain any <followup> variable, then we should be able to set a default followup box on our own.
  13. This has the advantage that depending on priorities, we can show
  14. a box in all our pages at the bottom. For instance, when we are
  15. in the middle of our yearly fundraising, we could set the default
  16. to a "fundraising" box.
  17. For now, this is just a placeholder, so all pages show the
  18. "Subscribe to newsletter" box. Below that, some examples of boxes we
  19. should make.
  20. -->
  21. <xsl:choose>
  22. <xsl:when test="/buildinfo/document/followup = 'subscribe-nl'">
  23. <xsl:attribute name="class">subscribe-nl</xsl:attribute>
  24. <xsl:element name="h2">
  25. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'subscribe-newsletter'" /></xsl:call-template>
  26. </xsl:element>
  27. <xsl:call-template name="subscribe-nl" />
  28. </xsl:when>
  29. <xsl:when test="/buildinfo/document/followup = 'support'">
  30. <xsl:attribute name="class">support</xsl:attribute>
  31. <xsl:element name="h2">
  32. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'show-support'" /></xsl:call-template>
  33. </xsl:element>
  34. <xsl:element name="p">
  35. <xsl:call-template name="fsfe-gettext">
  36. <xsl:with-param name="id" select="'show-support-paragraph'" />
  37. </xsl:call-template>
  38. <br />
  39. <xsl:element name="a">
  40. <xsl:attribute name="href">/support/?followupbox</xsl:attribute>
  41. <xsl:attribute name="class">btn</xsl:attribute>
  42. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'support-fsfe'" /></xsl:call-template>
  43. </xsl:element>
  44. </xsl:element>
  45. </xsl:when>
  46. <xsl:when test="/buildinfo/document/followup = 'donate'">
  47. <xsl:attribute name="class">donate</xsl:attribute>
  48. <xsl:element name="h2">
  49. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'donate'" /></xsl:call-template>
  50. </xsl:element>
  51. <xsl:element name="p">
  52. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'donate-paragraph'" /></xsl:call-template>
  53. <br />
  54. <xsl:element name="a">
  55. <xsl:attribute name="href">/donate/donate.html?ref-followupbox</xsl:attribute>
  56. <xsl:attribute name="class">btn</xsl:attribute>
  57. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'donate'" /></xsl:call-template>
  58. </xsl:element>
  59. </xsl:element>
  60. </xsl:when>
  61. <xsl:when test="/buildinfo/document/followup = 'join'">
  62. <xsl:attribute name="class">join</xsl:attribute>
  63. <xsl:element name="h2">
  64. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'support/become'" /></xsl:call-template>
  65. </xsl:element>
  66. <xsl:element name="p">
  67. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'support-paragraph'" /></xsl:call-template>
  68. <br />
  69. <xsl:element name="a">
  70. <xsl:attribute name="href">https://my.fsfe.org/support</xsl:attribute>
  71. <xsl:attribute name="class">btn</xsl:attribute>
  72. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'support'" /></xsl:call-template>
  73. </xsl:element>
  74. </xsl:element>
  75. </xsl:when>
  76. <xsl:when test="/buildinfo/document/followup = 'no'">
  77. <xsl:attribute name="class">hide</xsl:attribute>
  78. </xsl:when>
  79. <xsl:otherwise>
  80. <xsl:attribute name="class">subscribe-nl</xsl:attribute>
  81. <xsl:element name="h2"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'subscribe-newsletter'" /></xsl:call-template></xsl:element>
  82. <xsl:call-template name="subscribe-nl" />
  83. </xsl:otherwise>
  84. </xsl:choose>
  85. </xsl:element>
  86. <!--/section#followup-->
  87. </xsl:template>
  88. </xsl:stylesheet>