Fix links to topics with empty slug because they use non-ascii titles

This commit is contained in:
Neil Lalonde 2013-04-19 16:47:14 -04:00
parent 0cd7c592ec
commit 2c516400de
2 changed files with 3 additions and 3 deletions
app/assets/javascripts/discourse

View file

@ -75,6 +75,8 @@ Discourse.Utilities = {
url = Discourse.getURL("/t/"); url = Discourse.getURL("/t/");
if (slug) { if (slug) {
url += slug + "/"; url += slug + "/";
} else {
url += 'topic/';
} }
url += topicId; url += topicId;
if (postNumber > 1) { if (postNumber > 1) {

View file

@ -14,10 +14,8 @@ Discourse.Notification = Discourse.Model.extend({
}).property('read'), }).property('read'),
url: (function() { url: (function() {
var slug;
if (this.blank('data.topic_title')) return ""; if (this.blank('data.topic_title')) return "";
slug = this.get('slug'); return Discourse.Utilities.postUrl(this.get('slug'), this.get('topic_id'), this.get('post_number'));
return Discourse.getURL("/t/") + slug + "/" + (this.get('topic_id')) + "/" + (this.get('post_number'));
}).property(), }).property(),
rendered: (function() { rendered: (function() {