{% macro render_content_date(post) %}

{% if post.publication_date != None %} Created: {{post.publication_date.strftime('%d-%m-%Y')}}     {% endif %} {% if post.date != None %} Posted: {{post.date.strftime('%d-%m-%Y')}} {% endif %}

{% endmacro %} {% macro render_comment(com) %}

{{com.title}}

User: {{com.user.username}}     {% if com.timestamp != None %} Posted: {{com.timestamp.strftime('%d-%m-%Y')}} {% endif %}

{{com.body}}

{% endmacro %} {% macro render_content_user_author(post) %}

{% if post.author != None %} Author: {{post.author}}     {% endif %} {% if post.user != None %} Posted by: {{post.user.username}}     {% endif %} {% if post.citation != None %} Cite as: {{post.citation}} {% endif %}

{% endmacro %} {% macro render_youtube_video(post) %} {% endmacro %} {% macro render_html5_video(post) %} {% endmacro %} {% macro render_main_content(post) %} {% if post.content_type != None %}
{% if post.content_type == "youtube" %} {{render_youtube_video(post)}} {% elif post.content_type == "video" %} {{render_html5_video(post)}} {% elif post.content_type == "image" %} {{render_image(post)}} {% elif post.content_type == "audio" %} {{render_audio(post)}} {% elif post.content_type == "document" %} {{render_document(post)}} {% endif %} {% if post.alt_content_type != None %}

Alternative link

{% endif %}
{% endif %} {% endmacro %} {% macro render_big_tag(t, Required, link) %} {% if Required == True %} {{t}} {% else %} {{t}} {% endif %} {% endmacro %} {% macro render_small_tag(t, Required, link) %} {% if Required == True %} {{t}} {% else %} {{t}} {% endif %} {% endmacro %} {% macro render_post_item(p) %}
{{p.title}}

{{p.username}}

{{p.text|safe}}

{% endmacro %} {% macro render_product_summary_box(data) %}
{{render_image(data[1], height="100px", linkprefix="/product/", link=data[0].id )}}
{% if data[0].price %}

{{data[0].price|safe}}

{% endif %}

{{data[0].title|safe}}

{{ render_tags([], data[2], "products", small=True) }} {% if data[0].summary %}

{{data[0].summary|safe}}.

{% endif %}
{% endmacro %} {% macro render_detailed_product_info(data, product_tags) %}
{{ render_tags([], product_tags, "products") }} {% if data[0].summary %}

{{data[0].summary|safe}}.

{% endif %}

Product Details

{{data[0].text|safe}}.

{% endmacro %} {% macro render_detailed_navbar(items) %}
Batteries Mice Trees
{% endmacro %} {% macro render_product_list(items) %}
{% for i in items %} {{render_product_item(i) }} {% endfor %}
{% endmacro %} {% macro render_image(url, width="100%", height="100%", linkprefix="", link="") %} {% if link != "" %} {% else %} {% endif %} {% endmacro %} {% macro render_tags(required_tags, optional_tags, objectname, small=False) %}
{% if required_tags %} {% if required_tags|length > 0 %} {% for t in required_tags %} {% if small %} {{ render_small_tag(t, True, objectname) }} {% else %} {{ render_big_tag(t, True, objectname) }} {% endif %} {% endfor %} {% endif %} {% endif %} {% if optional_tags %} {% if optional_tags|length > 0 %} {% for t in optional_tags %} {% if small %} {{ render_small_tag(t, False, objectname) }} {% else %} {{ render_big_tag(t, False, objectname) }} {% endif %} {% endfor %} {% endif %} {% endif %}
{% endmacro %}