From 1c0bd1a0ec505c73c04b12a11ea6ad8924a03a7e Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Tue, 5 Dec 2023 21:06:07 +0100 Subject: [PATCH] Only hide attachments if settings found --- app/views/issues/_hide_attachments.html.slim | 5 +++-- app/views/reports/_additionals_simple.html.slim | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/issues/_hide_attachments.html.slim b/app/views/issues/_hide_attachments.html.slim index 2320cb47..8b190ec6 100644 --- a/app/views/issues/_hide_attachments.html.slim +++ b/app/views/issues/_hide_attachments.html.slim @@ -1,8 +1,9 @@ - if @issue.attachments.any? + - max_files = Additionals.setting :issue_hide_max_attachments - file_count = @issue.attachments.length - - if file_count > Additionals.setting(:issue_hide_max_attachments).to_i + - if max_files.present? && file_count > max_files.to_i fieldset.collapsible.collapsed.hide-attachments - legend onclick="toggleFieldset(this);" class="icon icon-collapsed" + legend.icon.icon-collapsed onclick='toggleFieldset(this);' strong = l :label_attachment_plural = " (#{file_count})" diff --git a/app/views/reports/_additionals_simple.html.slim b/app/views/reports/_additionals_simple.html.slim index 508490e8..0d107acd 100644 --- a/app/views/reports/_additionals_simple.html.slim +++ b/app/views/reports/_additionals_simple.html.slim @@ -1,7 +1,7 @@ ruby: case field_name when 'assigned_to_id' - rows = if Setting.issue_group_assignment? # rubocop: disable Lint/UselessAssignment + rows = if Setting.issue_group_assignment? # rubocop: disable Lint/UselessAssignment @project.visible_principals else @project.visible_users