/priv/sites/testsandbox/templates/test_helloworld.tpl

https://code.google.com/p/zotonic/ · Smarty Template · 211 lines · 156 code · 55 blank · 0 comment · 3 complexity · 1bc509e653b34c705dc464585da09c7f MD5 · raw file

  1. <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
  2. <html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\">
  3. <head>
  4. <title>zotonic</title>
  5. {% lib
  6. "/css/zp-base.css"
  7. "/css/zp-type.css"
  8. "/css/zp-forms.css"
  9. "/css/zp-project.css"
  10. "/css/zp-growl.css"
  11. "/css/zp-dialog.css"
  12. %}
  13. <!--[if IE]><link href="/lib/css/zp-ie.css" type="text/css" media="screen" rel="stylesheet" /><![endif]-->
  14. </head>
  15. <body>
  16. {% wire type="unload" action={alert text="Bye"} %}
  17. <div class="zp-wrapper">
  18. <h1>Hello, new world {{ helloworld_counter }}</h1>
  19. <div class="zp-50 content">
  20. <div class="padding">
  21. <h2>The menu should be below</h2>
  22. {% menu %}
  23. <h2>Postbacks which give some content</h2>
  24. <p>
  25. {% button text="Fill the content div" postback="fill_content" %}
  26. {% button text="Insert Top" postback="insert_top" %}
  27. {% button text="Insert Bottom" postback="insert_bottom" %}
  28. </p>
  29. <div class="clear"></div>
  30. <div id="content" style="border: 1px solid green; padding: 10px; width: 100px">
  31. This is the content div
  32. </div>
  33. <h2>Some drag/drop testing</h2>
  34. {% draggable id="drag1" tag="drag1" %}
  35. <div id="drag1" style="border: 2px solid #c33; background-color: #e99; padding: 10px; width: 100px; height: 50px">
  36. <p>
  37. Drag Me
  38. </p>
  39. </div>
  40. <div class="clear">&nbsp;</div>
  41. {% droppable id="drop1" tag="drop1" %}
  42. <div id="drop1" style="border: 2px solid #3c3; background-color: #9e9; padding: 10px; width: 100px; height: 50px">
  43. <p>
  44. Drop Here
  45. </p>
  46. </div>
  47. <h2>Sorter and sortables</h2>
  48. <div id="sort" class="padding">
  49. <div id="s1">
  50. <p>sortable 1</p>
  51. </div>
  52. <div id="s2">
  53. <p>sortable 2</p>
  54. </div>
  55. <div id="s3">
  56. <p>sortable 3</p>
  57. </div>
  58. <div id="s4">
  59. <p>sortable 4</p>
  60. </div>
  61. <div id="s5">
  62. <p>sortable 5</p>
  63. </div>
  64. </div>
  65. {% sorter id="sort" %}
  66. {% sortable id="s1" %}
  67. {% sortable id="s2" %}
  68. {% sortable id="s3" %}
  69. {% sortable id="s4" %}
  70. {% sortable id="s5" %}
  71. <h2>Some effects</h2>
  72. <div class="zp-20">
  73. {% button text="Hide" action={hide target="ef"} %}
  74. {% button text="Show" action={show target="ef"} %}<br/><br/>
  75. {% button text="Fade" action={fade_out target="ef"} %}
  76. {% button text="Appear" action={fade_in target="ef"} %}<br/><br/>
  77. {% button text="Toggle" action={toggle target="ef"} %}<br/><br/>
  78. <a id="tgl" href="#">wired toggle</a>
  79. {% wire id="tgl" action={toggle target="ef"} %}
  80. </div>
  81. <div class="zp-40">
  82. <div id="ef" style="border:1px solid black; background-color: #99c; padding: 10px">
  83. <p>Use the buttons on the left to test different effects on this div.</p>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="zp-50">
  89. <div class="padding">
  90. <h2>Some postbacks</h2>
  91. <h3>Javascript confirm</h3>
  92. <p>
  93. {% button text="Show Confirm" postback="show_confirm" %}<br/><br/>
  94. </p>
  95. <h3>Growl</h3>
  96. <p>
  97. {% button text="Show Temporary Growl" postback="show_growl" %}<br/><br/>
  98. {% button text="Show Permanent Growl" postback="show_growl_stay" %}<br/><br/>
  99. </p>
  100. <hr/>
  101. <h2>Form validation</h2>
  102. {% wire id="myform" type="submit" postback="some_tag" action={toggle target="ef"} %}
  103. <form id="myform" method="POST" action="postback">
  104. {# You could also use: delegate="module_handling_form" #}
  105. <label for="email">e-mail</label>
  106. <input type="text" id="email" name="email" value="" />
  107. {% validate id="email" type={presence} type={email} %}
  108. <div class="clear"></div>
  109. <button type="submit">Submit</button>
  110. <div class="clear"></div>
  111. </form>
  112. <h2>Redirect to somewhere</h2>
  113. {% button text="Redirect to /" action={redirect location="/"} %}
  114. </div>
  115. </div>
  116. </div>
  117. <hr/>
  118. <div class="zp-wrapper">
  119. <div class="padding">
  120. <h2>Dynamic id with <tt>#id</tt></h2>
  121. {{ #id }}
  122. {% button id=#id %}
  123. <div class="clear"></div>
  124. <h2>Cached include</h2>
  125. <p>Include below is cached for 10 seconds</p>
  126. {% include "test_included.tpl" maxage=10 %}
  127. <h2>Some images</h2>
  128. <p>
  129. {% image "koe.jpg" width=200 height=200 crop="east" mono blur style="border: 1px solid black" %}
  130. {% image "koe.jpg" width=200 height=200 crop style="border: 1px solid black" %}
  131. {% image "koe.jpg" width=200 height=200 crop="west" blur="20x8" style="border: 1px solid black" %}
  132. </p>
  133. <div class="clear"></div>
  134. <p>
  135. {% image "koe.jpg" width=200 height=200 crop="east" grey style="border: 1px solid black" %}
  136. {% image "koe.jpg" width=200 height=200 crop style="border: 1px solid black" %}
  137. {% image "koe.jpg" width=200 height=200 crop="west" grey blur="20x8" style="border: 1px solid black" %}
  138. </p>
  139. <div class="clear"></div>
  140. <h3>And the url of an image</h3>
  141. {% image_url "koe.jpg" width=400 crop="east" blur grey %}
  142. <h2>Id test (cont)</h2>
  143. And the id of above again: {{ #id }}
  144. <h2>catinclude test</h2>
  145. <p><strong>A person</strong></p>
  146. {% catinclude "catinclude_test.tpl" 1 %}
  147. <p><strong>Not a person</strong></p>
  148. {% catinclude "catinclude_test.tpl" 2 %}
  149. <h2>all catinclude test</h2>
  150. {% all catinclude "catinclude_test.tpl" 1 %}
  151. </div>
  152. </div>
  153. {% include "_js_include.tpl" %}
  154. {% script %}
  155. </body>
  156. </html>