Simplify rendering document/image fields
We were adding <div> tags with the `images` or `documents` HTML class prettly much every time we rendered a NestedComponent. We're now including the HTML class inside the component, as we usually do. We're also rendering the nested components directly, since it's been a while since the partials were changed to simply render the components.
This commit is contained in:
@@ -56,8 +56,8 @@
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_images) %>
|
||||
<div class="images small-12 column">
|
||||
<%= render "images/nested_image", f: f %>
|
||||
<div class="small-12 column">
|
||||
<%= render Images::NestedComponent.new(f) %>
|
||||
<p class="help-text"><%= t("admin.budget_phases.edit.image_description") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_images) %>
|
||||
<div class="images small-12 column">
|
||||
<%= render "/images/nested_image", f: f %>
|
||||
<div class="small-12 column">
|
||||
<%= render Images::NestedComponent.new(f) %>
|
||||
<p class="help-text"><%= t("admin.budgets.edit.image_description") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
<%= form_for(Poll::Question::Answer.new, url: admin_answer_documents_path(answer)) do |f| %>
|
||||
<%= render "shared/errors", resource: answer %>
|
||||
|
||||
<div class="documents">
|
||||
<%= render "documents/nested_documents", f: f %>
|
||||
</div>
|
||||
<%= render Documents::NestedComponent.new(f) %>
|
||||
|
||||
<div class="small-12 medium-6 large-2">
|
||||
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
|
||||
|
||||
Reference in New Issue
Block a user