Last changes on Redmine 4.0
This commit is contained in:
9
app/views/measurement_routines/_edit_form.html.erb
Normal file
9
app/views/measurement_routines/_edit_form.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div id='measurement-routine-form'>
|
||||
<% if @measurement.routine.persisted? %>
|
||||
<%= render partial: 'measurement_routines/show_form',
|
||||
locals: {routine: @measurement.routine} %>
|
||||
<% else %>
|
||||
<%= render partial: 'measurement_routines/form',
|
||||
locals: {routine: @measurement.routine} %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,13 +1,33 @@
|
||||
<div class="tabular">
|
||||
<%= fields_for 'measurement[routine_attributes]', routine do |ff| %>
|
||||
<%= ff.hidden_field :id %>
|
||||
<div id='measurement-routine-form' class="tabular">
|
||||
<%= fields_for :routine do |routine_f| %>
|
||||
<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%;" %>
|
||||
<%= 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>
|
||||
|
||||
Reference in New Issue
Block a user