Update display of group rules in admin UI

This commit is contained in:
David Taylor 2017-08-01 20:12:42 +01:00
parent 01d7fb47ef
commit 7c3f58de41
3 changed files with 29 additions and 10 deletions

View File

@ -3,6 +3,18 @@ import { popupAjaxError } from 'discourse/lib/ajax-error';
export default Ember.Component.extend({ export default Ember.Component.extend({
tagName: 'tr', 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: { actions: {
edit: function(){ edit: function(){
this.sendAction('edit', this.get('rule')) this.sendAction('edit', this.get('rule'))

View File

@ -4,12 +4,16 @@
</td> </td>
<td> <td>
{{#if rule.category}} {{#if isCategory}}
{{category-link rule.category allowUncategorized="true" link="false"}} {{#if rule.category}}
{{else if rule.group_id}} {{category-link rule.category allowUncategorized="true" link="false"}}
{{i18n "chat_integration.group_prefix"}} {{rule.group_name}} {{else}}
{{else}} {{i18n "chat_integration.all_categories"}}
{{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}} {{/if}}
</td> </td>

View File

@ -6,7 +6,9 @@ en:
no_providers: "You need to enable some providers in the plugin settings" 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." 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." 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_categories: "(all categories)"
all_tags: "(all tags)" all_tags: "(all tags)"
create_rule: "Create Rule" create_rule: "Create Rule"
@ -56,10 +58,11 @@ en:
group: Group group: Group
tags: Tags tags: Tags
instructions: instructions:
filter: "Notification level. Mute overrides other matching rules." type: "Change the type to trigger notifications for group messages or mentions"
category: "This rule will only apply to topics in the specified category." 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" 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: provider: