validate-user.xsl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  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. <xsl:import href="tmpl/display-user.xsl"/>
  9. <!-- layout variables -->
  10. <xsl:variable name="layout.global.nav.page" select="''"/>
  11. <!-- helper vars -->
  12. <xsl:variable name="user" select="xweb:x-data/xweb:x-model/eat:edit/eat:user"/>
  13. <xsl:variable name="is-new" select="not(boolean($user/@userId))"/>
  14. <xsl:template match="xweb:x-data" mode="page-title">
  15. <xsl:choose>
  16. <xsl:when test="$is-new = 'true'">
  17. <xsl:value-of select="key('i18n','edit-user.create.validate.title')"/>
  18. </xsl:when>
  19. <xsl:otherwise>
  20. <xsl:value-of select="key('i18n','edit-user.edit.validate.title')"/>
  21. </xsl:otherwise>
  22. </xsl:choose>
  23. </xsl:template>
  24. <xsl:template match="xweb:x-data" mode="page-intro">
  25. <div class="intro">
  26. <xsl:choose>
  27. <xsl:when test="$is-new = 'true'">
  28. <xsl:value-of select="key('i18n','edit-user.create.validate.intro')"
  29. disable-output-escaping="yes"/>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <xsl:value-of select="key('i18n','edit-user.edit.validate.intro')"
  33. disable-output-escaping="yes"/>
  34. </xsl:otherwise>
  35. </xsl:choose>
  36. </div>
  37. </xsl:template>
  38. <xsl:template match="xweb:x-data" mode="page-body">
  39. <xsl:apply-templates select="." mode="page-intro"/>
  40. <xsl:apply-templates select="$user" mode="validate"/>
  41. <br />
  42. <form method="post" action="{$web-context}{$ctx/xweb:path}">
  43. <input type="submit" name="_finish" value="{key('i18n','save.displayName')}"/>
  44. <xsl:text> </xsl:text>
  45. <input type="submit" name="_target0" value="{key('i18n','reedit.displayName')}"/>
  46. </form>
  47. </xsl:template>
  48. </xsl:stylesheet>