configform.xsl 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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" bgcolor="darkgreen">
  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="../app/ access permission check: ok (https://Seppo.Social/S1005)"
  77. title="if a security alert is visible here, ../app/ is publicly accessible from the www. See https://Seppo.Social/S1005"
  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> or created during operation. To get a fresh copy,
  84. delete a file and the marker file <code>delete-me-to-unpack-missing</code> and
  85. you'll get a fresh copy after visiting <a href="../
  86. seppo.cgi"><code>seppo.cgi</code></a>.</p>
  87. <h3>Banner</h3>
  88. <div id="banner">
  89. <img width="720" height="240" alt="Banner" src="../me-banner.jpg" title="adjust 'me-banner.jpg' next to seppo.cgi"/>
  90. </div>
  91. <p>Upload a jpg to your webspace and rename it to <code><a href="../me-banner.jpg">me-banner.jpg</a></code>
  92. (next to <code>seppo.cgi</code>). See also <a href="https://seppo.social/S1007">S1007</a></p>
  93. <h3>Avatar</h3>
  94. <p id="avatar">
  95. <img alt="Avatar" src="../me-avatar.jpg" title="adjust 'me-avatar.jpg' next to seppo.cgi"/>
  96. </p>
  97. <p>Upload a jpg to your webspace and rename it to <code><a href="../me-avatar.jpg">me-avatar.jpg</a></code>
  98. (next to <code>seppo.cgi</code>). See also <a href="https://seppo.social/S1007">S1007</a></p>
  99. <xsl:copy>
  100. <xsl:apply-templates select="@*|node()"/>
  101. </xsl:copy>
  102. </body>
  103. </xsl:for-each>
  104. </html>
  105. </xsl:template>
  106. <xsl:template match="h:input">
  107. <xsl:if test="@type != 'hidden'">
  108. <label for="{@name}" class="h3"><xsl:value-of select="@name"/></label>
  109. </xsl:if>
  110. <xsl:copy>
  111. <xsl:apply-templates select="@*|node()"/>
  112. </xsl:copy>
  113. </xsl:template>
  114. <xsl:template match="h:textarea">
  115. <label for="{@name}" class="h3"><xsl:value-of select="@name"/></label>
  116. <xsl:copy>
  117. <xsl:apply-templates select="@*|node()"/>
  118. </xsl:copy>
  119. </xsl:template>
  120. <xsl:template match="@*|node()">
  121. <xsl:copy>
  122. <xsl:apply-templates select="@*|node()"/>
  123. </xsl:copy>
  124. </xsl:template>
  125. </xsl:stylesheet>