Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix rubocop issues

Henriette Darge46d83831bf88
diff --git a/app/helpers/mail_notification_helper.rb b/app/helpers/mail_notification_helper.rb
index 8d5b37a7c8d..a803d8088a1 100644
--- a/app/helpers/mail_notification_helper.rb
+++ b/app/helpers/mail_notification_helper.rb
@@ -84,13 +84,13 @@ module MailNotificationHelper
default_options.merge(options).map { |k, v| "#{k}=#{v}" }.join(' ')
end
- def placeholder_cell(number, is_vertical = false)
- style = if is_vertical
+ def placeholder_cell(number, vertical:)
+ style = if vertical
"max-width:#{number}; min-width:#{number}; width:#{number}"
else
"line-height:#{number}; max-width:0; min-width:0; height:#{number}; width:0; font-size:#{number}"
end
- content_tag('td', ' '.html_safe, style: style).html_safe
+ content_tag('td', ' '.html_safe, style: style)
end
end
diff --git a/app/views/digest_mailer/work_packages.html.erb b/app/views/digest_mailer/work_packages.html.erb
index cc00d112332..925af8c248d 100644
--- a/app/views/digest_mailer/work_packages.html.erb
+++ b/app/views/digest_mailer/work_packages.html.erb
@@ -1,6 +1,6 @@
<table <%= placeholder_table_styles %>>
<tr>
- <%= placeholder_cell('20px') %>
+ <%= placeholder_cell('20px', vertical: false) %>
</tr>
</table>
@@ -57,7 +57,7 @@
<%= I18n.t(:"mail.digests.work_packages.more_to_see.#{count}", count: number_of_overflowing_work_packages) %>
</span>
</td>
- <%= placeholder_cell('10px', true) %>
+ <%= placeholder_cell('10px', vertical: true) %>
<td>
<a href="<%= notifications_center_url %>"
target="_blank"
@@ -79,7 +79,7 @@
</tr>
</table>
</td>
- <%= placeholder_cell('10px', true) %>
+ <%= placeholder_cell('10px', vertical: true) %>
<td>
<%= render partial: 'mailer/notification_settings_button' %>
</td>
@@ -88,7 +88,7 @@
<table>
<tr>
- <%= placeholder_cell('20px') %>
+ <%= placeholder_cell('20px', vertical: false) %>
</tr>
</table>
</td>
diff --git a/app/views/mailer/_notification_mailer_header.html.erb b/app/views/mailer/_notification_mailer_header.html.erb
index 637c3aefd69..d8a2817843e 100644
--- a/app/views/mailer/_notification_mailer_header.html.erb
+++ b/app/views/mailer/_notification_mailer_header.html.erb
@@ -3,7 +3,7 @@
<td>
<table <%= placeholder_table_styles %>>
<tr>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
<td>
<table <%= placeholder_table_styles(width:'100%',style: "width:100%") %>>
<tr>
@@ -14,7 +14,7 @@
</td>
</tr>
<tr>
- <%= placeholder_cell('8px') %>
+ <%= placeholder_cell('8px', vertical: false) %>
</tr>
<tr>
<td>
@@ -24,7 +24,7 @@
</td>
</tr>
<tr>
- <%= placeholder_cell('24px') %>
+ <%= placeholder_cell('24px', vertical: false) %>
</tr>
<tr>
<td>
@@ -36,11 +36,11 @@
</td>
</tr>
<tr>
- <%= placeholder_cell('40px') %>
+ <%= placeholder_cell('40px', vertical: false) %>
</tr>
</table>
</td>
- <%= placeholder_cell('16px', true) %>
+ <%= placeholder_cell('16px', vertical: true) %>
<td style="vertical-align: top;">
<table <%= placeholder_table_styles %>>
<tr>
diff --git a/app/views/mailer/_notification_row.html.erb b/app/views/mailer/_notification_row.html.erb
index b1ec240ccde..6850e2e3085 100644
--- a/app/views/mailer/_notification_row.html.erb
+++ b/app/views/mailer/_notification_row.html.erb
@@ -3,13 +3,13 @@
target="_blank">
<table <%= placeholder_table_styles(width:'100%',style: "width:100%;border-width:1px;border-color:#E0E0E0;border-style:solid;border-radius:10px") %>>
<tr>
- <%= placeholder_cell('12px') %>
+ <%= placeholder_cell('12px', vertical: false) %>
</tr>
<tr>
<td>
<table <%= placeholder_table_styles(width:'100%',style: 'width:100%;font-size:14px;') %>>
<tr>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
<td>
<table <%= placeholder_table_styles %>>
<tr>
@@ -27,7 +27,7 @@
</tr>
</table>
</td>
- <%= placeholder_cell('8px', true) %>
+ <%= placeholder_cell('8px', vertical: true) %>
<td width="100%" style="color: #878787;">
#<%= work_package.id %> - <%= work_package.project %>
<% unique_reasons = unique_reasons_of_notifications(notifications_by_work_package) %>
@@ -56,51 +56,51 @@
</tr>
</table>
</td>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
</tr>
<tr>
- <%= placeholder_cell('12px', true) %>
- <%= placeholder_cell('16px') %>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
+ <%= placeholder_cell('16px', vertical: false) %>
+ <%= placeholder_cell('12px', vertical: true) %>
</tr>
<tr>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
<td>
<table <%= placeholder_table_styles(style: 'font-size:16px;font-weight:bold') %>>
<tr>
<td style="color: <%= type_color(work_package.type, '#333333') %>;white-space: nowrap;">
<%= work_package.type.to_s.upcase %>
</td>
- <%= placeholder_cell('4px', true) %>
+ <%= placeholder_cell('4px', vertical: true) %>
<td width="100%" style="color: #333333;">
<%= work_package.subject %>
</td>
</tr>
</table>
</td>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
</tr>
<tr>
- <%= placeholder_cell('12px', true) %>
- <%= placeholder_cell('12px') %>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
+ <%= placeholder_cell('12px', vertical: false) %>
+ <%= placeholder_cell('12px', vertical: true) %>
</tr>
<tr>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
<td><%= yield %></td>
- <%= placeholder_cell('12px', true) %>
+ <%= placeholder_cell('12px', vertical: true) %>
</tr>
</table>
</td>
</tr>
<tr>
- <%= placeholder_cell('12px') %>
+ <%= placeholder_cell('12px', vertical: false) %>
</tr>
</table>
<table>
<tr>
- <%= placeholder_cell('20px') %>
+ <%= placeholder_cell('20px', vertical: false) %>
</tr>
</table>
</a>
\ No newline at end of file