DOCX not working if result name empty.

This commit is contained in:
Giga Chubinidze 2023-09-29 10:38:27 +04:00
parent 80afa31632
commit 07ce65f5e6
6 changed files with 6 additions and 6 deletions

View file

@ -18,7 +18,7 @@ module Reports::Docx::DrawResultAsset
end
@docx.p do
text result.name, italic: true
text result.name.presence || '(unnamed)', italic: true
text ' '
link I18n.t('projects.reports.elements.download'), asset_url do
italic true

View file

@ -38,7 +38,7 @@ module Reports::Docx::DrawResultTable
end
end
@docx.p do
text result.name, italic: true
text result.name.presence || '(unnamed)', italic: true
text " #{I18n.t('search.index.archived')} ", bold: true if result.archived?
text ' '
text I18n.t 'projects.reports.elements.result_table.table_name', name: table.name

View file

@ -8,7 +8,7 @@ module Reports::Docx::DrawResultText
color = @color
@docx.p
@docx.p do
text result.name, italic: true
text result.name.presence || '(unnamed)', italic: true
text " #{I18n.t('search.index.archived')} ", bold: true if result.archived?
text ' '
text I18n.t('projects.reports.elements.result_table.user_time',

View file

@ -7,7 +7,7 @@
<%= file_extension_icon_html(asset, true) %>
</span>
<span class="result-name">
<%= result.name %>
<%= result.name.presence || '(unnamed)' %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>

View file

@ -6,7 +6,7 @@
<div class="report-element report-result-element report-result-table-element">
<div class="report-element-header">
<div class="result-name">
<%= name %>
<%= name.presence || '(unnamed)' %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>

View file

@ -6,7 +6,7 @@
<div class="report-element report-result-element report-result-text-element">
<div class="report-element-header">
<div class="result-name">
<%= name %>
<%= name.presence || '(unnamed)' %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>