truncate sources on upload listing

This commit is contained in:
Albert Yi
2018-07-06 11:02:26 -07:00
parent 7b74f5caf6
commit 099654b2da

View File

@@ -42,7 +42,7 @@
<span class="info">
<strong>Source</strong>
<%= link_to_if (upload.source =~ %r!\Ahttps?://!i), (upload.source.presence || content_tag(:em, "none")), upload.source %>
<%= link_to_if (upload.source =~ %r!\Ahttps?://!i), (upload.source.presence.try(:truncate, 50) || content_tag(:em, "none")), upload.source %>
<%= link_to "»", uploads_path(search: params[:search].merge(source_matches: upload.source)) %>
</span>
<br>