3 |
4 |
8 |
9 |
10 | {{/if}}
--------------------------------------------------------------------------------
/assets/javascripts/discourse/pre-initializers/extend-category-for-slack.js.es6:
--------------------------------------------------------------------------------
1 | import property from 'ember-addons/ember-computed-decorators';
2 | import Category from 'discourse/models/category';
3 |
4 | export default {
5 | name: 'extend-category-for-slack',
6 | before: 'inject-discourse-objects',
7 | initialize() {
8 |
9 | Category.reopen({
10 |
11 | @property('custom_fields.slack_channel')
12 | slack_channel: {
13 | get(channelField) {
14 | return channelField;
15 | },
16 | set(value) {
17 | this.set("custom_fields.slack_channel", value);
18 | return value;
19 | }
20 | }
21 |
22 | });
23 | }
24 | };
--------------------------------------------------------------------------------
/config/locales/client.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | admin_js:
3 | admin:
4 | site_settings:
5 | categories:
6 | slack: 'Slack'
7 | js:
8 | slack:
9 | channel: "Slack channel"
--------------------------------------------------------------------------------
/config/locales/server.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | site_settings:
3 | slack_enabled: 'Check this to enable the Slack integration.'
4 | slack_url: 'Slack URL including access token.'
5 | slack_channel: 'Slack channel to post this message to. (i.e. #general, @username). Leaving blank for no fallback is helpful if using "allow category slack channel" setting.'
6 | slack_emoji: 'Slack emoji to use.'
7 | slack_posts: 'Post all new posts to Slack (not just new topics).'
8 | slack_full_names: 'Shows user full names instead of usernames (shows username if user did not set one)'
9 | allow_category_slack_channel: 'Allows each category to specify a Slack channel to post to, falls back to parent categories or the global channel'
10 | slack_category_name_in_title: 'Display the category name in the title of the post sent to Slack (e.g., "[category name] topic title")'
11 |
--------------------------------------------------------------------------------
/config/settings.yml:
--------------------------------------------------------------------------------
1 | slack:
2 | slack_enabled:
3 | client: true
4 | default: false
5 | slack_url:
6 | client: true
7 | default: '