From 51b5adc1d4872a0e79d8c2aeb600bcbdf1868318 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Mon, 7 Oct 2024 12:55:06 +0200 Subject: [PATCH] [58261] Version info shows html tag (#16900) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Mark the hours as html_safe so that they are shown correctly * Remove unused functionas and classes * Remove unused style definitions --------- Co-authored-by: Oliver Günther --- app/helpers/application_helper.rb | 6 ------ app/views/versions/show.html.erb | 4 ++-- frontend/src/global_styles/content/_tables.sass | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fbeabfd68b2e..079034343892 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -172,12 +172,6 @@ def labeled_check_box_tags(name, collection, options = {}) end.join.html_safe end - def html_hours(text) - html_safe_gsub(text, - %r{(\d+)\.(\d+)}, - '\1.\2') - end - def html_safe_gsub(string, *gsub_args, &) html_safe = string.html_safe? result = string.gsub(*gsub_args, &) diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index b1c43a297acc..63198f80c000 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -73,12 +73,12 @@ See COPYRIGHT and LICENSE files for more details. - + <% if User.current.allowed_in_project?(:view_time_entries, @project) %> - + <% end %>
<%= Version.human_attribute_name(:estimated_hours) %><%= html_hours(l_hours(@version.estimated_hours)) %><%= l_hours(@version.estimated_hours) %>
<%= t(:label_spent_time) %><%= html_hours(l_hours(@version.spent_hours)) %><%= l_hours(@version.spent_hours) %>
diff --git a/frontend/src/global_styles/content/_tables.sass b/frontend/src/global_styles/content/_tables.sass index fc1f477de2b4..18725c164daa 100644 --- a/frontend/src/global_styles/content/_tables.sass +++ b/frontend/src/global_styles/content/_tables.sass @@ -55,8 +55,6 @@ table font-style: normal font-weight: var(--base-text-weight-bold) background-color: #EEEEEE - .hours-dec - font-size: 0.9em #workflow_form .generic-table--results-container @@ -144,8 +142,6 @@ tr td &.hours font-weight: var(--base-text-weight-bold) - .hours-dec - font-size: 0.9em .date .spot-drop-modal display: block