change-password.xsl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  3. xmlns:eat="http://msqr.us/xsd/ieat"
  4. xmlns:xweb="http://msqr.us/xsd/jaxb-web"
  5. exclude-result-prefixes="eat xweb">
  6. <!-- imports -->
  7. <xsl:import href="tmpl/default-layout.xsl"/>
  8. <!-- layout variables -->
  9. <xsl:variable name="layout.global.nav.page" select="'change-password'"/>
  10. <!-- helper vars -->
  11. <xsl:variable name="user" select="xweb:x-data/xweb:x-model/eat:edit/eat:user"/>
  12. <xsl:template match="xweb:x-data" mode="page-title">
  13. <xsl:value-of select="key('i18n','change-password.title')"/>
  14. </xsl:template>
  15. <xsl:template match="xweb:x-data" mode="page-body">
  16. <div class="intro">
  17. <xsl:value-of select="key('i18n','change-password.intro')"
  18. disable-output-escaping="yes"/>
  19. </div>
  20. <form method="post" action="{$web-context}{$ctx/xweb:path}">
  21. <xsl:variable name="login">
  22. <xsl:choose>
  23. <xsl:when test="$user">
  24. <xsl:value-of select="$user/@login"/>
  25. </xsl:when>
  26. <xsl:otherwise>
  27. <xsl:value-of select="$req[@key='login']"/>
  28. </xsl:otherwise>
  29. </xsl:choose>
  30. </xsl:variable>
  31. <table class="form">
  32. <xsl:if test="string-length($login) &gt; 0">
  33. <tr>
  34. <th>
  35. <xsl:value-of select="key('i18n','login.displayName')"/>
  36. </th>
  37. <td>
  38. <xsl:value-of select="$login"/>
  39. </td>
  40. </tr>
  41. </xsl:if>
  42. <tr>
  43. <th>
  44. <xsl:value-of select="key('i18n','password.displayName')"/>
  45. </th>
  46. <td colspan="3">
  47. <input type="password" name="password" maxlength="64"/>
  48. </td>
  49. </tr>
  50. <tr>
  51. <th/>
  52. <td>
  53. <input type="submit" value="{key('i18n','save.displayName')}"/>
  54. </td>
  55. </tr>
  56. </table>
  57. </form>
  58. <script type="text/javascript" xml:space="preserve">
  59. <xsl:comment>
  60. document.forms[0].elements['password'].focus();
  61. //</xsl:comment>
  62. </script>
  63. </xsl:template>
  64. </xsl:stylesheet>