{% extends base %} {% from '_macros.html' import modal_form with context %} {% macro render_container(fluid=true) %}
{{ caller() }}
{% endmacro %} {% macro render_row() %}
{{ caller() }}
{% endmacro %} {% macro render_offset(num) %} col-md-offset-{{num}} {% endmacro %} {% macro render_push(num) %} col-md-push-{{num}} {% endmacro %} {% macro render_pull(num) %} col-md-pull-{{num}} {% endmacro %} {% macro render_column(num,offset=false,push=false,pull=false) %} {% set class = "col-md-%s" % num %} {% if offset %} {% set class = "%s %s" % (class,render_offset(offset)) %} {% endif %} {% if push %} {% set class = "%s %s" % (class,render_push(push)) %} {% endif %} {% if pull %} {% set class = "%s %s" % (class,render_pull(pull)) %} {% endif %}
{{ caller() }}
{% endmacro %} {% macro get_columns(cols=[]) %} {% call render_row() %} {% for col in cols %} {% call render_column(col) %} {{ col.content }} {% endcall %} {% endfor %} {% endcall %} {# {% endcall %} {% set count = 0 %} {% for col in cols %} {% call render_row() %} {% set cc = count + col.number %} {% if 12 >= cc %} {% call render_column(col.css) %} {{ col.content }} {% endcall %} {% set count = count + col.number %} {% else %} {% set count = 0 %} {% endif %} {% endcall %} {% endfor %} {% set rows = {} %} {% set col_count = 0 %} {% set row_num = 1 %} {% for col in cols %} {% set test_num = col.column_num + col_count %} {% if test_num > 12 %} {% set row_num = row_num + 1 %} {% set col_count = 0 %} {% endif %} {% if rows[row_num] %} {% set rows[row_num] = rows[row_num] + ' %d' % col.column_num %} {% else %} {% set rows[row_num] = '%d' % col.column_num %} {% endif %} {% set col_count = col_count + col.column_num %} {% endfor %} {% for row in rows.keys %} {% call render_row() %} {% for col_num in row.split(' ') %} {% for col in cols %} {% if col.id == (col_num* {% set css = 'col-md-%d' % col_num %} {% call render_column(css) %} {{ col.content }} {% endcall %} {% endfor %} {% endcall %} {% endfor %} #} {% endmacro %} {% block body %} click me {% call render_container(fluid=false) %} {% call render_row() %} {# ROW 1 #} {% call render_column(12) %} {% call render_row() %} {% call render_column(4) %}

md-col-4

{% endcall %} {% call render_column(8) %}

col-md-8

{{ modal_form(form,form_id)}} {% endcall %} {% endcall %} {% endcall %} {% call render_row() %} {# ROW 2 #} {% call render_column(12) %} {% call render_row() %} {% call render_column(8,offset=2) %}

col-md-10

{% endcall %} {% call render_column(2) %}

col-md-2

{% endcall %} {% endcall %} {% endcall %} {% endcall %} {% call render_row() %} {# ROW 3 #} {% call render_column(12) %} {% call render_row() %} {% call render_column(3) %}

md-col-3

{% endcall %} {% call render_column(3) %}

col-md-3

{% endcall %} {% call render_column(3) %}

col-md-3

{% endcall %} {% call render_column(3) %}

col-md-3

{% endcall %} {% endcall %} {% endcall %} {% endcall %} {% call render_row() %} {# ROW 4 #} {% call render_column(12) %} {% call render_row() %} {% call render_column(2) %}

md-col-2

{% endcall %} {% call render_column(2,push=7) %}

col-md-5

{% endcall %} {% call render_column(3) %}

col-md-3

{% endcall %} {% call render_column(2) %}

col-md-2

{% endcall %} {% endcall %} {% endcall %} {% endcall %} {% endcall %} {% endcall %} {% endblock %}