diff --git a/assets/javascripts/admin/components/rule-row.js.es6 b/assets/javascripts/admin/components/rule-row.js.es6
index 9782507..f246e98 100644
--- a/assets/javascripts/admin/components/rule-row.js.es6
+++ b/assets/javascripts/admin/components/rule-row.js.es6
@@ -3,6 +3,18 @@ import { popupAjaxError } from 'discourse/lib/ajax-error';
export default Ember.Component.extend({
tagName: 'tr',
+ isCategory: function(){
+ return this.get('rule.type') == 'normal'
+ }.property('rule.type'),
+
+ isMessage: function(){
+ return this.get('rule.type') == 'group_message'
+ }.property('rule.type'),
+
+ isMention: function(){
+ return this.get('rule.type') == 'group_mention'
+ }.property('rule.type'),
+
actions: {
edit: function(){
this.sendAction('edit', this.get('rule'))
diff --git a/assets/javascripts/discourse/templates/components/rule-row.hbs b/assets/javascripts/discourse/templates/components/rule-row.hbs
index 59efe10..12202e5 100644
--- a/assets/javascripts/discourse/templates/components/rule-row.hbs
+++ b/assets/javascripts/discourse/templates/components/rule-row.hbs
@@ -4,12 +4,16 @@
- {{#if rule.category}}
- {{category-link rule.category allowUncategorized="true" link="false"}}
- {{else if rule.group_id}}
- {{i18n "chat_integration.group_prefix"}} {{rule.group_name}}
- {{else}}
- {{i18n "chat_integration.all_categories"}}
+ {{#if isCategory}}
+ {{#if rule.category}}
+ {{category-link rule.category allowUncategorized="true" link="false"}}
+ {{else}}
+ {{i18n "chat_integration.all_categories"}}
+ {{/if}}
+ {{else if isMention}}
+ {{i18n "chat_integration.group_mention_template" name=rule.group_name}}
+ {{else if isMessage}}
+ {{i18n "chat_integration.group_message_template" name=rule.group_name}}
{{/if}}
|
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 43d469f..830fe30 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -6,7 +6,9 @@ en:
no_providers: "You need to enable some providers in the plugin settings"
channels_with_errors: "Some channels for this provider failed last time messages were sent. Click the error icon(s) to learn more."
channel_exception: "An unknown error occured when a message was last sent to this channel. Check the site logs for more information."
- group_prefix: "Group:"
+ group_mention_template: "Mentions of: @{{name}}"
+ group_message_template: "Messages to: @{{name}}"
+ choose_group: "(choose a group)"
all_categories: "(all categories)"
all_tags: "(all tags)"
create_rule: "Create Rule"
@@ -56,10 +58,11 @@ en:
group: Group
tags: Tags
instructions:
- filter: "Notification level. Mute overrides other matching rules."
- category: "This rule will only apply to topics in the specified category."
+ type: "Change the type to trigger notifications for group messages or mentions"
+ filter: "Notification level. Mute overrides other matching rules"
+ category: "This rule will only apply to topics in the specified category"
group: "This rule will apply to posts referencing this group"
- tags: "If specified, this rule will only apply to topics which have at least one of these tags."
+ tags: "If specified, this rule will only apply to topics which have at least one of these tags"
provider: