Discourse Private Replies

Github: GitHub - communiteq/discourse-private-replies

このプラグインは、トピックの開始者と投稿の作成者以外には、トピックの返信を非表示にします。

ユースケース

これは、例えば宿題の課題に使用できます。教師がトピックを開いて課題を投稿し、すべての生徒が回答を投稿します。全員が作品を提出したら、教師は回答を公開して、生徒がそれらについて話し合えるようにすることができます。

2番目のユースケースはオークションです。何かを販売のために提供します。人々は入札を投稿でき、取引が完了したら、トピックの所有者はコミュニティにすべてがルールに従って行われたことを示すためにすべての入札を明らかにすることができます。

使用法

プラグインをインストールして有効にした後、トピックごとにプラグインの機能を使用できます。

トピックの開始者であれば、トピックの下部に新しいボタンが表示されます。

button

このボタンを押すと、このトピックでプライベート返信機能が有効になります。

トピックの上にバナーが表示され、次のようになります。

  • ユーザーは、自分自身、トピックの所有者、および選択されたグループのユーザーによって作成された投稿のみを表示できます。
  • トピックの所有者のみがすべての投稿を表示できます。

banner

ボタンをもう一度押すと、トピックは通常の状態に戻ります。

プラグインは、有効になっている場合、すべてのトピックでプライベート返信を許可します。ただし、「選択したカテゴリのみでプライベート返信」の設定が有効になっている場合、カテゴリのセキュリティ設定でカテゴリごとにプラグインを有効にすることができます。

同じ画面で、そのカテゴリのすべての新しいトピックでデフォルトでプライベート返信を有効にする設定も見つけることができます。これは、トピックが電子メールで送信される場合に特に便利です。

設定

  • private_replies_participants_can_see_all が有効な場合、トピックに参加した人は誰でもすべての返信を見ることができます。
  • private_replies_min_trust_level_to_see_all この信頼レベル以上のユーザーは、すべての返信を見ることができます。
  • private_replies_groups_can_see_all これらのグループのユーザーは、常にすべての返信を見ることができます(デフォルト:スタッフ)。
  • private_replies_see_all_from_groups これらのグループのユーザーからの投稿は、常にすべての人に表示されます(デフォルト:スタッフ)。
  • private_replies_topic_starter_primary_group_can_see_all トピックの所有者と同じプライマリグループのユーザーは、すべての返信を見ることができます。

注意事項

プラグインは、投稿の内容を取得する次の方法を無効にします。

  • トピックビュー(つまり、投稿を表示する通常の手段)
  • ユーザープロファイル - アクティビティ
  • 検索
  • 生の(/raw/topic_id/post_id)

ただし、トピックに誰が投稿したかを調べることは still できます。

  • トピックリストのアイコンは、トピックに誰が投稿したかを示し続けます。
  • トピックの下部で「ユーザーxxxが返信しています」と表示されることもあります。
  • トピックは、ユーザープロファイル - サマリーでも表示されます。

ただし、これらはすべて投稿の内容を明らかにしません。

背景:

私の配偶者は教師(古代ギリシャ語と古典ラテン語)であり、数年間、クラスでDiscourseを使用しています。彼女は主に生徒に課題を配布し、その後で議論するためにそれを使用しています。しかし、すべての課題は授業中に紙で提出されています。

学校がすべてのコロナパニックのために閉鎖されたため、これまでは100%オンライン教育に移行しており、課題も含まれています。そのため、現在、すべての生徒が彼女に作品を電子メールで送っています。これは、彼女がかなりの管理作業を行う必要があるため、非常に最適ではありません(そして、彼女はこれらの種類のことにあまり得意ではないことをお伝えできます:wink:)。

私たちはいくつかのオプションを議論していましたが、彼女は次のように言いました。「人々が私の投稿(つまり、トピックの開始者が作成した投稿)と自分自身の投稿しか見ることができないトピックをどうして持てないの?これにより、トピックとして課題を投稿し、すべての生徒がその下に回答を投稿できるように、他のすべての回答を見ることができないようにすることができます。全員が作品を入力し、議論の時期になったら、ベールを削除してすべての投稿を全員に表示できるボタンを押して、お互いの作品を見たり議論したりできるようにしたいのです。」

はい、素晴らしいです!(だから彼女が好きなのです)。それで、私はこのプラグインを作成しました。以前の議論はこちら:Topic replies invisible until topic owner decides to reveal them?

「いいね!」 77

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

Hello, Richard! Your teacher should be happy because your plugin works great :grinning:

I think about 2 improvements:

  1. Is it possible to make this function active by default? This should be set in the category settings. No need to do it manually with every topic.
  2. Make replies visible to specific groups set in the settings?
「いいね!」 7

Hi! I’d like to add translations to your plugin. Tried to add 2 extra files: client.en and server.en
Then I did ./launcher rebuild app, but the translation didn’t appear after I changed the locale in the user interface. What I missed?

「いいね!」 1

The files should be called client.XX.yml and server.XX.yml where XX is the language code.

However, there are already files for en (English): https://github.com/communiteq/discourse-private-replies/tree/master/config/locales so I am not sure what you have done or what you are trying to accomplish.

「いいね!」 3

I’ve done this exact thing (added client.de.yml and server.de.yml for the German language) and nothing changed.

  • Probably, I found the mistake. I missed the language code in the file. I’ll check it later.
「いいね!」 2

Can you please make a PR once you’ve got things working? That would be much appreciated!

「いいね!」 1

Everything is working, it was my mistake. I will add all languages to your fork when I finish it.

「いいね!」 2

Hi! I got errors in /sidekiq from your plugin. Can you please check your installation? Do you have such errors?

Wrapped I18n::InvalidLocaleData: can not load translations from /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): did not find expected key while parsing a block mapping at line 3 column 5>

There is an extra " that should be removed.

private_replies_enabled: "قم بتمكين المكون الإضافي "الردود الخاصة."
「いいね!」 2

Thank you for reporting this! I’ve pushed a fix.

「いいね!」 3

Hey,
It won’t install from the admin interface. Is it hooks only?

The error is:

about.json does not exist. Are you sure this is a Discourse plugin?
「いいね!」 1

I am not familiar with that error message. It is not part of the Discourse source code. Are you sure this is the exact message?

Plugins are not installed from the admin interface either.
Please refer to Install plugins on a self-hosted site.

「いいね!」 2

@RGJ
My company, Haddee, is eager to develop some new features for the plugin.
I was wondering if you could put a license on it just to make contribution easier and smoother

Thanks :slight_smile:

「いいね!」 6

Right, it worked installing from the hooks system indeed.
I guess it can’t be installed from the admin like themes and extensions as it has server features and that’s why it’s called a plug-in (so many specific terms and various ways to extend or customize Discourse that we can easily get lost as a dev)

This one seems clean and small enough to be easy to customize.

Thanks for the replies :wink:

「いいね!」 2