Fix target subtreshold listing
Route targets under goal
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<table id="goals" class="list odd-even">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= l(:field_name) %></th>
|
||||
<th style="width:20%"><%= l(:field_name) %></th>
|
||||
<th><%= l(:field_description) %></th>
|
||||
<th style="width:5%"><%= l(:field_action) %></th>
|
||||
</tr>
|
||||
@@ -12,7 +12,7 @@
|
||||
<tr id="goal-<%= g.id %>" class="primary goal">
|
||||
<td class="name unwrappable">
|
||||
<div style="float:left;">
|
||||
<%= checked_image g.is_binding %><%= link_to g.name, targets_goal_path(g) %>
|
||||
<%= checked_image g.is_binding %><%= link_to g.name, goal_targets_path(g) %>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<%# TODO: display # of active targets/targeted quantities %>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user