需要编辑原因

The purpose of this component is to encourage users to add edit reasons when they edit a post. Edit reasons are displayed at the top of a post’s edit history modal and are a great way to understand why something within a post was changed. This might be especially useful for users that are able to edit other users’ posts as it will help to avoid any “why did you edit my post?!” responses.

How it Works

When someone opens the composer to edit, the edit reason field is exposed and marked required. The save button is disabled until the reason is added.

Once a reason is added, the edit can be saved

Configurable Settings

:star: Pro-tip: If you want to require all users to add edit reasons, simply add the trust_level_0 group to the “edit reason required groups” theme setting.

Installation

Repository Link
https://github.com/discourse/discourse-require-edit-reason

If you are unfamiliar with theme components and how to install them, check out the theme installation guide . And if you’d like to learn more about Discourse themes, take a look at this guide .

37 个赞

我已经重构了这个组件,使其能够再次工作,并且它更多地利用了原生的编辑器行为,而不是依赖于弹出窗口。

如果您需要添加原因,编辑时会看到:

添加编辑原因后,保存按钮将变为可用:

7 个赞