html_table.tpl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% block before_table %}{% endblock before_table %}
  2. {% block table %}
  3. {% if exclude_styles %}
  4. <table>
  5. {% else %}
  6. <table id="T_{{uuid}}"{% if table_attributes %} {{table_attributes}}{% endif %}>
  7. {% endif %}
  8. {% block caption %}
  9. {% if caption and caption is string %}
  10. <caption>{{caption}}</caption>
  11. {% elif caption and caption is sequence %}
  12. <caption>{{caption[0]}}</caption>
  13. {% endif %}
  14. {% endblock caption %}
  15. {% block thead %}
  16. <thead>
  17. {% block before_head_rows %}{% endblock %}
  18. {% for r in head %}
  19. {% block head_tr scoped %}
  20. <tr>
  21. {% if exclude_styles %}
  22. {% for c in r %}
  23. {% if c.is_visible != False %}
  24. <{{c.type}} {{c.attributes}}>{{c.display_value}}</{{c.type}}>
  25. {% endif %}
  26. {% endfor %}
  27. {% else %}
  28. {% for c in r %}
  29. {% if c.is_visible != False %}
  30. <{{c.type}} {%- if c.id is defined %} id="T_{{uuid}}_{{c.id}}" {%- endif %} class="{{c.class}}" {{c.attributes}}>{{c.display_value}}</{{c.type}}>
  31. {% endif %}
  32. {% endfor %}
  33. {% endif %}
  34. </tr>
  35. {% endblock head_tr %}
  36. {% endfor %}
  37. {% block after_head_rows %}{% endblock %}
  38. </thead>
  39. {% endblock thead %}
  40. {% block tbody %}
  41. <tbody>
  42. {% block before_rows %}{% endblock before_rows %}
  43. {% for r in body %}
  44. {% block tr scoped %}
  45. <tr>
  46. {% if exclude_styles %}
  47. {% for c in r %}{% if c.is_visible != False %}
  48. <{{c.type}} {{c.attributes}}>{{c.display_value}}</{{c.type}}>
  49. {% endif %}{% endfor %}
  50. {% else %}
  51. {% for c in r %}{% if c.is_visible != False %}
  52. <{{c.type}} {%- if c.id is defined %} id="T_{{uuid}}_{{c.id}}" {%- endif %} class="{{c.class}}" {{c.attributes}}>{{c.display_value}}</{{c.type}}>
  53. {% endif %}{% endfor %}
  54. {% endif %}
  55. </tr>
  56. {% endblock tr %}
  57. {% endfor %}
  58. {% block after_rows %}{% endblock after_rows %}
  59. </tbody>
  60. {% endblock tbody %}
  61. </table>
  62. {% endblock table %}
  63. {% block after_table %}{% endblock after_table %}