# {{ self::t!("poll") }}
{% if let Some(title) = poll.content.lines().next() %}
## {{ title }}
{% endif %}
{{ poll.content | strip_hashtags }}
{# Retrieve the poll's options and list them #}
{% let options = poll.tags.filter_standardized(TagKind::Custom(Cow::Borrowed("option"))) %}
{%- for option in options %}
{%- match option %}
{%- when (TagStandard::PollOption(poll_option)) %}
{%- let mut counter = 0 -%}
{%- for event in responses.iter() %}
{%- let resps = event.tags.filter_standardized(TagKind::Custom(Cow::Borrowed("response"))) %}
{%- for resp in resps %}
{%- match resp %}
{%- when (TagStandard::PollResponse(r)) %}
{%- if r.clone() == poll_option.id %}
{%- mut counter += 1 -%}
{%- endif %}
{%- else %}
{%- endmatch %}
{%- endfor %}
{%- endfor %}
=> /polls/{{poll.id}}/respond/{{poll_option.id}} {{ poll_option.text }} ({{counter}})
{%- else %}
{%- endmatch %}
{%- endfor %}
