34 lines
1.4 KiB
Plaintext
34 lines
1.4 KiB
Plaintext
<div id='measurement-routine-form' class="tabular">
|
|
<%= fields_for :routine do |routine_f| %>
|
|
<p>
|
|
<%= routine_f.select :id, options_from_collection_for_select(
|
|
@project.measurement_routines, :id, :name, @routine.id),
|
|
{required: true}, autocomplete: 'off',
|
|
onchange: "var mr_id = $('#measurement_routine_attributes_id').val();
|
|
$.ajax({
|
|
url: '#{measurement_routine_path(id: :mr_id)}'.replace('mr_id', mr_id),
|
|
dataType: 'script'
|
|
});
|
|
return false;" %>
|
|
<%= link_to_if l(:button_edit), '#',
|
|
onclick: "var mr_id = $('#measurement_routine_attributes_id').val();
|
|
$.ajax({
|
|
url: '#{edit_measurement_routine_path(id: :mr_id)}'.replace('mr_id', mr_id),
|
|
dataType: 'script'
|
|
});
|
|
return false;",
|
|
class: 'icon icon-edit' %>
|
|
<%= link_to_if l(:button_cancel), '#', onclick: "cancel edit" %>
|
|
</p>
|
|
|
|
<% if @routine.persisted? %>
|
|
<% if @routine.description? %>
|
|
<p style='white-space: pre-wrap;' ><%= @routine.description %></p>
|
|
<% end %>
|
|
<% else %>
|
|
<p><%= routine_f.text_field :name, required: true, style: "width: 95%;" %></p>
|
|
<p><%= ff.text_area :description, cols: 40, rows: 3, style: "width: 95%;" %></p>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|