improve UX remove username said if we have a title

This commit is contained in:
Sam 2015-09-25 14:18:18 +10:00
parent 855370b242
commit 150ad01111
2 changed files with 3 additions and 2 deletions

View file

@ -48,9 +48,10 @@ Discourse.BBCode.register('quote', {noWrap: true, singlePara: true}, function(co
if (options.topicId && postNumber && options.getTopicInfo && topicId !== options.topicId) {
var topicInfo = options.getTopicInfo(topicId);
if (topicInfo) {
header.push(' ');
var href = topicInfo.href;
if (postNumber > 0) { href += "/" + postNumber; }
// get rid of username said stuff
header.pop();
header.push(['a', {'href': href}, topicInfo.title]);
}
}

View file

@ -13,7 +13,7 @@ describe PrettyText do
topic = Fabricate(:topic, title: "this is a test topic")
expected = <<HTML
<aside class="quote" data-post="2" data-topic="#{topic.id}"><div class="title">
<div class="quote-controls"></div>EvilTrout: <a href="http://test.localhost/t/this-is-a-test-topic/#{topic.id}/2">This is a test topic</a>
<div class="quote-controls"></div><a href="http://test.localhost/t/this-is-a-test-topic/#{topic.id}/2">This is a test topic</a>
</div>
<blockquote><p>ddd</p></blockquote></aside>
HTML