1
0

WIP: Targets configurable with Quantities

This commit is contained in:
cryptogopher
2021-02-07 11:02:41 +01:00
parent 316005bf1f
commit 8b17b33603
23 changed files with 218 additions and 108 deletions

View File

@@ -1,21 +1,20 @@
<label for="goal_id"><%= l(:field_goal) %><span class="required"> *</span></label>
<%= select_tag :goal_id,
options_from_collection_for_select(@project.goals, :id, :name, @goal.id),
required: true, autocomplete: 'off',
onchange: "var goal_id = $('#target_goal_attributes_id').val();
$.ajax({
url: '#{goal_path(id: :goal_id)}'.replace('goal_id', goal_id),
<%= goal_f.collection_select :id, @project.goals, :id, :name,
{include_blank: false, required: true, label: :field_goal},
autocomplete: 'off',
onchange: "$.ajax({
url: '#{goal_path(id: :goal_id)}'
.replace('goal_id', $('#target_goal_attributes_id').val()),
dataType: 'script'
});
return false;" %>
<%= link_to l(:button_add), '#',
onclick: "var goal_id = $('#target_goal_attributes_id').val();
$.ajax({
url: '#{edit_goal_path(id: :goal_id)}'.replace('goal_id', goal_id),
onclick: "$.ajax({
url: '#{edit_goal_path(id: :goal_id)}'
.replace('goal_id', $('#target_goal_attributes_id').val()),
dataType: 'script'
});
return false;",
class: 'icon icon-add' %>
<% if @goal.description? %>
<p style='white-space: pre-wrap;' ><%= @goal.description %></p>
<% if goal_f.object.description? %>
<p style='white-space: pre-wrap;' ><%= goal_f.object.description %></p>
<% end %>