Add truncation of image description in the preview [SCI-873]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-16 14:49:37 +01:00
parent cf72da5635
commit a490a12fb1
3 changed files with 6 additions and 3 deletions

View file

@ -9,7 +9,8 @@
<%= link_to download_asset_path(result.asset),
class: 'image-preview-link',
id: "modal_link#{result.asset.id}",
data: {no_turbolink: true, description: "#{result.name}"} do %>
data: {no_turbolink: true,
description: "#{truncate(result.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %>
<%= image_tag result.asset.url(:medium), data: {'preview-url': large_image_url_asset_path(result.asset)} %>
<p><%= truncate(result.asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>

View file

@ -15,7 +15,8 @@
<%= link_to download_asset_path(ff.object),
class: 'image-preview-link',
id: "modal_link#{ff.object.id}",
data: {no_turbolink: true, id: true, status: "asset-present", description: "#{step.position + 1}. #{step.name}"} do %>
data: {no_turbolink: true, id: true, status: "asset-present",
description: "#{step.position + 1}. #{truncate(step.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %>
<%= image_tag ff.object.url(:medium), data: {'preview-url': large_image_url_asset_path(ff.object)} %>
<p><%= truncate(ff.object.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>

View file

@ -76,7 +76,8 @@
<%= link_to download_asset_path(asset),
class: 'image-preview-link',
id: "modal_link#{asset.id}",
data: {no_turbolink: true, id: true, status: "asset-present", description: "#{step.position + 1}. #{step.name}"} do %>
data: {no_turbolink: true, id: true, status: "asset-present",
description: "#{step.position + 1}. #{truncate(step.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %>
<%= image_tag asset.url(:medium), data: {'preview-url': large_image_url_asset_path(asset)} %>
<p><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>