Merge pull request #3507 from techAPJ/patch-1
FIX: attachment links in topic map were giving 404
This commit is contained in:
commit
6e8be12816
|
@ -72,7 +72,7 @@
|
||||||
<span class='badge badge-notification clicks' title='{{i18n 'topic_map.clicks' count=clicks}}'>{{link.clicks}}</span>
|
<span class='badge badge-notification clicks' title='{{i18n 'topic_map.clicks' count=clicks}}'>{{link.clicks}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{unbound link.url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound link.user_id}}" data-ignore-post-id="true" title="{{unbound link.url}}">
|
<a href="{{unbound link.url}}" target="_blank" class='topic-link track-link {{if link.attachment "attachment"}}' data-user-id="{{unbound link.user_id}}" data-ignore-post-id="true" title="{{unbound link.url}}">
|
||||||
{{#if link.title}}{{link.title}}{{else}}{{shorten-url link.url}}{{/if}}
|
{{#if link.title}}{{link.title}}{{else}}{{shorten-url link.url}}{{/if}}
|
||||||
</a>
|
</a>
|
||||||
{{link-domain link}}
|
{{link-domain link}}
|
||||||
|
|
|
@ -4,6 +4,7 @@ class TopicLinkSerializer < ApplicationSerializer
|
||||||
:title,
|
:title,
|
||||||
:fancy_title,
|
:fancy_title,
|
||||||
:internal,
|
:internal,
|
||||||
|
:attachment,
|
||||||
:reflection,
|
:reflection,
|
||||||
:clicks,
|
:clicks,
|
||||||
:user_id,
|
:user_id,
|
||||||
|
@ -25,6 +26,10 @@ class TopicLinkSerializer < ApplicationSerializer
|
||||||
object['internal'] == 't'
|
object['internal'] == 't'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def attachment
|
||||||
|
Discourse.store.has_been_uploaded?(object['url'])
|
||||||
|
end
|
||||||
|
|
||||||
def reflection
|
def reflection
|
||||||
object['reflection'] == 't'
|
object['reflection'] == 't'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue