Settings Pages
Settings pages usually stretch to the full width of the viewport as they tend not to have addition horizontally-positioned elements.
Settings page form helper
As specified in the documentation for forms, we prefer limiting the width of a form for legibility. Because the default behaviour of form elements to fill the full width of the container, we wrap forms in a container that limits its available width.
Any view component rendering a form should use the the admin_settings_primer_form_with
form helper instead of the standard primer_form_with
. The form itself stays unchanged. This
way, the rendered form is wrapped into a container with 680px
max-width.
<%= admin_settings_primer_form_with(**form_options) do |f| render(WorkPackages::Types::SettingsForm.new(f)) end %>
As a general rule, only free-floating forms should use this wrapper.
Forms that are contained inside box-components (eg. setting up or editing a File store or an OpenID provider) do not need this wrapper; they can stretch to the full width of the box table they are contained in. Individual elements will of course have their own width setting.