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

[#57904] move content controller further out

Tobias Dillmannd3fc2ae398e7
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 3477e188cbc..b30d04035b0 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -116,7 +116,7 @@ See COPYRIGHT and LICENSE files for more details.
</div>
<% end %>
<div class="content-overlay"></div>
- <main id="content-wrapper" class="<%= initial_classes %>">
+ <%= content_tag :main, id: "content-wrapper", class: initial_classes, data: stimulus_content_data do %>
<%# Primerized flash messages are being rendered separately %>
<div id="primerized-flash-messages" class="op-primer-flash">
<%= render_primerized_flash %>
@@ -134,8 +134,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<%= content_tag :div,
id: 'content',
- class: "#{initial_classes} #{'content--split' if content_for?(:content_body_right)}",
- data: stimulus_content_data do %>
+ class: "#{initial_classes} #{'content--split' if content_for?(:content_body_right)}" do %>
<h1 class="hidden-for-sighted accessibility-helper"><%= t(:label_content) %></h1>
<% if content_for?(:content_header) %>
<div id="content-header">
@@ -162,7 +161,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= content_for :content_body_right %>
<% end %>
<% end %>
- </main>
+ <% end %>
</div>
<div id="ajax-indicator" style="display:none;"><span><%= t(:label_loading) %></span></div>
</div>
diff --git a/docs/development/concepts/stimulus/README.md b/docs/development/concepts/stimulus/README.md
index af7199d220f..5bb9b78b1c5 100644
--- a/docs/development/concepts/stimulus/README.md
+++ b/docs/development/concepts/stimulus/README.md
@@ -44,7 +44,7 @@ You need to take care to prefix all actions, values etc. with the exact same pat
### Requiring a page controller
-If you have a single controller used in a partial, we have added a helper to use in a partial in order to append a controller to the `#content`tag. This is useful if your template doesn't have a single DOM root. For example, to load the dynamic `project-storage-form` controller and provide a custom value to it:
+If you have a single controller used in a partial, we have added a helper to use in a partial in order to append a controller to the `#content-wrapper` tag. This is useful if your template doesn't have a single DOM root. For example, to load the dynamic `project-storage-form` controller and provide a custom value to it:
```erb
<% content_controller 'project-storage-form',