TabRe Polls

Attach one poll to a new topic. The composer gets two extra fields, and the topic page shows a poll card with
radio choices, vote counts and percentage bars.

Where it shows up

  • the new topic composer gets a question field and an options box (one option per line) via region.composer.extra;
  • the topic page gets a poll card under the header (region.topic.header) with radio buttons and a Vote button,
    or the results once you have voted or the poll is closed;
  • guests see the results and a sign-in hint instead of the form.

Rules

  • The poll is optional: leave both fields empty and the topic is created without one.
  • A question is required once either field is filled in; there must be 2–10 options, one per line, each up to 120
    characters.
  • Every member gets one vote; votes cannot be changed.
  • Results are public after you vote, and always public after the poll closes.
  • A poll can close automatically after close_days days; 0 keeps it open forever. closes_at is stored on the
    poll, so changing the setting later does not move existing deadlines.

Settings

SettingMeaning
Close polls after (days)0–3650, default 0 (never closes).

Voting is a POST to /poll/{id}/vote with the CSRF token.

Data and uninstall

TableRows
plugin_tabre_pollone row per topic poll: topic, author, question, closes_at, created_at
plugin_tabre_poll_optionoptions with a position, unique per poll
plugin_tabre_poll_voteone row per member per poll, so a member cannot vote twice

Uninstalling the plugin drops all three tables; polls and votes are lost.

The manifest uses region.composer.extra, topic.header, topic.before_save (validation) and topic.after_save
(creation) and the /poll/{id}/vote route.