1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
2022-07-24 16:46:28 +02:00

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>