Discourse 私人回复

Github: GitHub - communiteq/discourse-private-replies

此插件会隐藏主题回复,除了主题发起者和发帖人之外的所有人。

用途

例如,这可以用于家庭作业,老师会开启一个主题并发布作业,所有学生都会发布一个帖子来回答。当所有人都提交了他们的作品后,老师可以公开答案,这样学生就能讨论它们了。

第二个用途可以是一个拍卖,其中有物品出售。人们可以发布他们的出价,当交易完成后,主题所有者可以显示所有出价,以向社区展示一切都按照规则进行。

用法

安装并启用插件后,您可以按主题启用插件的功能。

如果您是主题发起者,您会在主题底部看到一个新按钮。

button

通过按下此按钮,您已为此主题启用了“私人回复”功能。

主题上方会出现一个横幅,并发生以下情况:

  • 人们只能看到他们自己、主题所有者以及选定组中用户发布的帖子。
  • 只有主题所有者才能看到所有帖子。

banner

再次按下按钮,主题将恢复正常。

启用插件后,它将允许在所有主题上进行私人回复。但是,如果启用了“仅在选定类别中启用私人回复”设置,则可以在类别安全设置中按类别启用插件。

在同一个屏幕上,您还可以找到为该类别中的所有新主题默认启用私人回复的设置。这在通过电子邮件提交主题时特别有用。

设置

  • private_replies_participants_can_see_all 如果启用,任何参与过该主题的人都可以看到所有回复
  • private_replies_min_trust_level_to_see_all 具有此信任级别或更高的人可以看到所有回复
  • private_replies_groups_can_see_all 这些组中的用户始终可以看到所有回复(默认:staff)
  • private_replies_see_all_from_groups 来自这些组中用户的帖子始终对所有人可见(默认:staff)
  • private_replies_topic_starter_primary_group_can_see_all 与主题所有者属于同一主要组的用户可以看到所有回复

注意事项

该插件禁用了以下检索帖子内容的方式:

  • 主题视图(即查看帖子的常规方式)
  • 用户个人资料 - 活动
  • 搜索
  • 原始 (/raw/topic_id/post_id)

但是,您仍然可以找出谁在主题中发帖:

  • 主题列表图标仍会显示谁在该主题中发帖。
  • 您还可以在主题底部看到“用户 xxx 正在回复”。
  • 主题也显示在用户个人资料 - 摘要中。

但是,所有这些都不会显示帖子的内容。

背景:

我的妻子是一位老师(古希腊和古典拉丁语),多年来一直在她的课堂上使用 Discourse。她主要用它来向学生分发作业并在之后进行讨论。然而,所有的作业都是在课堂上以纸质形式提交的。

直到现在——由于所有冠状病毒恐慌导致学校关闭,她正在转向 100% 在线教学,包括作业。所以,所有这些学生目前都在通过电子邮件向她发送他们的作品。这很不理想,因为它需要她进行大量的管理工作(我可以告诉你,她不擅长这类事情 :wink:)。

我们讨论了一些选项,她说:“为什么我不能有一个主题,让人们只能看到我的帖子(即主题发起者发布的帖子)和他们自己的帖子?这样我就可以将作业发布为一个主题,让每个学生在下面发布他们的答案,而看不到其他所有答案。然后当每个人都提交了他们的作品,到了该讨论的时候,我希望能够按一个按钮,让面纱消失,让所有主题中的帖子对每个人都可见,这样他们就可以看到并讨论彼此的作品。”

是的——太棒了!(这就是我爱她的原因)。所以我做了一个插件。之前的讨论在这里:Topic replies invisible until topic owner decides to reveal them?

78 个赞
Reply only visible to the post owner
Anyway to make Forms in Discourse - One Category?
Is there a "Reply to View" plugin for Discourse?
Let topic owner approve replies to their topic
Is this secure? Concept for private info in replies
Making a Category or Replies in a Topic Only Visible by Poster and Admin
Help With a Private Topics/Replies Alternative?
Is there an option on Discourse to allow a logged-in member to see only the topics where they participated?
Way to make part of the post visible to author and staff only?
Hide ALL replies to Topics in a Category by default using Spoiler Text Plugin
How to schedule posts (not topics)?
Is there a way to hide some text in a post?
Private post feature
Author-only Topic (take 2)
A new way to lead and facilitate conversations
Error Can't search when No login
Private Topics Plugin
Allow post author to see/reply to whisper posts
Discourse BCC
Private Topics Plugin
Is there a "Reply to View" plugin for Discourse?
Will uninstalling a plugin leave any residual debris files in the database?
Discourse Like and/or Reply to reveal the post
Help with auto-close topic?
2020: The Year in Review
Post Read-only mode on a category
Display 'top level comments' separate from comment replies (Alternative to Threaded Comments?)
Permissions in certain category
Resources for using Discourse in the classroom
Offering "private support" as part of a public support community
Offering "private support" as part of a public support community
Allow write access without read access
Permissions and clients/users

New ways schools can adopt with Discourse! Nice job! :grinning:

10 个赞

Very cool and thank you for sharing this @RGJ :beers:

15 个赞

Great to see this!

My one nitpick is that I’d rather have the feature enabled at the category level, then replies can get revealed per-topic when everything’s submitted.

11 个赞

Very cool, I was wondering if there is a way to still access the contents of private replies:

  • by Group (Teachers)
  • Trust Level (all teachers are at least Trust Level 3).
9 个赞

Why do you think that’s better?

That’s a pretty good idea. It shouldn’t be too hard to add that to the plugin.
I’ll keep it in mind but right now I don’t have a use case for this myself. PR’s are welcome though!

6 个赞

Prevents random abuse from topic starters enabling the setting on non-intended categories. It’s a “why would you do that?” situation but still something that needs a flag to resolve.

7 个赞

Yeah, that’s useful indeed. So that could be solved by a category setting ‘allow private replies’.
I thought you wanted a ‘topics have private replies by default’ setting, which would be harder to build.

6 个赞

你好,Richard!你的老师应该会很高兴,因为你的插件运行得非常棒 :grinning:

我想到了两点改进建议:

  1. 能否将此功能默认启用?这应该在分类设置中配置,无需在每个主题中手动操作。
  2. 能否让回复仅对设置中指定的群组可见?
7 个赞

你好!我想为你们的插件添加翻译。我尝试添加了两个额外文件:client.en 和 server.en。然后我执行了 ./launcher rebuild app,但在用户界面中更改语言设置后,翻译并未显示。我遗漏了什么?

1 个赞

文件应命名为 client.XX.ymlserver.XX.yml,其中 XX 为语言代码。

不过,en(英语)的文件已存在:https://github.com/communiteq/discourse-private-replies/tree/master/config/locales,因此我不确定您做了什么或试图达成什么目标。

3 个赞

我已经做过完全相同的事情(为德语添加了 client.de.ymlserver.de.yml),但没有任何变化。

  • 可能我发现了错误。我漏掉了文件名中的语言代码。我稍后会检查一下。
2 个赞

一旦您让一切正常运行,能否请您提交一个 PR?非常感谢您的支持!

1 个赞

一切正常,是我的失误。完成后我会将所有语言添加到你的分支中。

2 个赞

你好!我在 /sidekiq 中收到了来自你插件的错误。能否请你检查一下安装情况?你遇到类似错误了吗?

Wrapped I18n::InvalidLocaleData: 无法从 /var/www/discourse/plugins/discourse-private-replies/config/locales/server.ar.yml 加载翻译文件:#
<Psych::SyntaxError: (/var/www/discourse/plugins/discourse-private-replies/config/locales/server.ar.yml): 在第 3 行第 5 列解析块映射时未找到预期的键>

多了一个引号,应该将其删除。

private_replies_enabled: "启用“私人回复”插件。"
2 个赞

感谢您报告此问题!我已推送修复。

3 个赞

嘿,
无法从管理界面安装。它是否仅适用于 hooks?

错误信息如下:

about.json 不存在。您确定这是一个 Discourse 插件吗?
1 个赞

我不熟悉该错误消息。它并非 Discourse 源代码的一部分。您确定这是完整的消息吗?

插件也不是通过管理界面安装的。
请参阅 https://meta.discourse.org/t/install-plugins-in-discourse/19157。

2 个赞

@RGJ
我的公司 Haddee 非常希望能开发该插件的一些新功能。
我想请问您是否可以为其添加一个许可证,以便让贡献变得更加轻松和顺畅。

谢谢 :slight_smile:

6 个赞

好的,通过 hooks 系统安装确实成功了。

我想它不能像主题和扩展那样从管理员后台安装,因为它包含服务器端功能,所以被称为“插件”(Discourse 有这么多特定的术语以及各种扩展或定制方式,作为开发者很容易搞混)。

这个插件看起来简洁且小巧,便于定制。

感谢大家的回复 :wink:

2 个赞