Advertisement
Guest User

Part 2: HTML Custom Template

a guest
Dec 17th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.78 KB | None | 0 0
  1. {%- from "templates/print_formats/standard_macros_daniel_new.html" import add_header,
  2.          render_field, bottom -%}
  3.  
  4. {% for page in layout %}
  5. <div class="page-break" style="margin:1cm;">
  6.     {{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
  7.    
  8.     {% for section in page %}
  9.     <div class="row">
  10.         {% for column in section %}
  11.         <div class="col-xs-{{ (12 / section|len)|int }}">
  12.             {% for df in column %}
  13.                 {{ render_field(df, doc, num_page, max_pages) }}
  14.             {% endfor %}
  15.         </div>
  16.         {% endfor %}
  17.     </div>
  18.     {% endfor %}
  19.    
  20.      {{ bottom(doc, page_num, max_pages) }}
  21.  
  22. </div>
  23. {% endfor %}
  24.  
  25. {%- if trigger_print -%}
  26. <script>
  27. window.print();
  28. window.close();
  29. </script>
  30. {%- endif -%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement