FEATURE: add plugin-outlets from groups & categories incoming emails

This commit is contained in:
Régis Hanol 2016-07-20 16:00:30 +02:00
parent fe080f5c57
commit af53d37e47
4 changed files with 24 additions and 25 deletions

View File

@ -2,26 +2,23 @@ import Group from 'discourse/models/group';
export default Discourse.Route.extend({
model: function(params) {
var groups = this.modelFor('adminGroupsType');
model(params) {
if (params.name === 'new') {
return Group.create({
automatic: false,
visible: true
});
return Group.create({ automatic: false, visible: true });
}
var group = groups.findProperty('name', params.name);
const group = this.modelFor('adminGroupsType')
.findProperty('name', params.name);
if (!group) { return this.transitionTo('adminGroups.index'); }
return group;
},
setupController: function(controller, model) {
setupController(controller, model) {
controller.set("model", model);
controller.set("model.usernames", null);
controller.set("savingStatus", '');
controller.set("savingStatus", "");
model.findMembers();
}

View File

@ -94,10 +94,10 @@
</div>
{{#if siteSettings.email_in}}
<div>
{{#plugin-outlet "group-email-in"}}
<label for="incoming_email">{{i18n 'admin.groups.incoming_email'}}</label>
{{text-field name="incoming_email" value=model.incoming_email placeholderKey="admin.groups.incoming_email_placeholder"}}
</div>
{{/plugin-outlet}}
{{/if}}
{{/unless}}

View File

@ -1,5 +1,5 @@
import { ajax } from 'discourse/lib/ajax';
import computed from 'ember-addons/ember-computed-decorators';
import computed from "ember-addons/ember-computed-decorators";
const Group = Discourse.Model.extend({
limit: 50,

View File

@ -20,6 +20,7 @@
</section>
{{#if emailInEnabled}}
{{#plugin-outlet "category-email-in"}}
<section class='field'>
<label>
{{input type="checkbox" checked=category.email_in_allow_strangers}}
@ -34,6 +35,7 @@
{{text-field value=category.email_in}}
</label>
</section>
{{/plugin-outlet}}
{{/if}}
{{#if showPositionInput}}