edit-user.xsl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.title')"/>
  18. </xsl:when>
  19. <xsl:otherwise>
  20. <xsl:value-of select="key('i18n','edit-user.edit.title')"/>
  21. </xsl:otherwise>
  22. </xsl:choose>
  23. </xsl:template>
  24. <xsl:template match="xweb:x-data" mode="page-intro">
  25. <xsl:choose>
  26. <xsl:when test="$is-new = 'true'">
  27. <xsl:value-of select="key('i18n','edit-user.create.intro')"/>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:value-of select="key('i18n','edit-user.edit.intro')"/>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. </xsl:template>
  34. <xsl:template match="xweb:x-data" mode="page-body">
  35. <xsl:apply-templates select="." mode="page-intro"/>
  36. <form method="post" action="{$web-context}{$ctx/xweb:path}">
  37. <table class="form">
  38. <xsl:apply-templates select="$user" mode="edit"/>
  39. <tr>
  40. <th/>
  41. <td>
  42. <input type="submit" name="_target1" value="{key('i18n','continue.displayName')}"/>
  43. <xsl:text> </xsl:text>
  44. <input type="submit" name="_cancel" value="{key('i18n','cancel.displayName')}"/>
  45. </td>
  46. </tr>
  47. </table>
  48. <!-- handle contextual navigation -->
  49. <xsl:apply-templates select="eat:edit/eat:search-results"
  50. mode="search-results-contextual-navigation"/>
  51. </form>
  52. <script type="text/javascript" xml:space="preserve">
  53. <xsl:comment>
  54. document.forms[0].elements['user.name'].focus();
  55. //</xsl:comment>
  56. </script>
  57. </xsl:template>
  58. </xsl:stylesheet>