Fix invalid HTML in document/image fields labels
These labels weren't associated with any fields, which is invalid HTML. We're using a legend inside a fieldset instead, which is the natural way to group form fields together.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<div class="documents-list">
|
<fieldset class="documents-list">
|
||||||
<%= f.label :documents, t("documents.form.title") %>
|
<legend><%= t("documents.form.title") %></legend>
|
||||||
<p class="help-text"><%= note %></p>
|
<p class="help-text"><%= note %></p>
|
||||||
|
|
||||||
<div id="nested-documents" data-max-documents-allowed="<%= max_documents_allowed %>">
|
<div id="nested-documents" data-max-documents-allowed="<%= max_documents_allowed %>">
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
<div id="max-documents-notice" class="max-documents-notice callout primary text-center <%= "hide" unless max_documents_allowed? %>">
|
<div id="max-documents-notice" class="max-documents-notice callout primary text-center <%= "hide" unless max_documents_allowed? %>">
|
||||||
<%= sanitize(t("documents.max_documents_allowed_reached")) %>
|
<%= sanitize(t("documents.max_documents_allowed_reached")) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</fieldset>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<%= f.label image_fields, t("images.form.title") %>
|
<fieldset>
|
||||||
<p class="help-text"><%= note %></p>
|
<legend><%= t("images.form.title") %></legend>
|
||||||
|
<p class="help-text"><%= note %></p>
|
||||||
|
|
||||||
<div id="nested-image">
|
<div id="nested-image">
|
||||||
<%= f.fields_for image_fields do |image_builder| %>
|
<%= f.fields_for image_fields do |image_builder| %>
|
||||||
<%= render Images::FieldsComponent.new(image_builder, imageable: imageable) %>
|
<%= render Images::FieldsComponent.new(image_builder, imageable: imageable) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= link_to_add_association t("images.form.add_new_image"), f, image_fields,
|
<%= link_to_add_association t("images.form.add_new_image"), f, image_fields,
|
||||||
force_non_association_create: true,
|
force_non_association_create: true,
|
||||||
partial: "images/image_fields",
|
partial: "images/image_fields",
|
||||||
id: "new_image_link",
|
id: "new_image_link",
|
||||||
@@ -20,3 +21,4 @@
|
|||||||
association_insertion_node: "#nested-image",
|
association_insertion_node: "#nested-image",
|
||||||
association_insertion_method: "append"
|
association_insertion_method: "append"
|
||||||
} %>
|
} %>
|
||||||
|
</fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user