{% macro render_result(result) -%}
    •  _{{ result.monitor.name }}_\n
{%- endmacro %}

{% macro render_results(color, results) %}
    {
        "text": "{% for result in results %}{{ render_result(result) }}{% endfor %}",
        "color": "{{ color }}",
        "mrkdwn_in": ["text", "pretext"]
    }
{% endmacro %}

{% macro render_passed() %}
    {{ render_results('good', result.monitors_passed_results) }}
{% endmacro %}

{% macro render_failed() %}
    {{ render_results('danger', result.monitors_failed_results) }}
{% endmacro %}

{% macro render_job_url() %}{% if data.job %} / <https://app.zyte.com/p/{{ data.job.key }}|view job in Scrapy Cloud>{% endif %}{% endmacro %}
{% macro render_report_url() %}{% if include_report_link and data.meta.reports_links %} / <{{ data.meta.reports_links[report_index] }}|report>{% endif %}{% endmacro %}
{% macro render_url() %}{{ render_report_url() }}{{ render_job_url() }}{% endmacro %}
{% macro render_spider_name() %}{% if data.spider %}{{ data.spider.name }}{% elif data.job %}{{ data.job.metadata['spider'] }}{% else %}??{% endif %}{% endmacro %}