export-recipe.xsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. <!-- layout variables -->
  9. <xsl:variable name="layout.global.nav.page" select="'export-recipe'"/>
  10. <!-- helper vars -->
  11. <xsl:variable name="search-results" select="$aux/eat:ui/eat:search-results"/>
  12. <xsl:variable name="index-section"
  13. select="$search-results/eat:ui-index/eat:index-section[@selected = 'true']"/>
  14. <xsl:variable name="recipe-criteria" select="$search-results/eat:recipe-criteria"/>
  15. <xsl:variable name="recipe" select="$aux/eat:ui/eat:recipe"/>
  16. <xsl:template match="xweb:x-data" mode="page-title">
  17. <xsl:value-of select="key('i18n','export-recipe.title')"/>
  18. </xsl:template>
  19. <xsl:template match="eat:recipe" mode="return-nav">
  20. <a class="back">
  21. <xsl:attribute name="href">
  22. <xsl:value-of select="$web-context"/>
  23. <xsl:text>/recipe.do?recipeId=</xsl:text>
  24. <xsl:value-of select="@recipeId"/>
  25. <xsl:apply-templates select="$index-section" mode="href"/>
  26. <xsl:apply-templates select="$recipe-criteria" mode="href"/>
  27. </xsl:attribute>
  28. <xsl:value-of select="key('i18n','back.to')"/>
  29. <xsl:text> </xsl:text>
  30. <xsl:value-of select="eat:name"/>
  31. </a>
  32. </xsl:template>
  33. <xsl:template match="xweb:x-data" mode="page-body">
  34. <div class="return-nav">
  35. <xsl:apply-templates select="$recipe" mode="return-nav"/>
  36. </div>
  37. <div class="intro">
  38. <xsl:value-of select="key('i18n','export-recipe.intro')" disable-output-escaping="yes"/>
  39. </div>
  40. <form method="post" action="{$web-context}{$ctx/xweb:path}">
  41. <table class="form">
  42. <tr>
  43. <th>
  44. <xsl:value-of select="key('i18n','recipe.displayName')"/>
  45. </th>
  46. <td>
  47. <xsl:value-of select="$recipe/eat:name"/>
  48. </td>
  49. </tr>
  50. <tr>
  51. <th>
  52. <xsl:value-of
  53. select="key('i18n','export.format.displayName')"/>
  54. </th>
  55. <td>
  56. <table class="form">
  57. <xsl:apply-templates select="$aux/eat:ui/eat:meta-support/eat:meta[@key='export-format']"/>
  58. </table>
  59. </td>
  60. </tr>
  61. <tr>
  62. <th/>
  63. <td>
  64. <input type="submit"
  65. value="{key('i18n','export.displayName')}"/>
  66. </td>
  67. </tr>
  68. </table>
  69. <input type="hidden" name="recipeId" value="{$recipe/@recipeId}"/>
  70. </form>
  71. <script type="text/javascript" xml:space="preserve">
  72. <xsl:comment>
  73. document.forms[0].elements['mode'][0].focus();
  74. //</xsl:comment>
  75. </script>
  76. </xsl:template>
  77. <xsl:template match="eat:meta">
  78. <tr>
  79. <td>
  80. <input type="radio" name="mode" value="{.}">
  81. <xsl:if test="position() = 1">
  82. <xsl:attribute name="checked">checked</xsl:attribute>
  83. </xsl:if>
  84. </input>
  85. </td>
  86. <td>
  87. <xsl:variable name="title-key">
  88. <xsl:text>export.format.</xsl:text>
  89. <xsl:value-of select="."/>
  90. </xsl:variable>
  91. <b>
  92. <xsl:value-of select="key('i18n',$title-key)"/>
  93. </b>
  94. <div>
  95. <xsl:variable name="explain-key">
  96. <xsl:value-of select="$title-key"/>
  97. <xsl:text>.explain</xsl:text>
  98. </xsl:variable>
  99. <xsl:value-of select="key('i18n',$explain-key)" disable-output-escaping="yes"/>
  100. </div>
  101. </td>
  102. </tr>
  103. </xsl:template>
  104. </xsl:stylesheet>