Remove duplication rendering map location fields
We're going to move the partial to a component, and this makes it easier.
This commit is contained in:
@@ -44,15 +44,11 @@
|
||||
<%= render Documents::NestedComponent.new(f) %>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:map) %>
|
||||
<div>
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: investment.map_location || MapLocation.new,
|
||||
label: t("budgets.investments.form.map_location"),
|
||||
help: t("budgets.investments.form.map_location_instructions") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: investment.map_location || MapLocation.new,
|
||||
label: t("budgets.investments.form.map_location"),
|
||||
help: t("budgets.investments.form.map_location_instructions") %>
|
||||
|
||||
<div>
|
||||
<%= f.text_field :location %>
|
||||
|
||||
@@ -52,15 +52,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:map) %>
|
||||
<div>
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: proposal.map_location || MapLocation.new,
|
||||
label: t("proposals.form.map_location"),
|
||||
help: t("proposals.form.map_location_instructions") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render "map_locations/form_fields",
|
||||
form: f,
|
||||
map_location: proposal.map_location || MapLocation.new,
|
||||
label: t("proposals.form.map_location"),
|
||||
help: t("proposals.form.map_location_instructions") %>
|
||||
|
||||
<div>
|
||||
<%= f.label :tag_list, t("proposals.form.tags_label") %>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<%= form.label :map_location, label %>
|
||||
<p class="help-text" id="tag-list-help-text"><%= help %></p>
|
||||
<% if feature?(:map) %>
|
||||
<div>
|
||||
<%= form.label :map_location, label %>
|
||||
<p class="help-text" id="tag-list-help-text"><%= help %></p>
|
||||
|
||||
<%= form.fields_for :map_location, map_location do |m_l_fields| %>
|
||||
<%= render_map(map_location, form: m_l_fields) %>
|
||||
<%= form.fields_for :map_location, map_location do |m_l_fields| %>
|
||||
<%= render_map(map_location, form: m_l_fields) %>
|
||||
|
||||
<%= m_l_fields.hidden_field :latitude %>
|
||||
<%= m_l_fields.hidden_field :longitude %>
|
||||
<%= m_l_fields.hidden_field :zoom %>
|
||||
<%= m_l_fields.hidden_field :latitude %>
|
||||
<%= m_l_fields.hidden_field :longitude %>
|
||||
<%= m_l_fields.hidden_field :zoom %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user