# Ballotage – 秘密黑白球投票

**URL:** https://meta.discourse.org/t/ballotage-secret-black-white-ball-ballots/413266
**Category:** Plugin
**Tags:** polls
**Created:** [2026年九月24日 18:24 UTC](https://meta.discourse.org/t/ballotage-secret-black-white-ball-ballots/413266 "2026-09-24T18:24:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DaniW42](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniw42/32/578844_2.png) [@DaniW42](https://meta.discourse.org/u/DaniW42)
#### Post date: [2026年九月24日 18:24 UTC](https://meta.discourse.org/t/ballotage-secret-black-white-ball-ballots/413266/1 "2026-09-24T18:24:06Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **摘要** | 针对特定成员组的秘密黑白球投票（“ballotage”），并支持参与情况监督。 |
| 🛠 | **仓库链接** | [GitHub - DaniW42/discourse-ballotage: A Discourse plugin for secret black/white-ball ballots ("ballotage" — in German "Kugelung"), as used by clubs, societies and other membership organizations for admitting new members. A member either casts a black or a white ball; who voted is recorded, but what they voted is not. · GitHub](https://github.com/DaniW42/discourse-ballotage) |
| 📖 | **安装指南** | [如何在 Discourse 中安装插件](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### 功能

这属于比较小众的功能……但是：许多俱乐部、协会和会所通过黑白球秘密投票来接纳新成员。此插件将该流程引入 Discourse：

- 位于 `/ballotage` 的投票页面，配置好的组成员可在设定时间段内（默认为开始日 00:01 至结束日 23:59，可选自定义时间）投出 **最终一票** ——黑球或白球。
- 位于 `/ballotage/manage` 的管理页面，供监督组和管理员使用：在投票进行期间查看 **谁已投票** ，投票结束后查看 **黑白球结果** 。
- 投票可以取消，然后 **定稿** （结果和参与者列表将被不可逆地删除），最后从列表中移除。
- 一次仅允许一个投票，投票页面可选显示通知文本，内置英语和德语。

 ![投票页面](https://global.discourse-cdn.com/meta/original/4X/f/2/d/f2dd058a544191fc300bcd4ef16d04fcf8c0e894.png)

 ![结束后的管理页面](https://global.discourse-cdn.com/meta/original/4X/e/4/5/e4509ed107ad2e945feaaac07c28b6697d070fcc.png)

### 投票如何保持秘密

- 数据库存储 **谁** 投了票（不记录选择，不记录时间戳）以及 **两个匿名计数器** ——没有任何信息将成员与其选择关联起来。计数器递增时不会触及 `updated_at` 字段。
- 计数在 **投票结束前保持隐藏** ：如果在参与者列表旁显示实时计数，观察者可能会将新出现的名字与刚刚变动的计数器对应起来。
- 定稿操作会永久删除结果和参与者列表。

局限性：如果有人拥有直接数据库访问权限，并在投票_进行期间_监视计数器，仍有可能关联投票。这超出了插件的能力范围，需要通过组织层面的措施来处理。

### 配置

| 设置 | 描述 |
| --- | --- |
| `ballotage_enabled` | 启用插件 |
| `ballotage_voting_group` | 允许投票的组 |
| `ballotage_oversight_group` | 可查看参与情况和结果的组（管理员始终可以） |
| `ballotage_oversight_can_manage` | 允许监督组创建、取消、定稿和删除投票 |
| `ballotage_info_text` | 显示在投票页面上的可选通知文本 |
| `ballotage_timezone` | 开始/结束时间的时区（默认 `Europe/Berlin`） |

在侧边栏或菜单中添加指向 `/ballotage` 的链接，以便成员找到投票页面。

### 兼容性

Discourse 2026.7 及更高版本。自 2026 年 9 月起已在小型论坛的生产环境中运行。

欢迎反馈、错误报告及翻译——请在此处或 GitHub 上提出。
