mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-05-05 07:57:27 +00:00
FEATURE: add solved enabled key
This commit is contained in:
parent
0b9853c7e2
commit
bf113f47b0
@ -173,9 +173,14 @@ function initializeWithApi(api) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (api.registerConnectorClass) {
|
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', {
|
api.registerConnectorClass('user-summary-stat', 'solved-count', {
|
||||||
shouldRender(args) {
|
shouldRender(args, component) {
|
||||||
return args.model.solved_count > 0;
|
return component.siteSettings.solved_enabled && args.model.solved_count > 0;
|
||||||
},
|
},
|
||||||
setupComponent() {
|
setupComponent() {
|
||||||
this.set('classNames', ['linked-stat']);
|
this.set('classNames', ['linked-stat']);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
en:
|
en:
|
||||||
site_settings:
|
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)"
|
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)"
|
accept_all_solutions_trust_level: "Minimum trust level required to accept solutions on any topic (even when not OP)"
|
||||||
reports:
|
reports:
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
plugins:
|
plugins:
|
||||||
|
solved_enabled:
|
||||||
|
default: true
|
||||||
|
client: true
|
||||||
allow_solved_on_all_topics:
|
allow_solved_on_all_topics:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
client: true
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
# version: 0.1
|
# version: 0.1
|
||||||
# authors: Sam Saffron
|
# authors: Sam Saffron
|
||||||
|
|
||||||
|
enabled_site_setting :solved_enabled
|
||||||
|
|
||||||
PLUGIN_NAME = "discourse_solved".freeze
|
PLUGIN_NAME = "discourse_solved".freeze
|
||||||
|
|
||||||
register_asset 'stylesheets/solutions.scss'
|
register_asset 'stylesheets/solutions.scss'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user