1
0

Fix target subtreshold listing

Route targets under goal
This commit is contained in:
cryptogopher
2021-03-06 13:00:50 +01:00
parent 09e27eb754
commit 406eabaccc
9 changed files with 27 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
<% if goal_f.object.is_binding? %>
<p>
<%= date_field :effective_from, value: @effective_from %>
<%= goal_f.date_field :effective_from, value: @effective_from, required: true %>
</p>
<% end %>

View File

@@ -1,7 +1,7 @@
<h2><%= t ".heading_new_target" %></h2>
<%# url: project_targets_path(@project, @view_params), %>
<%= labelled_form_for [@project, @goal], remote: true,
<%= labelled_form_for @goal, remote: true,
html: {id: 'new-target-form', name: 'new-target-form'} do |goal_f| %>
<%= error_messages_for *@targets %>

View File

@@ -5,10 +5,10 @@
<%= threshold_f.collection_select :quantity_id,
@project.quantities.target.children_of(parent_id),
:id, :name,
{prompt: parent_id.nil? ? false : '.', required: true, no_label: true},
{include_blank: parent_id.nil? ? false : '.', required: true, no_label: true},
{autocomplete: 'off',
onchange: "$.ajax({
url: '#{subthresholds_project_targets_path(parent_id: parent_id)}',
url: '#{subthresholds_goal_targets_path(@goal, parent_id: parent_id)}',
data: 'quantity_id=' + $(this).val(),
dataType: 'html',
success: function(data) {

View File

@@ -6,6 +6,9 @@
</div>
<%= title [t("goals.index.heading"), project_goals_path(@project)], @goal.name %>
<% if @goal.description? %>
<p class="subtitle" style='white-space: pre-wrap;'><%= @goal.description %></p>
<% end %>
<div id='targets'>
<%= render partial: 'targets/index' %>
</div>