From eb29c50379190e25fcb14bf3a88a2ba06b0d469c Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Fri, 8 Jun 2018 09:01:59 +0200 Subject: [PATCH] Fix asset link preview, fix inventory item modal window styling --- .../_repository_row_info_modal.html.erb | 10 +++++----- app/views/shared/_asset_link.html.erb | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/views/repositories/_repository_row_info_modal.html.erb b/app/views/repositories/_repository_row_info_modal.html.erb index 40faf068c..515347427 100644 --- a/app/views/repositories/_repository_row_info_modal.html.erb +++ b/app/views/repositories/_repository_row_info_modal.html.erb @@ -28,14 +28,14 @@ <% @repository_row.repository_cells.each do |repository_cell| %>
- <% if repository_cell.value_type == 'RepositoryAssetValue' %> - <%= render partial: "shared/asset_link", locals: { asset: repository_cell.value.asset, display_image_tag: false }, formats: :html %> - <% else %> <%= t "repository_row.modal_info.custom_field", cf: repository_cell.repository_column.name %> - <%= custom_auto_link(repository_cell.value.formatted, simple_format: false, team: current_team) %> + <% if repository_cell.value_type == 'RepositoryAssetValue' %> + <%= render partial: "shared/asset_link", locals: { asset: repository_cell.value.asset, display_image_tag: false }, formats: :html %> + <% else %> + <%= custom_auto_link(repository_cell.value.formatted, simple_format: false, team: current_team) %> + <% end %> - <% end %> <% end %>

diff --git a/app/views/shared/_asset_link.html.erb b/app/views/shared/_asset_link.html.erb index 9cac33ccc..7dbd2482f 100644 --- a/app/views/shared/_asset_link.html.erb +++ b/app/views/shared/_asset_link.html.erb @@ -7,8 +7,8 @@ class: 'file-preview-link', id: "modal_link#{asset.id}", data: { no_turbolink: true, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(asset) } do %> -

<%= truncate(asset.file_file_name, - length: Constants::FILENAME_TRUNCATION_LENGTH) %>

+ <%= truncate(asset.file_file_name, + length: Constants::FILENAME_TRUNCATION_LENGTH) %> <% end %> <% else %> @@ -19,8 +19,17 @@ <% if asset.is_image? && display_image_tag %> <%= image_tag asset.url(:medium) %> <% end %> -

<%= truncate(asset.file_file_name, - length: Constants::FILENAME_TRUNCATION_LENGTH) %>

+ <% if display_image_tag %> +

+ <%= truncate(asset.file_file_name, + length: Constants::FILENAME_TRUNCATION_LENGTH) %> +

+ <% else %> + + <%= truncate(asset.file_file_name, + length: Constants::FILENAME_TRUNCATION_LENGTH) %> + + <% end %> <% end %> <% end %> <% else %>