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

little refactor of showning no custom fields box when tab has none

Ivan Kuchin4bd18626f94d
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index d3756187c5c..61ca5e638b2 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -27,7 +27,9 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<% if (@custom_fields_by_type[tab[:name]] || []).any? %>
+<% if @custom_fields_by_type[tab[:name]].blank? %>
+ <%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %>
+<% else %>
<div class="generic-table--container">
<div class="generic-table--results-container">
<% if tab[:name] == 'WorkPackageCustomField' %>
@@ -164,6 +166,4 @@ See COPYRIGHT and LICENSE files for more details.
</table>
</div>
</div>
-<% else %>
- <%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %>
<% end %>