/rubyrate/templates/wishes/list.mako

https://github.com/xaevir/RubyRate-python · Mako · 69 lines · 30 code · 12 blank · 27 comment · 4 complexity · 93cd5caeb3fd65872d836a11b5440286 MD5 · raw file

  1. <%inherit file="/base.mako"/>
  2. <%def name="page_segment()">wishes</%def>
  3. <%def name="scripts()">
  4. <script src="/static/js/libs/LABjs/LAB.js"></script>
  5. <script>
  6. $LAB
  7. .script("/static/js/libs/jquery/jquery.js")
  8. .script("/static/js/libs/underscore/underscore.js").wait()
  9. .script("/static/js/libs/backbone/backbone.js")
  10. .script("/static/js/libs/jquery-validation/jquery.validate.js")
  11. .script("/static/js/libs/raphael-min.js").wait()
  12. .script("/static/js/libs/isotope.min.js")
  13. .wait(function(){
  14. myplugin.init();
  15. framework.init();
  16. framework.doSomething();
  17. });
  18. </script>
  19. </%def>
  20. <%namespace file="/partials/wish_block.mako" import="wish_block"/>
  21. <%text>
  22. <script type="text/template" id="wish-item">
  23. <blockquote class="bubble tip-right">
  24. <p>
  25. <%= content %>
  26. </p>
  27. </blockquote>
  28. </script>
  29. </%text>
  30. <%doc>
  31. % if not wishes:
  32. <li>There are no wishes</li>
  33. % else:
  34. % for wish in wishes:
  35. <li class="isotope-item">
  36. <a href="/wishes/${wish['_id']}">
  37. <blockquote class="bubble tip-left">
  38. <p>
  39. % if len(wish['content']) > 160:
  40. ${wish['content'][0:160]}
  41. <span class="more"> ...</span>
  42. % else:
  43. ${wish['content']}
  44. % endif
  45. </p>
  46. <div class="zip-code">
  47. ${wish['zip_code']}
  48. </div>
  49. </blockquote>
  50. </a>
  51. </li>
  52. % endfor
  53. % endif
  54. </%doc>
  55. </ul>