FEATURE: add solved enabled key

This commit is contained in:
Sam 2017-02-02 12:20:01 -05:00
parent 0b9853c7e2
commit bf113f47b0
4 changed files with 13 additions and 2 deletions

View File

@ -173,9 +173,14 @@ function initializeWithApi(api) {
});
if (api.registerConnectorClass) {
api.registerConnectorClass('user-activity-bottom', 'solved-list', {
shouldRender(args, component) {
return component.siteSettings.solved_enabled;
},
});
api.registerConnectorClass('user-summary-stat', 'solved-count', {
shouldRender(args) {
return args.model.solved_count > 0;
shouldRender(args, component) {
return component.siteSettings.solved_enabled && args.model.solved_count > 0;
},
setupComponent() {
this.set('classNames', ['linked-stat']);

View File

@ -1,5 +1,6 @@
en:
site_settings:
solved_enabled: "Enable solved plugin, allow users to select solutions for topics"
allow_solved_on_all_topics: "Allow users to select solutions on all topics (by default you control this by editing categories)"
accept_all_solutions_trust_level: "Minimum trust level required to accept solutions on any topic (even when not OP)"
reports:

View File

@ -1,4 +1,7 @@
plugins:
solved_enabled:
default: true
client: true
allow_solved_on_all_topics:
default: false
client: true

View File

@ -3,6 +3,8 @@
# version: 0.1
# authors: Sam Saffron
enabled_site_setting :solved_enabled
PLUGIN_NAME = "discourse_solved".freeze
register_asset 'stylesheets/solutions.scss'