configform.xsl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. _ _ ____ _
  4. _| || |_/ ___| ___ _ __ _ __ ___ | |
  5. |_ .. _\___ \ / _ \ '_ \| '_ \ / _ \| |
  6. |_ _|___) | __/ |_) | |_) | (_) |_|
  7. |_||_| |____/ \___| .__/| .__/ \___/(_)
  8. |_| |_|
  9. Personal Social Web.
  10. Copyright (C) The #Seppo contributors. All rights reserved.
  11. This program is free software: you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation, either version 3 of the License, or
  14. (at your option) any later version.
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. GNU General Public License for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. http://www.w3.org/TR/xslt/
  22. -->
  23. <xsl:stylesheet
  24. xmlns="http://www.w3.org/1999/xhtml"
  25. xmlns:h="http://www.w3.org/1999/xhtml"
  26. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  27. version="1.0">
  28. <!-- replace linefeeds with <br> tags -->
  29. <xsl:template name="linefeed2br">
  30. <xsl:param name="string" select="''"/>
  31. <xsl:param name="pattern" select="'&#10;'"/>
  32. <xsl:choose>
  33. <xsl:when test="contains($string, $pattern)">
  34. <xsl:value-of select="substring-before($string, $pattern)"/><br class="br"/><xsl:comment>Why do we see 2 br on Safari and output/@method=html here? http://purl.mro.name/safari-xslt-br-bug</xsl:comment>
  35. <xsl:call-template name="linefeed2br">
  36. <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
  37. <xsl:with-param name="pattern" select="$pattern"/>
  38. </xsl:call-template>
  39. </xsl:when>
  40. <xsl:otherwise>
  41. <xsl:value-of select="$string"/>
  42. </xsl:otherwise>
  43. </xsl:choose>
  44. </xsl:template>
  45. <xsl:output
  46. method="html"
  47. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  48. doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
  49. <xsl:variable name="xml_base">../</xsl:variable>
  50. <xsl:variable name="xml_base_pub" select="concat($xml_base,'o')"/>
  51. <xsl:variable name="skin_base" select="concat($xml_base,'themes/current')"/>
  52. <xsl:variable name="cgi_base" select="concat($xml_base,'seppo.cgi')"/>
  53. <xsl:template match="/">
  54. <xsl:apply-templates select="h:html"/>
  55. </xsl:template>
  56. <xsl:template match="h:html">
  57. <html xmlns="http://www.w3.org/1999/xhtml">
  58. <head>
  59. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  60. <!-- https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW26 -->
  61. <!-- http://maddesigns.de/meta-viewport-1817.html -->
  62. <!-- meta name="viewport" content="width=device-width"/ -->
  63. <!-- http://www.quirksmode.org/blog/archives/2013/10/initialscale1_m.html -->
  64. <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  65. <!-- meta name="viewport" content="width=400"/ -->
  66. <link href="{$skin_base}/style.css" rel="stylesheet" type="text/css"/>
  67. <link rel="icon" type="image/png" data-emoji="|S"/>
  68. <link rel="icon" type="image/jpg" href="../me-avatar.jpg"/>
  69. <title><xsl:value-of select="h:head/h:title"/></title>
  70. </head>
  71. <xsl:for-each select="h:body/h:form">
  72. <body onload="document.{@name}.title.focus();">
  73. <label form="{@name}" class="h1"><xsl:value-of select="../../h:head/h:title"/></label>
  74. <p><img
  75. width="600px" height="100px"
  76. alt="Well done, the directory ./app/ is protected from public access, the web server is configured correctly."
  77. title="If a movie quote is visible here, ./app/ lies unprotected on the net."
  78. src="../app/i-must-be-403.svg"/></p>
  79. <p>You are invited, but not obliged, to have a look at the files on
  80. your webspace. You find a directory <code>themes/current/</code> that contains the
  81. overall look of your #Seppo!. Most importantly <a href="../themes/current/style.css"><code>style.css</code></a>.</p>
  82. <p>All files outside <code>./app/</code> are unpacked from
  83. <code>seppo.cgi</code>. Delete the marker file <code>delete-me-to-unpack-missing</code> and you'll get fresh copies
  84. of all missing files after visiting e.g. <a href="../seppo.cgi"><code>seppo.cgi</code></a>.</p>
  85. <h3>Banner</h3>
  86. <p>In order to change, replace <code><a href="../me-banner.jpg">me-banner.jpg</a></code> on the webspace:</p>
  87. <div id="banner">
  88. <img width="720" height="240" alt="Banner" src="../me-banner.jpg"/>
  89. </div>
  90. <h3>Avatar</h3>
  91. <p>In order to change, replace <code><a href="../me-avatar.jpg">me-avatar.jpg</a></code> on the webspace:</p>
  92. <p id="avatar">
  93. <img alt="Avatar" src="../me-avatar.jpg"/>
  94. </p>
  95. <xsl:copy>
  96. <xsl:apply-templates select="@*|node()"/>
  97. </xsl:copy>
  98. </body>
  99. </xsl:for-each>
  100. </html>
  101. </xsl:template>
  102. <xsl:template match="h:input">
  103. <xsl:if test="@type != 'hidden'">
  104. <label for="{@name}" class="h3"><xsl:value-of select="@name"/></label>
  105. </xsl:if>
  106. <xsl:copy>
  107. <xsl:apply-templates select="@*|node()"/>
  108. </xsl:copy>
  109. </xsl:template>
  110. <xsl:template match="h:textarea">
  111. <label for="{@name}" class="h3"><xsl:value-of select="@name"/></label>
  112. <xsl:copy>
  113. <xsl:apply-templates select="@*|node()"/>
  114. </xsl:copy>
  115. </xsl:template>
  116. <xsl:template match="@*|node()">
  117. <xsl:copy>
  118. <xsl:apply-templates select="@*|node()"/>
  119. </xsl:copy>
  120. </xsl:template>
  121. </xsl:stylesheet>