2014-11-19 14:37:43 -05:00
|
|
|
// Support for changing the notification level of various topics
|
2014-05-04 14:30:17 -04:00
|
|
|
export default Em.Controller.extend({
|
2014-05-27 10:51:03 -04:00
|
|
|
needs: ['topic-bulk-actions'],
|
2014-02-14 17:38:55 -05:00
|
|
|
notificationLevelId: null,
|
|
|
|
|
|
|
|
notificationLevels: function() {
|
|
|
|
var result = [];
|
|
|
|
Object.keys(Discourse.Topic.NotificationLevel).forEach(function(k) {
|
|
|
|
result.push({
|
|
|
|
id: Discourse.Topic.NotificationLevel[k].toString(),
|
|
|
|
name: I18n.t('topic.notifications.' + k.toLowerCase() + ".title"),
|
|
|
|
description: I18n.t('topic.notifications.' + k.toLowerCase() + ".description")
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return result;
|
|
|
|
}.property(),
|
|
|
|
|
|
|
|
disabled: Em.computed.empty("notificationLevelId"),
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
changeNotificationLevel: function() {
|
2014-05-27 10:51:03 -04:00
|
|
|
this.get('controllers.topic-bulk-actions').performAndRefresh({
|
2014-02-14 17:38:55 -05:00
|
|
|
type: 'change_notification_level',
|
|
|
|
notification_level_id: this.get('notificationLevelId')
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|