Preliminary Target #new support
This commit is contained in:
13
app/views/goals/_form.html.erb
Normal file
13
app/views/goals/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="tabular">
|
||||
<%= fields_for 'measurement[routine_attributes]', routine do |ff| %>
|
||||
<%= ff.hidden_field :id %>
|
||||
<p>
|
||||
<label><%= l(:field_name) %><span class="required"> *</span></label>
|
||||
<%= ff.text_field :name, required: true, style: "width: 95%;" %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_description) %></label>
|
||||
<%= ff.text_area :description, cols: 40, rows: 3, style: "width: 95%;" %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
27
app/views/goals/_show_form.html.erb
Normal file
27
app/views/goals/_show_form.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<div>
|
||||
<%= fields_for 'target[goal_attributes]', goal do |ff| %>
|
||||
<p>
|
||||
<label><%= l(:field_goal) %><span class="required"> *</span></label>
|
||||
<%= ff.select :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),
|
||||
dataType: 'script'
|
||||
});
|
||||
return false;" %>
|
||||
<%= link_to l(:button_edit), '#',
|
||||
onclick: "var goal_id = $('#target_goal_attributes_id').val();
|
||||
$.ajax({
|
||||
url: '#{edit_goal_path(id: :goal_id)}'.replace('goal_id', goal_id),
|
||||
dataType: 'script'
|
||||
});
|
||||
return false;",
|
||||
class: 'icon icon-edit' %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if goal.description? %>
|
||||
<p style='white-space: pre-wrap;' ><%= goal.description %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user