mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
- 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
31 lines
1.2 KiB
Plaintext
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 %}
|