remove preferences/badge-title files now that the title selector on the account prefs tab includes badge titles

This commit is contained in:
Neil Lalonde 2018-04-26 17:19:49 -04:00
parent f7c4c71409
commit 5fac155537
4 changed files with 0 additions and 48 deletions

View File

@ -1,9 +0,0 @@
import BadgeSelectController from "discourse/mixins/badge-select-controller";
export default Ember.Controller.extend(BadgeSelectController, {
filteredList: function() {
return this.get('model').filterBy('badge.allow_title', true);
}.property('model')
});

View File

@ -126,7 +126,6 @@ export default function() {
this.route('email');
this.route('second-factor');
this.route('about', { path: '/about-me' });
this.route('badgeTitle', { path: '/badge_title' });
});
this.route('userInvited', { path: '/invited', resetNamespace: true }, function() {

View File

@ -1,34 +0,0 @@
import UserBadge from 'discourse/models/user-badge';
import RestrictedUserRoute from "discourse/routes/restricted-user";
export default RestrictedUserRoute.extend({
showFooter: true,
model: function() {
return UserBadge.findByUsername(this.modelFor('user').get('username'));
},
renderTemplate: function() {
return this.render('user/badge-title', { into: 'user' });
},
// A bit odd, but if we leave to /preferences we need to re-render that outlet
deactivate: function() {
this._super();
this.render('preferences', { into: 'user', controller: 'preferences' });
},
setupController: function(controller, model) {
controller.set('model', model);
controller.set('user', this.modelFor('user'));
model.forEach(function(userBadge) {
if (userBadge.get('badge.name') === controller.get('user.title')) {
controller.set('selectedUserBadgeId', userBadge.get('id'));
}
});
if (!controller.get('selectedUserBadgeId') && controller.get('selectableUserBadges.length') > 0) {
controller.set('selectedUserBadgeId', controller.get('selectableUserBadges')[0].get('id'));
}
}
});

View File

@ -1,4 +0,0 @@
{{badge-title
selectedUserBadgeId=selectedUserBadgeId
selectableUserBadges=selectableUserBadges
user=user}}