File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 </ a >
2626 </ li >
2727{%- endmacro -%}
28+
29+ {%- macro material_list(materials, filter_type=None) %}
30+ < ul >
31+ {% for mat in materials %}
32+ {% if filter_type == None or mat.url_type == filter_type %}
33+ {{ material_li(mat) }}
34+ {% endif %}
35+ {% endfor %}
36+ </ ul >
37+ {%- endmacro -%}
Original file line number Diff line number Diff line change 11{% extends "_base.html" %}
2- {% from "_macros.html" import material_li %}
2+ {% from "_macros.html" import material_list with context %}
33
44{% block content %}
55
2222
2323 {% if homework_section %}
2424 < h2 > Domácí projekty</ h2 >
25- < ul >
26- {% for mat in session.materials %}
27- {% if mat.url_type == "homework" %}
28- {{ material_li(mat) }}
29- {% endif %}
30- {% endfor %}
31- </ ul >
25+ {{ material_list(session.materials, filter_type='homework') }}
3226 {% endif %}
3327
3428 {% if link_section %}
3529 < h2 > Zajímavé odkazy</ h2 >
36-
37- < ul >
38- {% for mat in session.materials %}
39- {% if mat.url_type == "link" %}
40- {{ material_li(mat) }}
41- {% endif %}
42- {% endfor %}
43- </ ul >
30+ {{ material_list(session.materials, filter_type='link') }}
4431 {% endif %}
4532
4633 {% block coverpage_content %}
Original file line number Diff line number Diff line change 11{% extends "_base.html" %}
2- {% from "_macros.html" import material_li %}
2+ {% from "_macros.html" import material_list with context %}
33
44{% macro session_heading(session, index, plan) %}
55 {% if plan|length > 1 %}
4646 {{ session_heading(session, loop.index, plan) }}
4747 </ a >
4848 </ h4 >
49- < ul >
50- {% for mat in session.materials %}
51- {{ material_li(mat) }}
52- {% endfor %}
53- </ ul >
49+ {{ material_list(session.materials) }}
5450 </ div >
5551 {% endfor %}
5652
Original file line number Diff line number Diff line change 11{% extends "_base.html" %}
2- {% from "_macros.html" import material_li %}
2+ {% from "_macros.html" import material_list with context %}
33
44{% block content %}
55
2929 {% endif %}
3030
3131 < h2 > Materiály</ h2 >
32- < ul >
33- {% for mat in session.materials %}
34- {% if mat.url_type == "lesson" %}
35- {{ material_li(mat) }}
36- {% endif %}
37- {% endfor %}
38- </ ul >
32+ {{ material_list(session.materials, filter_type='lesson') }}
3933
4034 {% if cheatsheet_section %}
4135 < h2 > Taháky</ h2 >
42-
43- < ul >
44- {% for mat in session.materials %}
45- {% if mat.url_type == "cheatsheet" %}
46- {{ material_li(mat) }}
47- {% endif %}
48- {% endfor %}
49- </ ul >
36+ {{ material_list(session.materials, filter_type='cheatsheet') }}
5037 {% endif %}
5138
5239 {% block coverpage_content %}
You can’t perform that action at this time.
0 commit comments