mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
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>
|
||||
</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}}
|
||||
</a>
|
||||
{{link-domain link}}
|
||||
|
@ -4,6 +4,7 @@ class TopicLinkSerializer < ApplicationSerializer
|
||||
:title,
|
||||
:fancy_title,
|
||||
:internal,
|
||||
:attachment,
|
||||
:reflection,
|
||||
:clicks,
|
||||
:user_id,
|
||||
@ -25,6 +26,10 @@ class TopicLinkSerializer < ApplicationSerializer
|
||||
object['internal'] == 't'
|
||||
end
|
||||
|
||||
def attachment
|
||||
Discourse.store.has_been_uploaded?(object['url'])
|
||||
end
|
||||
|
||||
def reflection
|
||||
object['reflection'] == 't'
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user