From 9571eb07a40429519e9f66e46d0f2820833383e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 26 Feb 2014 22:45:19 +0100 Subject: [PATCH] BUGFIX: you should not be able to edit the category on a PM --- app/assets/javascripts/discourse/models/topic.js | 1 + .../javascripts/discourse/templates/topic.js.handlebars | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/models/topic.js b/app/assets/javascripts/discourse/models/topic.js index 9a32ada28e9..badaca103c6 100644 --- a/app/assets/javascripts/discourse/models/topic.js +++ b/app/assets/javascripts/discourse/models/topic.js @@ -144,6 +144,7 @@ Discourse.Topic = Discourse.Model.extend({ archetypeObject: function() { return Discourse.Site.currentProp('archetypes').findProperty('id', this.get('archetype')); }.property('archetype'), + isPrivateMessage: Em.computed.equal('archetype', 'private_message'), toggleStatus: function(property) { diff --git a/app/assets/javascripts/discourse/templates/topic.js.handlebars b/app/assets/javascripts/discourse/templates/topic.js.handlebars index 92eb539185d..fbf19bce0cf 100644 --- a/app/assets/javascripts/discourse/templates/topic.js.handlebars +++ b/app/assets/javascripts/discourse/templates/topic.js.handlebars @@ -12,7 +12,9 @@ {{/if}} {{#if editingTopic}} - {{categoryChooser valueAttribute="id" value=newCategoryId source=category_id}} + {{#unless isPrivateMessage}} + {{categoryChooser valueAttribute="id" value=newCategoryId source=category_id}} + {{/unless}} {{textField id='edit-title' value=newTitle}}