Files
indiekit-endpoint-activitypub/views/partials/ap-poll-options.njk
Ricardo 1dc42ad5e5 feat: outbound Delete, visibility addressing, CW/sensitive, polls, Flag reports (v2.10.0)
- Outbound Delete: broadcastDelete() + POST /admin/federation/delete route
- Visibility: unlisted + followers-only addressing via defaultVisibility config
- Content Warning: outbound sensitive flag + summary as CW text
- Polls: inbound Question/poll parsing with progress bar rendering
- Flag: inbound report handler with ap_reports collection + Reports tab
- Includes DM support files from v2.9.x (messages controller, storage, templates)
- Includes coverage audit and high-impact gaps implementation plan

Confab-Link: http://localhost:8080/sessions/cc343b15-8d10-43cd-a48f-ca912eb79b83
2026-03-14 08:51:44 +01:00

31 lines
1.2 KiB
Plaintext

{# Poll options partial — renders vote results for Question-type posts #}
{% if item.pollOptions and item.pollOptions.length > 0 %}
{% set totalVotes = 0 %}
{% for opt in item.pollOptions %}
{% set totalVotes = totalVotes + opt.votes %}
{% endfor %}
<div class="ap-poll">
{% for opt in item.pollOptions %}
{% set pct = (totalVotes > 0) and ((opt.votes / totalVotes * 100) | round) or 0 %}
<div class="ap-poll__option">
<div class="ap-poll__bar" style="width: {{ pct }}%"></div>
<span class="ap-poll__label">{{ opt.name }}</span>
<span class="ap-poll__votes">{{ pct }}%</span>
</div>
{% endfor %}
<div class="ap-poll__footer">
{% if item.votersCount > 0 %}
{{ item.votersCount }} {{ __("activitypub.poll.voters") }}
{% elif totalVotes > 0 %}
{{ totalVotes }} {{ __("activitypub.poll.votes") }}
{% endif %}
{% if item.pollClosed %}
· {{ __("activitypub.poll.closed") }}
{% elif item.pollEndTime %}
· {{ __("activitypub.poll.endsAt") }} <time datetime="{{ item.pollEndTime }}">{{ item.pollEndTime | date("PPp") }}</time>
{% endif %}
</div>
</div>
{% endif %}